From d26b3d42ed9eefa68a36167aedb0a70f5d336f46 Mon Sep 17 00:00:00 2001 From: gnattery Date: Thu, 21 Mar 2013 00:37:46 +1100 Subject: [PATCH] standardise button styles --- app/views/comments/_form.html.haml | 2 +- app/views/comments/_single.html.haml | 4 ++-- app/views/crops/index.html.haml | 2 +- app/views/crops/show.html.haml | 6 +++--- app/views/devise/registrations/edit.html.haml | 2 +- app/views/devise/registrations/new.html.haml | 2 +- app/views/devise/sessions/new.html.haml | 2 +- app/views/forums/_form.html.haml | 2 +- app/views/forums/index.html.haml | 4 ++-- app/views/forums/show.html.haml | 4 ++-- app/views/gardens/_form.html.haml | 2 +- app/views/gardens/index.html.haml | 6 +++--- app/views/gardens/show.html.haml | 6 +++--- app/views/home/_blurb.html.haml | 2 +- app/views/home/index.html.haml | 6 +++--- app/views/members/show.html.haml | 2 +- app/views/notifications/index.html.haml | 5 +---- app/views/notifications/show.html.haml | 2 +- app/views/plantings/_form.html.haml | 2 +- app/views/plantings/_thumbnail.html.haml | 4 ++-- app/views/plantings/show.html.haml | 8 ++++---- app/views/posts/_form.html.haml | 2 +- app/views/posts/_single.html.haml | 2 +- app/views/posts/show.html.haml | 6 +++--- app/views/roles/index.html.haml | 6 +++--- app/views/roles/show.html.haml | 2 +- app/views/scientific_names/index.html.haml | 6 +++--- app/views/scientific_names/show.html.haml | 2 +- spec/views/notifications/show.html.haml_spec.rb | 2 +- 29 files changed, 50 insertions(+), 53 deletions(-) diff --git a/app/views/comments/_form.html.haml b/app/views/comments/_form.html.haml index 5eb9fc606..ca9a70336 100644 --- a/app/views/comments/_form.html.haml +++ b/app/views/comments/_form.html.haml @@ -12,7 +12,7 @@ .field = f.text_area :body, :rows => 6, :class => 'input-block-level' .actions - = f.submit 'Post comment', :class => 'btn' + = f.submit 'Post comment', :class => 'btn btn-primary' - if defined?(@post) .field = f.hidden_field :post_id, :value => @post.id diff --git a/app/views/comments/_single.html.haml b/app/views/comments/_single.html.haml index d4ae3765a..1d98ac2cd 100644 --- a/app/views/comments/_single.html.haml +++ b/app/views/comments/_single.html.haml @@ -17,8 +17,8 @@ - if can? :edit, comment or can? :destroy, comment .comment-actions - if can? :edit, comment - = link_to 'Edit', edit_comment_path(comment), :class => 'btn' + = link_to 'Edit', edit_comment_path(comment), :class => 'btn btn-mini' - if can? :destroy, comment = link_to 'Delete', comment, method: :delete, | - data: { confirm: 'Are you sure?' }, :class => 'btn' + data: { confirm: 'Are you sure?' }, :class => 'btn btn-mini' diff --git a/app/views/crops/index.html.haml b/app/views/crops/index.html.haml index 9355a4c12..dbcbcf2c2 100644 --- a/app/views/crops/index.html.haml +++ b/app/views/crops/index.html.haml @@ -16,4 +16,4 @@ - if can? :create, Crop %div - = link_to 'New Crop', new_crop_path, {:class => 'btn'} + = link_to 'New Crop', new_crop_path, {:class => 'btn btn-primary'} diff --git a/app/views/crops/show.html.haml b/app/views/crops/show.html.haml index 0f6138b4f..cdaedc917 100644 --- a/app/views/crops/show.html.haml +++ b/app/views/crops/show.html.haml @@ -19,9 +19,9 @@ - if can? :edit, @crop or can? :destroy, @crop %p - if can? :edit, @crop - = link_to 'Edit', edit_crop_path(@crop), { :class => 'btn' } + = link_to 'Edit', edit_crop_path(@crop), { :class => 'btn btn-mini' } - if can? :destroy, @crop - = link_to 'Destroy', @crop, method: :delete, data: { confirm: 'Are you sure?' }, :class => 'btn' + = link_to 'Destroy', @crop, method: :delete, data: { confirm: 'Are you sure?' }, :class => 'btn btn-mini' %p - =link_to "Plant this", new_planting_path(:crop_id => @crop.id), :class => 'btn btn-large btn-primary' + =link_to "Plant this", new_planting_path(:crop_id => @crop.id), :class => 'btn btn-primary' diff --git a/app/views/devise/registrations/edit.html.haml b/app/views/devise/registrations/edit.html.haml index ebee1bfcb..b1de31e94 100644 --- a/app/views/devise/registrations/edit.html.haml +++ b/app/views/devise/registrations/edit.html.haml @@ -43,6 +43,6 @@ .controls= f.password_field :password_confirmation .form-actions - = f.submit "Update", :class => 'btn' + = f.submit "Update", :class => 'btn btn-primary' =f.hidden_field(:tos_agreement, :value => true) diff --git a/app/views/devise/registrations/new.html.haml b/app/views/devise/registrations/new.html.haml index 071d1956c..e34c83ffd 100644 --- a/app/views/devise/registrations/new.html.haml +++ b/app/views/devise/registrations/new.html.haml @@ -26,6 +26,6 @@ = link_to('Terms of Service', url_for(:action => 'tos', :controller => '/policy')) .form-actions - = f.submit "Sign up", :class => 'btn' + = f.submit "Sign up", :class => 'btn btn-primary' = render "devise/shared/links" diff --git a/app/views/devise/sessions/new.html.haml b/app/views/devise/sessions/new.html.haml index bfc96283d..ad691992a 100644 --- a/app/views/devise/sessions/new.html.haml +++ b/app/views/devise/sessions/new.html.haml @@ -18,7 +18,7 @@ Remember me .form-actions - = f.submit "Sign in", :class => 'btn' + = f.submit "Sign in", :class => 'btn btn-primary' = render "devise/shared/links" diff --git a/app/views/forums/_form.html.haml b/app/views/forums/_form.html.haml index 116af4f2e..fa3d26ba4 100644 --- a/app/views/forums/_form.html.haml +++ b/app/views/forums/_form.html.haml @@ -16,4 +16,4 @@ = 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' + = f.submit 'Save', :class => 'btn btn-primary' diff --git a/app/views/forums/index.html.haml b/app/views/forums/index.html.haml index eddb9c97d..5dec93f14 100644 --- a/app/views/forums/index.html.haml +++ b/app/views/forums/index.html.haml @@ -5,8 +5,8 @@ %p = pluralize(forum.posts.count, "post") | - =link_to "Post", new_post_path(:forum_id => forum.id) - | =link_to "Visit forum", forum + | + =link_to "Post", new_post_path(:forum_id => forum.id), :class => 'btn btn-mini' =render :partial => "posts/summary", :locals => { :posts => forum.posts, :howmany => 4 } diff --git a/app/views/forums/show.html.haml b/app/views/forums/show.html.haml index eb678c971..c2e70090b 100644 --- a/app/views/forums/show.html.haml +++ b/app/views/forums/show.html.haml @@ -10,11 +10,11 @@ = link_to @forum.owner, @forum.owner - if can? :edit, @forum - =link_to "Edit", edit_forum_path(@forum), :class => 'btn' + =link_to "Edit", edit_forum_path(@forum), :class => 'btn btn-mini' %h2 Posts - =link_to "Post something", new_post_path(:forum_id => @forum.id), :class => 'btn' + =link_to "Post something", new_post_path(:forum_id => @forum.id), :class => 'btn btn-primary' - if @forum.posts.count > 0 =render :partial => "posts/summary", :locals => { :posts => @forum.posts } diff --git a/app/views/gardens/_form.html.haml b/app/views/gardens/_form.html.haml index 41db68fd5..d5d5768af 100644 --- a/app/views/gardens/_form.html.haml +++ b/app/views/gardens/_form.html.haml @@ -14,4 +14,4 @@ .controls= f.text_area :description, :rows => 6 .form-actions - = f.submit 'Save', :class => 'btn' + = f.submit 'Save Garden', :class => 'btn btn-primary' diff --git a/app/views/gardens/index.html.haml b/app/views/gardens/index.html.haml index 3f8152341..58759cca2 100644 --- a/app/views/gardens/index.html.haml +++ b/app/views/gardens/index.html.haml @@ -15,9 +15,9 @@ %td= garden.owner %td= garden.slug %td= link_to 'Show', garden - %td= link_to 'Edit', edit_garden_path(garden) - %td= link_to 'Destroy', garden, method: :delete, data: { confirm: 'Are you sure?' } + %td= link_to 'Edit', edit_garden_path(garden), :class => 'btn btn-mini' + %td= link_to 'Destroy', garden, method: :delete, data: { confirm: 'Are you sure?' }, :class => 'btn btn-mini' %br -= link_to 'New Garden', new_garden_path += link_to 'New Garden', new_garden_path, :class => 'btn btn-primary' diff --git a/app/views/gardens/show.html.haml b/app/views/gardens/show.html.haml index d5319d492..8cfe8f2a3 100644 --- a/app/views/gardens/show.html.haml +++ b/app/views/gardens/show.html.haml @@ -14,16 +14,16 @@ = link_to "#{othergarden}", garden_path(othergarden) - if can? :create, @garden - = link_to 'New Garden', new_garden_path, :class => 'btn btn-mini' + = link_to 'Add New Garden', new_garden_path, :class => 'btn btn-mini' .span9 %div :markdown #{@garden.description} - if can? :edit, @garden - = link_to 'Edit Garden', edit_garden_path(@garden), :class => 'btn btn-mini' + = link_to 'Edit garden', edit_garden_path(@garden), :class => 'btn btn-mini' - if can? :destroy, @garden - = link_to 'Delete Garden', @garden, method: :delete, | + = link_to 'Delete garden', @garden, method: :delete, | data: { confirm: 'All plantings associated with this garden will also be deleted. Are you sure?' }, :class => 'btn btn-mini' %h3 diff --git a/app/views/home/_blurb.html.haml b/app/views/home/_blurb.html.haml index 9a07fe558..32efe4b93 100644 --- a/app/views/home/_blurb.html.haml +++ b/app/views/home/_blurb.html.haml @@ -3,4 +3,4 @@ %p #{Growstuff::Application.config.site_name} is a community of food gardeners working together to build an open source platform to track, share, and discuss edible gardens and sustainable lifestyles. You can join us right now and be part of growing our website, from seed to harvest. We welcome you regardless of your experience, and invite you to be part of our development process. -%p= link_to 'Learn more', 'http://wiki.growstuff.org/', :class => 'btn btn-primary btn-large' +%p= link_to 'Learn more', 'http://wiki.growstuff.org/', :class => 'btn btn-primary' diff --git a/app/views/home/index.html.haml b/app/views/home/index.html.haml index 12d05e96a..4c01a274f 100644 --- a/app/views/home/index.html.haml +++ b/app/views/home/index.html.haml @@ -11,13 +11,13 @@ %b Your profile: =link_to current_member, current_member %small - = link_to "Edit", edit_registration_path(current_member) + = link_to "Edit", edit_registration_path(current_member), :class => 'btn btn-mini' %p %b Your location: = current_member.location ? current_member.location : 'Not set' %small - = link_to "Edit", edit_registration_path(current_member) + = link_to "Edit", edit_registration_path(current_member), :class => 'btn btn-mini' %ul.inline %li.first @@ -26,7 +26,7 @@ %li= link_to g.name, g - if can? :create, Garden %li - %small= link_to 'Add a garden', new_garden_path + %small= link_to 'Add a garden', new_garden_path, :class => 'btn btn-mini' .span4 - if current_member.has_role?(:admin) diff --git a/app/views/members/show.html.haml b/app/views/members/show.html.haml index be8a993e9..f344cfb25 100644 --- a/app/views/members/show.html.haml +++ b/app/views/members/show.html.haml @@ -28,7 +28,7 @@ - first_garden = false = link_to g.name, "#garden#{g.id}", 'data-toggle' => 'tab' - if current_member == @member - %li= link_to 'New Garden', '#garden_new', 'data-toggle' => 'tab' + %li= link_to 'New Garden', '#garden_new', 'data-toggle' => 'tab', :class => 'btn btn-primary' .tab-content - first_garden = true - @member.gardens.each do |g| diff --git a/app/views/notifications/index.html.haml b/app/views/notifications/index.html.haml index bb365e90d..3352120cd 100644 --- a/app/views/notifications/index.html.haml +++ b/app/views/notifications/index.html.haml @@ -27,9 +27,6 @@ - else %strong= n.created_at.to_s(:date) %td - - if n.read - = link_to 'Delete', n, method: :delete, data: { confirm: 'Are you sure?' } - - else - %strong= link_to 'Delete', n, method: :delete, data: { confirm: 'Are you sure?' } + = link_to 'Delete', n, method: :delete, data: { confirm: 'Are you sure?' }, :class => 'btn btn-mini' - else You have no messages. diff --git a/app/views/notifications/show.html.haml b/app/views/notifications/show.html.haml index d98ccade9..7d117f6bc 100644 --- a/app/views/notifications/show.html.haml +++ b/app/views/notifications/show.html.haml @@ -15,4 +15,4 @@ #{ strip_tags(@notification.body) } %p - =link_to 'Delete', @notification, method: :delete, data: { confirm: 'Are you sure?' }, :class => 'btn' + =link_to 'Delete notification', @notification, method: :delete, data: { confirm: 'Are you sure?' }, :class => 'btn btn-mini' diff --git a/app/views/plantings/_form.html.haml b/app/views/plantings/_form.html.haml index b7fcc6b6e..93e8b59a3 100644 --- a/app/views/plantings/_form.html.haml +++ b/app/views/plantings/_form.html.haml @@ -25,4 +25,4 @@ .controls= f.text_area :description, :rows => 6 .form-actions - = f.submit 'Save', :class => 'btn' + = f.submit 'Save planting', :class => 'btn btn-primary' diff --git a/app/views/plantings/_thumbnail.html.haml b/app/views/plantings/_thumbnail.html.haml index ee85d7ab8..f1dbef067 100644 --- a/app/views/plantings/_thumbnail.html.haml +++ b/app/views/plantings/_thumbnail.html.haml @@ -27,6 +27,6 @@ - if can? :edit, planting or can? :destroy, planting %p - if can? :edit, planting - =link_to 'Edit', edit_planting_path(planting), :class => 'btn' + =link_to 'Edit planting', edit_planting_path(planting), :class => 'btn btn-mini' - if can? :destroy, planting - =link_to 'Destroy', planting, method: :delete, data: { confirm: 'Are you sure?' }, :class => 'btn' + =link_to 'Destory planting', planting, method: :delete, data: { confirm: 'Are you sure?' }, :class => 'btn btn-mini' diff --git a/app/views/plantings/show.html.haml b/app/views/plantings/show.html.haml index 26d540d16..5aeb12fa6 100644 --- a/app/views/plantings/show.html.haml +++ b/app/views/plantings/show.html.haml @@ -7,7 +7,7 @@ = @planting.planted_at ? @planting.planted_at.to_s(:date) : "not specified" - if can? :edit, @planting %small - = link_to 'Edit', edit_planting_path(@planting) + = link_to 'Edit', edit_planting_path(@planting), :class => 'btn btn-mini' %p %b Where: =link_to "#{@planting.owner}'s", @planting.owner @@ -19,13 +19,13 @@ = @planting.quantity != 0 ? @planting.quantity : "not specified" - if can? :edit, @planting %small - = link_to 'Edit', edit_planting_path(@planting) + = link_to 'Edit', edit_planting_path(@planting), :class => 'btn btn-mini' .span6 .well %h3 = link_to @planting.crop, @planting.crop - if can? :create, Planting - = link_to 'Plant this', new_planting_path, :class => 'btn' + = link_to 'Plant another', new_planting_path, :class => 'btn btn-primary' %p %b Scientific name: @@ -49,4 +49,4 @@ #{ @planting.description != "" ? @planting.description : "No description given." } - if can? :edit, @planting - = link_to 'Edit', edit_planting_path(@planting) + = link_to 'Edit', edit_planting_path(@planting), :class => 'btn btn-mini' diff --git a/app/views/posts/_form.html.haml b/app/views/posts/_form.html.haml index d4fe1704a..23a4ada4d 100644 --- a/app/views/posts/_form.html.haml +++ b/app/views/posts/_form.html.haml @@ -20,4 +20,4 @@ .field = f.hidden_field :forum_id, :value => forum.id - = f.submit "Post", :class => 'btn' + = f.submit "Post", :class => 'btn btn-primary' diff --git a/app/views/posts/_single.html.haml b/app/views/posts/_single.html.haml index 5dd0ebd20..c1070c7b9 100644 --- a/app/views/posts/_single.html.haml +++ b/app/views/posts/_single.html.haml @@ -30,6 +30,6 @@ %li= link_to "Reply", new_comment_path(:post_id => post.id) %li= link_to "Permalink", post -if can? :edit, post - %li= link_to "Edit", edit_post_path(post) + %li= link_to "Edit", edit_post_path(post), :class => 'btn btn-mini' diff --git a/app/views/posts/show.html.haml b/app/views/posts/show.html.haml index f74ce6d81..c54fd1e1a 100644 --- a/app/views/posts/show.html.haml +++ b/app/views/posts/show.html.haml @@ -5,10 +5,10 @@ - if can? :edit, @post or can? :destroy, @post .post-actions - if can? :edit, @post - = link_to 'Edit Post', edit_post_path(@post), :class => 'btn' + = link_to 'Edit Post', edit_post_path(@post), :class => 'btn btn-mini' - if can? :destroy, @post = link_to 'Delete Post', @post, method: :delete, | - data: { confirm: 'Are you sure?' }, :class => 'btn' + data: { confirm: 'Are you sure?' }, :class => 'btn btn-mini' %a{:name => "comments"} @@ -23,4 +23,4 @@ - if can? :create, Comment .post-actions - =link_to 'Comment', new_comment_path(:post_id => @post.id), :class => 'btn' + =link_to 'Comment', new_comment_path(:post_id => @post.id), :class => 'btn btn-primary' diff --git a/app/views/roles/index.html.haml b/app/views/roles/index.html.haml index c503b1284..37e32b060 100644 --- a/app/views/roles/index.html.haml +++ b/app/views/roles/index.html.haml @@ -13,9 +13,9 @@ %td= role.name %td= role.description %td= link_to 'Show', role - %td= link_to 'Edit', edit_role_path(role) - %td= link_to 'Destroy', role, method: :delete, data: { confirm: 'Are you sure?' } + %td= link_to 'Edit', edit_role_path(role), :class => 'btn btn-mini' + %td= link_to 'Destroy', role, method: :delete, data: { confirm: 'Are you sure?' }, :class => 'btn btn-mini' %br -= link_to 'New Role', new_role_path += link_to 'New Role', new_role_path, :class => 'btn btn-primary' diff --git a/app/views/roles/show.html.haml b/app/views/roles/show.html.haml index 7bd0488c7..fc8edb76c 100644 --- a/app/views/roles/show.html.haml +++ b/app/views/roles/show.html.haml @@ -7,6 +7,6 @@ %b Description: = @role.description -= link_to 'Edit', edit_role_path(@role) += link_to 'Edit', edit_role_path(@role), :class => 'btn btn-mini' \| = link_to 'Back', roles_path diff --git a/app/views/scientific_names/index.html.haml b/app/views/scientific_names/index.html.haml index 386b17ec7..7b799575f 100644 --- a/app/views/scientific_names/index.html.haml +++ b/app/views/scientific_names/index.html.haml @@ -15,12 +15,12 @@ %td= link_to 'Show', scientific_name %td - if can? :edit, scientific_name - = link_to 'Edit', edit_scientific_name_path(scientific_name) + = link_to 'Edit', edit_scientific_name_path(scientific_name), :class => 'btn btn-mini' %td - if can? :destroy, scientific_name - = link_to 'Destroy', scientific_name, method: :delete, data: { confirm: 'Are you sure?' } + = link_to 'Destroy', scientific_name, method: :delete, data: { confirm: 'Are you sure?' }, :class => 'btn btn-mini' %br - if can? :create, ScientificName - = link_to 'New Scientific name', new_scientific_name_path + = link_to 'New Scientific name', new_scientific_name_path, :class => 'btn btn-primary' diff --git a/app/views/scientific_names/show.html.haml b/app/views/scientific_names/show.html.haml index 891bd52f6..d4ccc5575 100644 --- a/app/views/scientific_names/show.html.haml +++ b/app/views/scientific_names/show.html.haml @@ -7,6 +7,6 @@ %b Crop: = @scientific_name.crop_id -= link_to 'Edit', edit_scientific_name_path(@scientific_name) += link_to 'Edit', edit_scientific_name_path(@scientific_name), :class => 'btn btn-mini' \| = link_to 'Back', scientific_names_path diff --git a/spec/views/notifications/show.html.haml_spec.rb b/spec/views/notifications/show.html.haml_spec.rb index 26251395b..7893986af 100644 --- a/spec/views/notifications/show.html.haml_spec.rb +++ b/spec/views/notifications/show.html.haml_spec.rb @@ -15,7 +15,7 @@ describe "notifications/show" do end it "includes a delete button" do - assert_select "a", "Delete" + assert_select "a", "Delete notification" end end