diff --git a/app/views/crops/_form.html.haml b/app/views/crops/_form.html.haml index 8db5a5d8c..0c8fc8c45 100644 --- a/app/views/crops/_form.html.haml +++ b/app/views/crops/_form.html.haml @@ -1,4 +1,4 @@ -= form_for @crop, :html => {:class => 'form-horizontal'} do |f| += form_for @crop, :html => {:class => 'form-horizontal', :role => "form"} do |f| - if @crop.errors.any? #error_explanation %h3= "#{pluralize(@crop.errors.count, "error")} prohibited this crop from being saved:" @@ -13,31 +13,33 @@ on the Growstuff wiki. .form-group - = f.label :name, :class => 'control-label' - .controls - = f.text_field :name - %span.help-inline Name in US English; singular; capitalize proper nouns only. + = f.label :name, :class => 'control-label col-md-2' + .col-md-8 + = f.text_field :name, :class => 'form-control' + %span.help-block Name in US English; singular; capitalize proper nouns only. .form-group - = f.label :en_wikipedia_url, 'Wikipedia URL', :class => 'control-label' - .controls - = f.text_field :en_wikipedia_url - %span.help-inline Link to this crop's page on the English language Wikipedia. + = f.label :en_wikipedia_url, 'Wikipedia URL', :class => 'control-label col-md-2' + .col-md-8 + = f.text_field :en_wikipedia_url, :class => 'form-control' + %span.help-block Link to this crop's page on the English language Wikipedia. .form-group - = f.label :parent_id, 'Parent crop', :class => 'control-label' - .controls - = collection_select(:crop, :parent_id, Crop.all, :id, :name, {:include_blank => true}) - %span.help-inline Optional. For setting up crop hierarchies for varieties etc. + = f.label :parent_id, 'Parent crop', :class => 'control-label col-md-2' + .col-md-8 + = collection_select(:crop, :parent_id, Crop.all, :id, :name, {:include_blank => true}, :class => 'form-control') + %span.help-block Optional. For setting up crop hierarchies for varieties etc. %p %span.help-block You may enter up to 3 scientific names for a crop. Most crops will have only one. = f.fields_for :scientific_names do |sn| .form-group - = sn.label :scientific_name, "Scientific name", :class => 'control-label' - .controls - = sn.text_field :scientific_name + = sn.label :scientific_name, "Scientific name", :class => 'control-label col-md-2' + .col-md-8 + = sn.text_field :scientific_name, :class => 'form-control' + .col-md-2 - if sn.object && sn.object.persisted? %label.checkbox = sn.check_box :_destroy = sn.label :_destroy, "Delete" - .form-actions - = f.submit 'Save', :class => 'btn btn-primary' + .form-group + .form-actions.col-md-offset-2.col-md-8 + = f.submit 'Save', :class => 'btn btn-primary' diff --git a/app/views/forums/_form.html.haml b/app/views/forums/_form.html.haml index 503481187..8168f30cd 100644 --- a/app/views/forums/_form.html.haml +++ b/app/views/forums/_form.html.haml @@ -1,4 +1,4 @@ -= form_for @forum, :html => { :class => 'form-horizontal' } do |f| += form_for @forum, :html => { :class => 'form-horizontal', :role => "form" } do |f| - if @forum.errors.any? #error_explanation %h2= "#{pluralize(@forum.errors.count, "error")} prohibited this forum from being saved:" @@ -7,13 +7,17 @@ %li= msg .form-group - = f.label :name, :class => 'control-label' - .controls= f.text_field :name, :class => 'form-control' + = f.label :name, :class => 'control-label col-md-2' + .col-md-8 + = f.text_field :name, :class => 'form-control' .form-group - = f.label :description, :class => 'control-label' - .controls= f.text_area :description, :rows => 6, :class => 'form-control' + = f.label :description, :class => 'control-label col-md-2' + .col-md-8 + = f.text_area :description, :rows => 6, :class => 'form-control' .form-group - = f.label :owner_id, :class => 'control-label' - .controls= collection_select(:forum, :owner_id, Member.all, :id, :login_name) - .form-actions - = f.submit 'Save', :class => 'btn btn-primary' + = f.label :owner_id, :class => 'control-label col-md-2' + .col-md-8 + = collection_select(:forum, :owner_id, Member.all, :id, :login_name, {}, :class => 'form-control') + .form-group + .form-actions.col-md-offset-2.col-md-8 + = f.submit 'Save', :class => 'btn btn-primary' diff --git a/app/views/gardens/_form.html.haml b/app/views/gardens/_form.html.haml index 7a1c5e59e..6313762c4 100644 --- a/app/views/gardens/_form.html.haml +++ b/app/views/gardens/_form.html.haml @@ -1,4 +1,4 @@ -= form_for(@garden, :html => {:class => "form-horizontal"}) do |f| += form_for(@garden, :html => {:class => "form-horizontal", :role => "form"}) do |f| - if @garden.errors.any? #error_explanation %h2= "#{pluralize(@garden.errors.count, "error")} prohibited this garden from being saved:" @@ -7,19 +7,19 @@ %li= msg .form-group - = f.label :name, :class => 'control-label' - .controls - = f.text_field :name + = f.label :name, :class => 'control-label col-md-2' + .col-md-8 + = f.text_field :name, :class => 'form-control' .form-group - = f.label :description, :class => 'control-label' - .controls - = f.text_area :description, :rows => 6 + = f.label :description, :class => 'control-label col-md-2' + .col-md-8 + = f.text_area :description, :rows => 6, :class => 'form-control' .form-group - = f.label :location, :class => 'control-label' - .controls - = f.text_field :location, :value => @garden.location || current_member.location + = f.label :location, :class => 'control-label col-md-2' + .col-md-8 + = f.text_field :location, :value => @garden.location || current_member.location, :class => 'form-control' %span.help-block If you have a location set in your profile, it will be used when you create a new garden. @@ -29,18 +29,18 @@ =link_to "Change your location.", edit_member_registration_path .form-group - = f.label :area, :class => 'control-label' - .controls - = f.number_field :area, :class => 'input-small' - = f.select(:area_unit, Garden::AREA_UNITS_VALUES, {:include_blank => false}, :class => 'input-medium') + = f.label :area, :class => 'control-label col-md-2' + .col-md-2 + = f.number_field :area, :class => 'input-small form-control' + .col-md-2 + = f.select(:area_unit, Garden::AREA_UNITS_VALUES, {:include_blank => false}, :class => 'form-control') .form-group - = f.label 'Active? ', :class => 'control-label' - .controls + = f.label 'Active? ', :class => 'control-label col-md-2' + .col-md-8 = f.check_box :active - %span.help-inline - You can mark a garden as inactive if you no longer use it. + You can mark a garden as inactive if you no longer use it. - - .form-actions - = f.submit 'Save Garden', :class => 'btn btn-primary' + .form-group + .form-actions.col-md-offset-2.col-md-8 + = f.submit 'Save Garden', :class => 'btn btn-primary' diff --git a/app/views/scientific_names/_form.html.haml b/app/views/scientific_names/_form.html.haml index 2ee348e4a..e8d08978a 100644 --- a/app/views/scientific_names/_form.html.haml +++ b/app/views/scientific_names/_form.html.haml @@ -1,4 +1,4 @@ -= form_for @scientific_name, :html => {:class => 'form-horizontal'} do |f| += form_for @scientific_name, :html => {:class => 'form-horizontal', :role => "form"} do |f| - if @scientific_name.errors.any? #error_explanation %h2= "#{pluralize(@scientific_name.errors.count, "error")} prohibited this scientific_name from being saved:" @@ -13,12 +13,13 @@ on the Growstuff wiki. .form-group - = f.label :crop_id, :class => 'control-label' - .controls - = collection_select(:scientific_name, :crop_id, Crop.all, :id, :name, :selected => @scientific_name.crop_id || @crop.id) + = f.label :crop_id, :class => 'control-label col-md-2' + .col-md-8 + = collection_select(:scientific_name, :crop_id, Crop.all, :id, :name, { :selected => @scientific_name.crop_id || @crop.id }, :class => 'form-control') .form-group - = f.label :scientific_name, :class => 'control-label' - .controls - = f.text_field :scientific_name - .form-actions - = f.submit 'Save', :class => 'btn btn-primary' + = f.label :scientific_name, :class => 'control-label col-md-2' + .col-md-8 + = f.text_field :scientific_name, :class => 'form-control' + .form-group + .form-actions.col-md-offset-2.col-md-8 + = f.submit 'Save', :class => 'btn btn-primary'