Skip to content

Commit

Permalink
Allow overriding of bootstrap 3 CSS
Browse files Browse the repository at this point in the history
Resolves #78
  • Loading branch information
Floppy committed Mar 15, 2017
1 parent 365e9a5 commit e678a5e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions app.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@
"required": true,
"value": "password",
"description": "The password for your SMTP server, for sending mail"
},
"BOOTSTRAP_CSS_URL": {
"required": false,
"description": "A URL for a Bootstrap 3 CSS file. If not specified, the default theme will be used"
}
},
"formation": {
Expand Down
4 changes: 4 additions & 0 deletions app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
module ApplicationHelper

def bootstrap_url
ENV['BOOTSTRAP_CSS_URL'] || "//maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css"
end

def new_session_path(scope)
new_user_session_path
end
Expand Down
2 changes: 1 addition & 1 deletion app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<%= csrf_meta_tags %>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css">
<link rel="stylesheet" href="<%= bootstrap_url %>">
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
<%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %>
<%= favicon_link_tag ENV['FAVICON_URL'], type: 'image/png' if ENV['FAVICON_URL'] %>
Expand Down

0 comments on commit e678a5e

Please sign in to comment.