Skip to content
This repository has been archived by the owner on Feb 24, 2024. It is now read-only.

Moving to bootstrap 4 #1021

Merged
merged 3 commits into from
Apr 10, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion buffalo/cmd/new.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ var app = newapp.Generator{
CIProvider: "none",
AsWeb: true,
Docker: "multi",
Bootstrap: 3,
Bootstrap: 4,
}

var newCmd = &cobra.Command{
Expand Down
2 changes: 1 addition & 1 deletion buffalo/cmd/updater/npm.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func PackageJSONCheck(r *Runner) error {

g := newapp.Generator{
App: r.App,
Bootstrap: 3,
Bootstrap: 4,
}

box := webpack.TemplateBox
Expand Down
2 changes: 1 addition & 1 deletion buffalo/cmd/updater/webpack.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func WebpackCheck(r *Runner) error {

g := newapp.Generator{
App: r.App,
Bootstrap: 3,
Bootstrap: 4,
}

box := webpack.TemplateBox
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{ if eq .opts.Bootstrap 4 -}}
@import "~bootstrap/scss/bootstrap.scss";
{{ else -}}
{{ if eq .opts.Bootstrap 3 -}}
@import "~bootstrap-sass/assets/stylesheets/_bootstrap-sprockets.scss";
@import "~bootstrap-sass/assets/stylesheets/_bootstrap.scss";
{{ else -}}
@import "~bootstrap/scss/bootstrap.scss";
{{ end -}}
@import "~font-awesome/css/font-awesome.css";
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
require("expose-loader?$!expose-loader?jQuery!jquery");
{{ if eq .opts.Bootstrap 4 -}}
require("bootstrap/dist/js/bootstrap.bundle.js");
{{ else -}}
{{ if eq .opts.Bootstrap 3 -}}
require("bootstrap-sass/assets/javascripts/bootstrap.js");
{{ else -}}
require("bootstrap/dist/js/bootstrap.bundle.js");
{{ end -}}

$(() => {
Expand Down
6 changes: 3 additions & 3 deletions generators/assets/webpack/templates/package.json.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
"license": "MIT",
"repository": "github.com/gobuffalo/buffalo",
"dependencies": {
{{ if eq .opts.Bootstrap 4 -}}
"bootstrap": "4.0.0",
{{ else -}}
{{ if eq .opts.Bootstrap 3 -}}
"bootstrap-sass": "~3.3.7",
{{ else -}}
"bootstrap": "4.1.0",
{{ end -}}
"font-awesome": "~4.7.0",
"jquery": "~3.2.1",
Expand Down
6 changes: 3 additions & 3 deletions generators/newapp/templates/templates/application.html.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
<meta charset="utf-8">
<title>Buffalo - {{ .opts.Name.Title }}</title>
{{- if not .opts.WithWebpack }}
{{- if eq .opts.Bootstrap 4 }}
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/css/bootstrap.min.css" integrity="sha384-PsH8R72JQ3SOdhVi3uxftmaW6Vc51MKb0q5P2rRUpPvrszuE4W1povHYgTpBfshb" crossorigin="anonymous">
{{- else }}
{{- if eq .opts.Bootstrap 3 }}
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
{{- else }}
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css" integrity="sha384-9gVQ4dYFwwWSjIDZnLEWnxCjeSWFphJiwGPXr1jddIhOegiu1FwO5qRGvFXOdJZ4" crossorigin="anonymous">
{{- end }}
{{- end }}
<%= stylesheetTag("application.css") %>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
</div>

<ul class="list-unstyled list-inline">
<li><a href="<%= {{.opts.Name.VarCasePlural}}Path() %>" class="btn btn-info">Back to all {{.opts.Model.ModelPlural}}</a></li>
<li><a href="<%= edit{{.opts.Name.Model}}Path({ {{.opts.Name.ParamID}}: {{.opts.Model.VarCaseSingular}}.ID })%>" class="btn btn-warning">Edit</a></li>
<li><a href="<%= {{.opts.Name.VarCaseSingular}}Path({ {{.opts.Name.ParamID}}: {{.opts.Model.VarCaseSingular}}.ID })%>" data-method="DELETE" data-confirm="Are you sure?" class="btn btn-danger">Destroy</a>
<li class="list-inline-item"><a href="<%= {{.opts.Name.VarCasePlural}}Path() %>" class="btn btn-info">Back to all {{.opts.Model.ModelPlural}}</a></li>
<li class="list-inline-item"><a href="<%= edit{{.opts.Name.Model}}Path({ {{.opts.Name.ParamID}}: {{.opts.Model.VarCaseSingular}}.ID })%>" class="btn btn-warning">Edit</a></li>
<li class="list-inline-item"><a href="<%= {{.opts.Name.VarCaseSingular}}Path({ {{.opts.Name.ParamID}}: {{.opts.Model.VarCaseSingular}}.ID })%>" data-method="DELETE" data-confirm="Are you sure?" class="btn btn-danger">Destroy</a>
</ul>

{{ range $p := .opts.Props -}}
Expand Down