Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

update bootstrap, simple_form and so on

  • Loading branch information...
commit 29500b8cfdcc4e2cf18b8fd5cc7fa0868c329321 1 parent 41791fb
@flyerhzm flyerhzm authored
Showing with 182 additions and 134 deletions.
  1. +4 −4 app/assets/javascripts/application.js
  2. +3 −10 app/assets/javascripts/railsbp_bootstrap.js.coffee
  3. +0 −1  app/assets/stylesheets/application.css
  4. +3 −0  app/assets/stylesheets/collaborators.css.sass
  5. +10 −5 app/assets/stylesheets/layout.css.sass
  6. +11 −4 app/assets/stylesheets/repositories.css.sass
  7. +0 −10 app/assets/stylesheets/subscriptions.css.sass
  8. +0 −7 app/assets/stylesheets/users.css.sass
  9. +1 −1  app/cells/account/tabs.html.haml
  10. +2 −2 app/cells/build/tabs.html.haml
  11. +6 −6 app/cells/header/display.html.haml
  12. +5 −0 app/cells/header_cell.rb
  13. +3 −3 app/cells/repository/configurations_form.html.haml
  14. +2 −2 app/cells/repository/tabs.html.haml
  15. +1 −1  app/helpers/application_helper.rb
  16. +5 −5 app/views/collaborators/index.html.haml
  17. +6 −6 app/views/contacts/new.html.haml
  18. +7 −7 app/views/repositories/edit.html.haml
  19. +4 −4 app/views/repositories/new.html.haml
  20. +4 −4 app/views/users/registrations/edit.html.haml
  21. +1 −1  config/environments/production.rb
  22. +102 −49 config/initializers/simple_form.rb
  23. +2 −2 lib/templates/haml/scaffold/_form.html.haml
View
8 app/assets/javascripts/application.js
@@ -6,12 +6,12 @@
//
//= require jquery
//= require jquery_ujs
-//= require bootstrap-tabs
+//= require bootstrap-tab
//= require bootstrap-modal
//= require bootstrap-dropdown
-//= require bootstrap-alerts
-//= require bootstrap-buttons
-//= require bootstrap-twipsy
+//= require bootstrap-alert
+//= require bootstrap-button
+//= require bootstrap-tooltip
//= require highstock
//= require railsbp_bootstrap
//
View
13 app/assets/javascripts/railsbp_bootstrap.js.coffee
@@ -1,13 +1,11 @@
# $ ->
-# $("body > .topbar").scrollSpy()
+# $("body > .navbar").scrollSpy()
$ ->
- $(".tabs").tabs()
- $ ->
- $("a[rel=twipsy]").twipsy live: true
+ $("a[rel=tooltip]").tooltip()
# $ ->
# $("a[rel=popover]").popover offset: 10
# $ ->
-# $(".topbar-wrapper").dropdown()
+# $(".navbar-wrapper").dropdown()
$ ->
$(".alert-message").alert()
$ ->
@@ -27,8 +25,3 @@ $ ->
$(".modal .close").click ->
$(this).parents(".modal").toggle()
-$ ->
- $(".btn").button "complete"
-
-$ ->
- $('.topbar').dropdown()
View
1  app/assets/stylesheets/application.css
@@ -3,6 +3,5 @@
* and any sub-directories. You're free to add application-wide styles to this file and they'll appear at
* the top of the compiled file, but it's generally better to create a new file per style scope.
*= require_self
- *= require bootstrap
*= require_tree .
*/
View
3  app/assets/stylesheets/collaborators.css.sass
@@ -1,3 +1,6 @@
// Place all the styles related to the collaborators controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
+form.new_collaborator
+ #collaborator
+ margin-top: 8px
View
15 app/assets/stylesheets/layout.css.sass
@@ -1,25 +1,26 @@
+@import "bootstrap"
+
body
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif
line-height: 120%
background-color: #eee
-.topbar
+.navbar
h3
margin-left: 110px
li.avatar
padding: 8px 0 0 8px
nav
float: right
- margin-top: 6px
ul.dropdown-menu
min-width: 200px
#share
margin: 0 auto
- margin-top: 50px
+ margin-top: 10px
width: 500px
#flash
margin: 10px 0 0 10px
-.topbar .railsbp_logo
+.navbar .railsbp_logo
float: left
margin: 8px 8px 0 0
@@ -27,7 +28,7 @@ body
padding: 10px 0
background-color: #fff
border: 1px solid #ccc
- .tabs
+ .nav-tabs
li:first-child
margin-left: 25px
.pledgie
@@ -90,3 +91,7 @@ footer
#loading
height: 100px
+
+.simple_form
+ input[type=checkbox]
+ margin-right: 5px
View
15 app/assets/stylesheets/repositories.css.sass
@@ -17,7 +17,7 @@ dd
.edit.btn
float: right
- margin: 3px 20px 0 0
+ margin-right: 20px
.repository-info
padding: 10px 20px
@@ -50,21 +50,28 @@ dd
font-size: 14px
font-weight: bold
margin: 10px 0 0 30px
+ .input
+ margin-left: 150px
.inputs-list
+ margin-top: 5px
+ list-style: none
li
border-bottom: 1px solid #ddd
label
line-height: 30px
input[type=checkbox]
margin-top: 9px
+ float: left
+ margin-right: 10px
input[type=text]
height: 10px
+ display: inline-block
span.description
color: #aaa
margin: 0 0 0 10px
- .textarea.repository-config
- width: 500px
- margin-bottom: 10px
+ textarea
+ display: inline-block
+ margin-bottom: 10px
ul.repositories
list-style: none
View
10 app/assets/stylesheets/subscriptions.css.sass
@@ -1,10 +0,0 @@
-// Place all the styles related to the subscriptions controller here.
-// They will automatically be included in application.css.
-// You can use Sass (SCSS) here: http://sass-lang.com/
-#new_subscription
- label
- width: 180px
- .input
- margin-left: 200px
- select
- width: 120px
View
7 app/assets/stylesheets/users.css.sass
@@ -1,7 +0,0 @@
-#creditCardFormModal
- label
- width: 180px
- .input
- margin-left: 200px
- select
- width: 120px
View
2  app/cells/account/tabs.html.haml
@@ -1,3 +1,3 @@
-%ul.tabs
+%ul.nav.nav-tabs
%li{:class => @active_class_name == "account" ? "active" : ""}= link_to "Account Overview", edit_user_registration_path
%li{:class => @active_class_name == "plans" ? "active" : ""}= link_to "Plan & Billing", :plans
View
4 app/cells/build/tabs.html.haml
@@ -1,5 +1,5 @@
-= link_to 'Edit Repository', [:edit, @repository], :class => "edit btn primary"
-%ul.tabs
+= link_to 'Edit Repository', [:edit, @repository], class: "edit btn btn-primary"
+%ul.nav.nav-tabs
%li{:class => @active_class_name == "current" ? "active" : ""}= link_to "Current", repository_path(@repository)
%li{:class => @active_class_name == "history" ? "active" : ""}= link_to "History", repository_builds_path(@repository)
- if @build
View
12 app/cells/header/display.html.haml
@@ -1,6 +1,6 @@
-%header.topbar
- .topbar-inner
- .container-fluid
+%header.navbar
+ .navbar-inner
+ .container{style: "width:auto;"}
%h3#title
.railsbp_logo
= link_to "Railsbp", root_path, class: 'brand'
@@ -11,9 +11,9 @@
%li= link_to "FAQ", page_path(name: "faq")
%li= link_to "Contact", new_contact_path
- if @user
- %ul.nav.secondary-nav
+ %ul.nav.pull-right
%li.dropdown
- = link_to @repository.try(:name) || "Select a repository", "#", :class => "dropdown-toggle"
+ = link_to name_with_caret(@repository.try(:name) || "Select a repository").html_safe, "#", "class" => "dropdown-toggle", "data-toggle" => "dropdown"
%ul.dropdown-menu
- @repositories.each do |repository|
- unless repository.new_record?
@@ -24,4 +24,4 @@
%li= link_to "Account Setting", edit_user_registration_path
%li.avatar= image_tag @user.gravatar_url size: 24, secure: true
- else
- %nav= link_to "Sign in with Github", user_omniauth_authorize_path(:github), :class => 'primary btn'
+ %nav= link_to "Sign in with Github", user_omniauth_authorize_path(:github), class: "btn btn-primary"
View
5 app/cells/header_cell.rb
@@ -1,4 +1,5 @@
class HeaderCell < Cell::Rails
+ helper_method :name_with_caret
def display(user, repository)
@user = user
@@ -7,4 +8,8 @@ def display(user, repository)
render
end
+ def name_with_caret(name)
+ "#{name}<b class='caret'></b>".html_safe
+ end
+
end
View
6 app/cells/repository/configurations_form.html.haml
@@ -15,9 +15,9 @@
%label
%span= "#{parameter.name}: "
- if parameter.kind == "array"
- = text_area_tag "repository[configs][#{index}][#{parameter.name}]", (@configs[configuration.name].try(:[], parameter.name) || parameter.value).join(", "), class: "textarea repository-config"
+ = text_area_tag "repository[configs][#{index}][#{parameter.name}]", (@configs[configuration.name].try(:[], parameter.name) || parameter.value).join(", "), class: "span6"
- else
= text_field_tag "repository[configs][#{index}][#{parameter.name}]", (@configs[configuration.name].try(:[], parameter.name) || parameter.value), class: "string span1"
%span.description= parameter.description
- .actions
- = form.submit "Save Configurations", :class => "btn primary"
+ .form-actions
+ = form.submit "Save Configurations", class: "btn btn-primary"
View
4 app/cells/repository/tabs.html.haml
@@ -1,5 +1,5 @@
-= link_to 'Show Builds', @repository, :class => "edit btn primary"
-%ul.tabs
+= link_to 'Show Builds', @repository, :class => "edit btn btn-primary"
+%ul.nav.nav-tabs
%li{:class => @active_class_name == "overview" ? "active" : ""}= link_to "Overview", [:edit, @repository]
%li{:class => @active_class_name == "configs" ? "active" : ""}= link_to "Configurations", [:edit, @repository, :configs]
%li{:class => @active_class_name == "collaborators" ? "active" : ""}= link_to "Collaborators", [@repository, :collaborators]
View
2  app/helpers/application_helper.rb
@@ -4,7 +4,7 @@ def notice_message
flash.each do |type, message|
type = :success if type == :notice
- text = content_tag(:div, link_to("x", "#", class: "close") + message, class: "alert-message #{type}")
+ text = content_tag(:div, link_to("x", "#", class: "close", "data-dismiss" => "alert") + message, class: "alert alert-#{type}")
flash_messages << text if message
end
View
10 app/views/collaborators/index.html.haml
@@ -6,17 +6,17 @@
.repository-info.clearfix
.command
- %p= link_to "Synchronize github collaborators", [:sync, @repository, :collaborators], :class => "btn primary", :method => :put
+ %p= link_to "Synchronize github collaborators", [:sync, @repository, :collaborators], class: "btn btn-primary", method: :put
%br/
%p Or add collaborator manually
- = form_tag [@repository, :collaborators], :method => :post do
+ = form_tag [@repository, :collaborators], method: :post, class: "new_collaborator" do
= text_field_tag "collaborator", ""
- = submit_tag "Add", :class => "btn primary"
+ = submit_tag "Add", class: "btn btn-primary"
%p input github name, like flyerhzm
.collaborators
%h3 Collaborators
%ul
- @collaborators.each do |user|
%li
- = link_to user.nickname, "https://github.com/#{user.nickname}", :class => "nickname"
- = link_to "x", repository_collaborator_path(@repository, user), :method => :delete, :confirm => "Are you sure to remove collaborator #{user.nickname}"
+ = link_to user.nickname, "https://github.com/#{user.nickname}", class: "nickname"
+ = link_to "x", repository_collaborator_path(@repository, user), method: :delete, confirm: "Are you sure to remove collaborator #{user.nickname}"
View
12 app/views/contacts/new.html.haml
@@ -3,10 +3,10 @@
%h2 Contact Us
%p.contact You can also contact #{link_to '@railsbp', 'http://twitter.com/railsbp'} on Twitter, or send an email to #{link_to 'contact-us@railsbp.com', 'mailto:contact-us@railsbp.com'}
-= simple_form_for @contact, wrapper: "inline" do |form|
- = form.input :name, input_html: {:class => "span5"}, :label => "Your Name"
- = form.input :email, input_html: {:class => "span5"}, :label => "Your Email"
- = form.input :message, as: :text, input_html: {:class => "span8"}
- .actions
- = form.button :submit, "Submit", :class => "primary"
+= simple_form_for @contact, html: {class: "form-horizontal"} do |form|
+ = form.input :name, input_html: {class: "span5"}, label: "Your Name"
+ = form.input :email, input_html: {class: "span5"}, label: "Your Email"
+ = form.input :message, as: :text, input_html: {class: "span8"}
+ .form-actions
+ = form.submit "Submit", class: "btn btn-primary"
View
14 app/views/repositories/edit.html.haml
@@ -7,19 +7,19 @@
.repository-info
%p
%span Repository token
- = link_to "", "#", class: "question_mark_icon", rel: "twipsy", title: "repository token is used to authorized github hook, paste it to github railsbp hook"
+ = link_to "", "#", class: "question_mark_icon", rel: "tooltip", title: "repository token is used to authorized github hook, paste it to github railsbp hook"
%b= @repository.authentication_token
( for github hook )
-= simple_form_for @repository, wrapper: "inline" do |form|
+= simple_form_for @repository, html: {class: "form-horizontal"} do |form|
= form.input :name, input_html: {class: "span5"}
= form.input :description, input_html: {class: "span5"}
= form.input :html_url, input_html: {class: "span5"}
= form.input :git_url, input_html: {class: "span5"}
= form.input :ssh_url, input_html: {class: "span5"}
- = form.input :branch, input_html: {class: "span5"}, label: "Branch #{link_to '', '#', class: 'question_mark_icon', rel: 'twipsy', title: 'only when push codes to the branch will trigger railsbp service'}".html_safe
- = form.input :visible, label: "Visibility #{link_to '', '#', class: 'question_mark_icon', rel: 'twipsy', title: 'analyze result is visible to everyone if check, otherwise it is accessible only by collaborators'}".html_safe, hint: "if the repository is visible to everyone"
+ = form.input :branch, input_html: {class: "span5"}, label: "Branch #{link_to '', '#', class: 'question_mark_icon', rel: 'tooltip', title: 'only when push codes to the branch will trigger railsbp service'}".html_safe
+ = form.input :visible, label: "Visibility #{link_to '', '#', class: 'question_mark_icon', rel: 'tooltip', title: 'analyze result is visible to everyone if check, otherwise it is accessible only by collaborators'}".html_safe, hint: "if the repository is visible to everyone"
- if @repository.private?
- = form.input :update_configs_url, label: "Update configs url #{link_to '', '#', class: 'question_mark_icon', rel: 'twipsy', title: 'update configs url is used to update rails_best_practices.yml on proxy server'}".html_safe, input_html: {class: "span5"}
- .actions
- = form.button :submit, class: "primary"
+ = form.input :update_configs_url, label: "Update configs url #{link_to '', '#', class: 'question_mark_icon', rel: 'tooltip', title: 'update configs url is used to update rails_best_practices.yml on proxy server'}".html_safe, input_html: {class: "span5"}
+ .form-actions
+ = form.submit class: "btn btn-primary"
View
8 app/views/repositories/new.html.haml
@@ -2,7 +2,7 @@
%h2 Create Repository
-= simple_form_for @repository, wrapper: "inline" do |form|
- = form.input :github_name, input_html: {:class => "span12"}, hint: "if github repository url is https://github.com/railsbp/railsbp.com, github name is railsbp/railsbp.com. You must be the owner of a repository or the collaboarator of a organization repository."
- .actions
- = form.button :submit, :class => "primary"
+= simple_form_for @repository, html: {class: "form-horizontal"} do |form|
+ = form.input :github_name, input_html: {:class => "span6"}, hint: "if github repository url is https://github.com/railsbp/railsbp.com, github name is railsbp/railsbp.com.<br/>You must be the owner of a repository or the collaboarator of a organization repository.".html_safe
+ .form-actions
+ = form.submit class: "btn-primary"
View
8 app/views/users/registrations/edit.html.haml
@@ -4,7 +4,7 @@
= render_cell :account, :tabs, "account"
-= simple_form_for @user, url: registration_path(@user), html: {method: :put}, wrapper: "inline" do |form|
- = form.input :email, hint: "We promise we won't share your email with anyone. It's only used to receive payment receipt", input_html: {:class => "span5"}
- .actions
- = form.button :submit, :class => "primary"
+= simple_form_for @user, url: registration_path(@user), html: {class: "form-horizontal", method: :put} do |form|
+ = form.input :email, hint: "We promise we won't share your email with anyone. It's only used to receive payment receipt", input_html: {class: "span5"}
+ .form-actions
+ = form.submit class: "btn btn-primary"
View
2  config/environments/production.rb
@@ -58,7 +58,7 @@
# Send deprecation notices to registered listeners
config.active_support.deprecation = :notify
- config.action_mailer.default_url_options = { :host => "railsbp.com", :protocol => "https" }
+ config.action_mailer.default_url_options = { :host => "railsbp.com", :protocol => "http" }
config.middleware.use ExceptionNotifier,
:email_prefix => "[railsbp.com] ",
View
151 config/initializers/simple_form.rb
@@ -1,87 +1,143 @@
# Use this setup block to configure all options available in SimpleForm.
SimpleForm.setup do |config|
- # Wrappers are used by the form builder to generate a complete input.
- # You can remove any component from the wrapper, change the order or even
- # add your own to the stack. The options given to the wrappers method
- # are used to wrap the whole input (if any exists).
-
- config.wrappers :inline, :class => 'clearfix', :error_class => :error do |b|
+ # Wrappers are used by the form builder to generate a
+ # complete input. You can remove any component from the
+ # wrapper, change the order or even add your own to the
+ # stack. The options given below are used to wrap the
+ # whole input.
+ config.wrappers :default, :class => :input,
+ :hint_class => :field_with_hint, :error_class => :field_with_errors do |b|
+ ## Extensions enabled by default
+ # Any of these extensions can be disabled for a
+ # given input by passing: `f.input EXTENSION_NAME => false`.
+ # You can make any of these extensions optional by
+ # renaming `b.use` to `b.optional`.
+
+ # Determines whether to use HTML5 (:email, :url, ...)
+ # and required attributes
+ b.use :html5
+
+ # Calculates placeholders automatically from I18n
+ # You can also pass a string as f.input :placeholder => "Placeholder"
b.use :placeholder
- b.use :label
- b.use :tag => 'div', :class => 'input' do |ba|
- ba.use :input
- ba.use :error, :tag => :span, :class => :'help-inline'
- ba.use :hint, :tag => :span, :class => :'help-block'
- end
+
+ ## Optional extensions
+ # They are disabled unless you pass `f.input EXTENSION_NAME => :lookup`
+ # to the input. If so, they will retrieve the values from the model
+ # if any exists. If you want to enable the lookup for any of those
+ # extensions by default, you can change `b.optional` to `b.use`.
+
+ # Calculates maxlength from length validations for string inputs
+ b.optional :maxlength
+
+ # Calculates pattern from format validations for string inputs
+ b.optional :pattern
+
+ # Calculates min and max from length validations for numeric inputs
+ b.optional :min_max
+
+ # Calculates readonly automatically from readonly attributes
+ b.optional :readonly
+
+ ## Inputs
+ b.use :label_input
+ b.use :hint, :wrap_with => { :tag => :span, :class => :hint }
+ b.use :error, :wrap_with => { :tag => :span, :class => :error }
end
- config.wrappers :stacked, :class => "clearfix", :error_class => :error do |b|
+ config.wrappers :bootstrap, :tag => 'div', :class => 'control-group', :error_class => 'error' do |b|
b.use :placeholder
b.use :label
- b.use :hint, :tag => :span, :class => :'help-block'
- b.use :tag => 'div', :class => 'input' do |input|
- input.use :input
- input.use :error, :tag => :span, :class => :'help-inline'
+ b.wrapper :tag => 'div', :class => 'controls' do |ba|
+ ba.use :input
+ ba.use :error, :wrap_with => { :tag => 'span', :class => 'help-inline' }
+ ba.use :hint, :wrap_with => { :tag => 'p', :class => 'help-block' }
end
end
- config.wrappers :prepend, :class => "clearfix", :error_class => :error do |b|
+ config.wrappers :prepend, :tag => 'div', :class => "control-group", :error_class => 'error' do |b|
b.use :placeholder
b.use :label
- b.use :hint, :tag => :span, :class => :'help-block'
- b.use :tag => 'div', :class => 'input' do |input|
- input.use :tag => 'div', :class => 'input-prepend' do |prepend|
+ b.wrapper :tag => 'div', :class => 'controls' do |input|
+ input.wrapper :tag => 'div', :class => 'input-prepend' do |prepend|
prepend.use :input
end
- input.use :error, :tag => :span, :class => :'help-inline'
+ input.use :hint, :wrap_with => { :tag => 'span', :class => 'help-block' }
+ input.use :error, :wrap_with => { :tag => 'span', :class => 'help-inline' }
end
end
- config.wrappers :append, :class => "clearfix", :error_class => :error do |b|
+ config.wrappers :append, :tag => 'div', :class => "control-group", :error_class => 'error' do |b|
b.use :placeholder
b.use :label
- b.use :hint, :tag => :span, :class => :'help-block'
- b.use :tag => 'div', :class => 'input' do |input|
- input.use :tag => 'div', :class => 'input-append' do |append|
+ b.wrapper :tag => 'div', :class => 'controls' do |input|
+ input.wrapper :tag => 'div', :class => 'input-append' do |append|
append.use :input
end
- input.use :error, :tag => :span, :class => :'help-inline'
+ input.use :hint, :wrap_with => { :tag => 'span', :class => 'help-block' }
+ input.use :error, :wrap_with => { :tag => 'span', :class => 'help-inline' }
end
end
+ # Wrappers for forms and inputs using the Twitter Bootstrap toolkit.
+ # Check the Bootstrap docs (http://twitter.github.com/bootstrap)
+ # to learn about the different styles for forms and inputs,
+ # buttons and other elements.
+ config.default_wrapper = :bootstrap
+
+ # Define the way to render check boxes / radio buttons with labels.
+ # Defaults to :nested for bootstrap config.
+ # :inline => input + label
+ # :nested => label > input
+ config.boolean_style = :nested
+
+ # Default class for buttons
+ config.button_class = 'btn'
+
# Method used to tidy up errors.
# config.error_method = :first
# Default tag used for error notification helper.
- # config.error_notification_tag = :p
+ config.error_notification_tag = :div
# CSS class to add for error notification helper.
- # config.error_notification_class = :error_notification
+ config.error_notification_class = 'alert alert-error'
# ID to add for error notification helper.
# config.error_notification_id = nil
- # You can wrap a collection of radio/check boxes in a pre-defined tag, defaulting to none.
- # config.collection_wrapper_tag = nil
-
- # You can wrap each item in a collection of radio/check boxes with a tag, defaulting to span.
- # config.item_wrapper_tag = :span
-
# Series of attempts to detect a default label method for collection.
# config.collection_label_methods = [ :to_label, :name, :title, :to_s ]
# Series of attempts to detect a default value method for collection.
# config.collection_value_methods = [ :id, :to_s ]
+ # You can wrap a collection of radio/check boxes in a pre-defined tag, defaulting to none.
+ # config.collection_wrapper_tag = nil
+
+ # You can define the class to use on all collection wrappers. Defaulting to none.
+ # config.collection_wrapper_class = nil
+
+ # You can wrap each item in a collection of radio/check boxes with a tag,
+ # defaulting to :span. Please note that when using :boolean_style = :nested,
+ # SimpleForm will force this option to be a label.
+ # config.item_wrapper_tag = :span
+
+ # You can define a class to use in all item wrappers. Defaulting to none.
+ # config.item_wrapper_class = nil
+
# How the label text should be generated altogether with the required text.
- config.label_text = lambda { |label, required| "#{label} #{required}" }
+ # config.label_text = lambda { |label, required| "#{required} #{label}" }
# You can define the class to use on all labels. Default is nil.
- # config.label_class = nil
+ config.label_class = 'control-label'
# You can define the class to use on all forms. Default is simple_form.
# config.form_class = :simple_form
+ # You can define which elements should obtain additional classes
+ # config.generate_additional_classes_for = [:wrapper, :label, :input]
+
# Whether attributes are required by default (or not). Default is true.
# config.required_by_default = true
@@ -89,20 +145,14 @@
# Default is enabled.
config.browser_validations = false
- # Determines whether HTML5 types (:email, :url, :search, :tel) and attributes
- # (e.g. required) are used or not. True by default.
- # Having this on in non-HTML5 compliant sites can cause odd behavior in
- # HTML5-aware browsers such as Chrome.
- # config.html5 = true
+ # Collection of methods to detect if a file type was given.
+ # config.file_methods = [ :mounted_as, :file?, :public_filename ]
# Custom mappings for input types. This should be a hash containing a regexp
# to match as key, and the input type that will be used when the field name
# matches the regexp as value.
# config.input_mappings = { /count/ => :integer }
- # Collection of methods to detect if a file type was given.
- # config.file_methods = [ :mounted_as, :file?, :public_filename ]
-
# Default priority for time_zone inputs.
# config.time_zone_priority = nil
@@ -112,9 +162,12 @@
# Default size for text inputs.
# config.default_input_size = 50
- # When false, do not use translations for labels, hints or placeholders.
- # config.translate = true
+ # When false, do not use translations for labels.
+ # config.translate_labels = true
- # Default class for buttons
- config.button_class = 'btn'
+ # Automatically discover new inputs in Rails' autoload path.
+ # config.inputs_discovery = true
+
+ # Cache SimpleForm inputs discovery
+ # config.cache_discovery = !Rails.env.development?
end
View
4 lib/templates/haml/scaffold/_form.html.haml
@@ -1,10 +1,10 @@
= simple_form_for(@<%= singular_table_name %>) do |f|
= f.error_notification
- .inputs
+ .form-inputs
<%- attributes.each do |attribute| -%>
= f.<%= attribute.reference? ? :association : :input %> :<%= attribute.name %>
<%- end -%>
- .actions
+ .form-actions
= f.button :submit
Please sign in to comment.
Something went wrong with that request. Please try again.