From e3627f6dcd84cdffab2ebcb3dcb1a148fd688336 Mon Sep 17 00:00:00 2001 From: Skud Date: Fri, 29 Aug 2014 10:02:56 +1000 Subject: [PATCH 1/3] Fixed devise forms to make them b3ish and pretty --- app/views/devise/confirmations/new.html.haml | 12 ++++++---- app/views/devise/passwords/edit.html.haml | 23 ++++++++++---------- app/views/devise/passwords/new.html.haml | 20 ++++++++--------- app/views/devise/unlocks/new.html.haml | 16 +++++++------- 4 files changed, 38 insertions(+), 33 deletions(-) diff --git a/app/views/devise/confirmations/new.html.haml b/app/views/devise/confirmations/new.html.haml index d190140cd..c7ebdd604 100644 --- a/app/views/devise/confirmations/new.html.haml +++ b/app/views/devise/confirmations/new.html.haml @@ -1,12 +1,16 @@ - content_for :title, "Resend confirmation instructions" -= form_for(resource, :as => resource_name, :url => confirmation_path(resource_name), :html => { :method => :post }) do |f| += form_for(resource, :as => resource_name, :url => confirmation_path(resource_name), :html => { :method => :post, :class => 'form-horizontal', :role => 'form' }) do |f| = devise_error_messages! %p Enter either your login name or your email address to resend the confirmation email. - = f.label :login - = f.text_field :login - = f.submit "Resend confirmation instructions" + .form-group + = f.label :login, :class => 'control-label col-md-2' + .col-md-8 + = f.text_field :login, :class => 'form-control' + .form-group + .form-actions.col-md-offset-2.col-md-8 + = f.submit "Resend confirmation instructions", :class => 'btn btn-primary' = render "devise/shared/links" diff --git a/app/views/devise/passwords/edit.html.haml b/app/views/devise/passwords/edit.html.haml index 2860c6b22..8e31924e5 100644 --- a/app/views/devise/passwords/edit.html.haml +++ b/app/views/devise/passwords/edit.html.haml @@ -1,20 +1,21 @@ - content_for :title, "Change your password" -= form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :put }) do |f| += form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :put, :class => 'form-horizontal', :role => 'form' }) do |f| = devise_error_messages! = f.hidden_field :reset_password_token - %div - = f.label :password, "New password" - %br - = f.password_field :password + .form-group + = f.label :password, "New password", :class => 'control-label col-md-2' + .col-md-8 + = f.password_field :password, :class => 'form-control' - %div - = f.label :password_confirmation, "Confirm new password" - %br - = f.password_field :password_confirmation + .form-group + = f.label :password_confirmation, "Confirm new password", :class => 'control-label col-md-2' + .col-md-8 + = f.password_field :password_confirmation, :class => 'form-control' - %div - = f.submit "Change my password" + .form-group + .form-actions.col-md-offset-2.col-md-8 + = f.submit "Change my password", :class => 'btn btn-primary' = render "devise/shared/links" diff --git a/app/views/devise/passwords/new.html.haml b/app/views/devise/passwords/new.html.haml index 2027975d0..b32607760 100644 --- a/app/views/devise/passwords/new.html.haml +++ b/app/views/devise/passwords/new.html.haml @@ -1,14 +1,14 @@ - content_for :title, "Forgot your password?" -= form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :post }) do |f| - = devise_error_messages! += form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :post, :class => 'form-horizontal', :role => 'form' }) do |f| + = devise_error_messages! - %div - = f.label :login - %br - = f.text_field :login + .form-group + = f.label :login, :class => 'control-label col-md-2' + .col-md-8 + = f.text_field :login, :class => 'form-control' + .form-group + .form-actions.col-md-offset-2.col-md-8 + = f.submit "Send me reset password instructions", :class => 'btn btn-primary' - %div - = f.submit "Send me reset password instructions" - -= render "devise/shared/links" += render "devise/shared/links" diff --git a/app/views/devise/unlocks/new.html.haml b/app/views/devise/unlocks/new.html.haml index f545cd4e7..77d726806 100644 --- a/app/views/devise/unlocks/new.html.haml +++ b/app/views/devise/unlocks/new.html.haml @@ -1,14 +1,14 @@ - content_for :title, "Resend unlock instructions" -= form_for(resource, :as => resource_name, :url => unlock_path(resource_name), :html => { :method => :post }) do |f| += form_for(resource, :as => resource_name, :url => unlock_path(resource_name), :html => { :method => :post, :class => 'form-horizontal', :role => 'form' }) do |f| = devise_error_messages! - %div - = f.label :email - %br - = f.email_field :email - - %div - = f.submit "Resend unlock instructions" + .form-group + = f.label :email, :class => 'control-label col-md-2' + .col-md-8 + = f.email_field :email, :class => 'form-control' + .form-group + .form-actions.col-md-offset-2.col-md-8 + = f.submit "Resend unlock instructions", :class => 'btn btn-primary' = render "devise/shared/links" From 30d436cb5daebcc04cca9104746a009946965953 Mon Sep 17 00:00:00 2001 From: Skud Date: Fri, 29 Aug 2014 10:19:37 +1000 Subject: [PATCH 2/3] Fixed inline form on places page to make it b3-ish --- app/views/places/show.html.haml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/views/places/show.html.haml b/app/views/places/show.html.haml index 2feaf8965..b34846b39 100644 --- a/app/views/places/show.html.haml +++ b/app/views/places/show.html.haml @@ -1,9 +1,11 @@ -content_for :title, "#{ENV['GROWSTUFF_SITE_NAME']} members near #{@place}" -= form_tag(search_places_path, :method => :get, :class => 'form-inline') do - = label_tag :place, "Change location:", :class => 'control-label' - = text_field_tag :new_place +%form{:action => search_places_path, :method => :get, :class => 'form-inline', :role => 'form'} + .form-group + = label_tag :new_place, "Change location:", :class => 'sr-only' + = text_field_tag :new_place, '', :class => 'form-control', :placeholder => "New location..." = submit_tag "Search", :class => 'btn btn-primary' +%br/ %div#placesmap{ :style => "height:300px"} From 8a5d1f2e5e30f112f210a664cd3ba9f4d54c3f9f Mon Sep 17 00:00:00 2001 From: Skud Date: Fri, 29 Aug 2014 10:38:35 +1000 Subject: [PATCH 3/3] Fixed crop wrangler tests to not be order dependent --- spec/features/crop_wranglers_spec.rb | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/spec/features/crop_wranglers_spec.rb b/spec/features/crop_wranglers_spec.rb index 88dd277b2..033aca5f2 100644 --- a/spec/features/crop_wranglers_spec.rb +++ b/spec/features/crop_wranglers_spec.rb @@ -18,10 +18,8 @@ feature "crop wranglers" do within '.crop_wranglers' do expect(page).to have_content 'Crop Wranglers:' - crop_wranglers.each_with_index do |crop_wrangler, index| - link = find(".crop_wrangler:nth-child(#{index + 1}) a") - expect(link.text).to eq(crop_wrangler.login_name) - expect(link['href']).to eq(member_path(crop_wrangler)) + crop_wranglers.each do |crop_wrangler| + page.should have_link crop_wrangler.login_name, :href => member_path(crop_wrangler) end end end