From 01c25df8cf3a2715c954298a3385fb279306c55b Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Thu, 9 Feb 2017 19:34:01 +1300 Subject: [PATCH 01/14] haml-lint all views --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 14b08a2d9..61b67f472 100644 --- a/.travis.yml +++ b/.travis.yml @@ -28,7 +28,7 @@ before_script: - bundle exec rake assets:precompile script: - bundle exec rubocop --display-cop-names --rails - - bundle exec haml-lint app/views/account_types app/views/admin app/views/alternate_names app/views/account_types app/views/comments app/views/crops app/views/forums app/views/gardens app/views/harvests app/views/notifier app/views/orders app/views/photos + - bundle exec haml-lint app/views/ - script/gemfile_check - bundle exec script/check_contributors_md - bundle exec rake db:migrate --trace From 92c3976f0a7e1ffc6bdef815a0b20efe1f466a42 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Thu, 9 Feb 2017 21:02:02 +1300 Subject: [PATCH 02/14] Haml clean up for shared views --- app/views/shared/_account_status.html.haml | 4 ++-- app/views/shared/_form_optional.html.haml | 2 +- app/views/shared/_markdown_help.html.haml | 2 +- app/views/shared/_signin_signup.html.haml | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/views/shared/_account_status.html.haml b/app/views/shared/_account_status.html.haml index 2326eb5eb..a39870956 100644 --- a/app/views/shared/_account_status.html.haml +++ b/app/views/shared/_account_status.html.haml @@ -9,5 +9,5 @@ %strong Paid until: = current_member.account.paid_until_string -- if !current_member.paid? - = link_to "Upgrade and support #{ENV['GROWSTUFF_SITE_NAME']}", shop_path, :class => 'btn btn-primary' +- unless current_member.paid? + = link_to "Upgrade and support #{ENV['GROWSTUFF_SITE_NAME']}", shop_path, class: 'btn btn-primary' diff --git a/app/views/shared/_form_optional.html.haml b/app/views/shared/_form_optional.html.haml index 28fe3598b..0b298d0c1 100644 --- a/app/views/shared/_form_optional.html.haml +++ b/app/views/shared/_form_optional.html.haml @@ -1,2 +1,2 @@ %span.help-block.optional - = I18n.t 'optional', :scope => 'forms' + = I18n.t 'optional', scope: 'forms' diff --git a/app/views/shared/_markdown_help.html.haml b/app/views/shared/_markdown_help.html.haml index 28505a083..55fa128d3 100644 --- a/app/views/shared/_markdown_help.html.haml +++ b/app/views/shared/_markdown_help.html.haml @@ -1,5 +1,5 @@ You can use -=link_to 'Markdown', 'http://daringfireball.net/projects/markdown/syntax/' += link_to 'Markdown', 'http://daringfireball.net/projects/markdown/syntax/' to format your text. %br/ For instance, *italic*, **bold**, or a link [like this](http://to.some.site.com/). diff --git a/app/views/shared/_signin_signup.html.haml b/app/views/shared/_signin_signup.html.haml index 4b87fe70a..46f1e480f 100644 --- a/app/views/shared/_signin_signup.html.haml +++ b/app/views/shared/_signin_signup.html.haml @@ -1,6 +1,6 @@ -=link_to 'Sign in', new_member_session_path += link_to 'Sign in', new_member_session_path or -=link_to 'sign up', new_member_registration_path += link_to 'sign up', new_member_registration_path to = succeed "." do = to From 9a0adadc9a422dff43637478b300eaa22ec1534f Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Thu, 9 Feb 2017 21:02:37 +1300 Subject: [PATCH 03/14] Haml clean up for seeds views --- app/views/seeds/_thumbnail.html.haml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/views/seeds/_thumbnail.html.haml b/app/views/seeds/_thumbnail.html.haml index a48bb13b0..edd464e57 100644 --- a/app/views/seeds/_thumbnail.html.haml +++ b/app/views/seeds/_thumbnail.html.haml @@ -9,7 +9,8 @@ .row .col-md-4 = link_to image_tag((seed.crop.default_photo ? seed.crop.default_photo.thumbnail_url : 'placeholder_150.png'), - alt: seed.crop.name, class: 'img'), seed.crop + alt: seed.crop.name, class: 'img'), + seed.crop .col-md-8 %dl.dl-horizontal %dt Crop : From 9ebe83040214b52ee15b8b5e2f060964ed148e19 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Thu, 9 Feb 2017 21:03:06 +1300 Subject: [PATCH 04/14] Haml clean up for scientific names views --- app/views/scientific_names/_form.html.haml | 20 ++++++++++++-------- app/views/scientific_names/index.html.haml | 7 ++++--- app/views/scientific_names/show.html.haml | 4 ++-- 3 files changed, 18 insertions(+), 13 deletions(-) diff --git a/app/views/scientific_names/_form.html.haml b/app/views/scientific_names/_form.html.haml index a908c3e65..95178f068 100644 --- a/app/views/scientific_names/_form.html.haml +++ b/app/views/scientific_names/_form.html.haml @@ -1,7 +1,9 @@ -= form_for @scientific_name, :html => {:class => 'form-horizontal', :role => "form"} 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.size, "error")} prohibited this scientific_name from being saved:" + %h2 + = pluralize(@scientific_name.errors.size, "error") + prohibited this scientific_name from being saved: %ul - @scientific_name.errors.full_messages.each do |msg| %li= msg @@ -9,17 +11,19 @@ %p %span.help-block For detailed crop wrangling guidelines, please consult the - =link_to "crop wrangling guide", "http://wiki.growstuff.org/index.php/Crop_wrangling" + = link_to "crop wrangling guide", "http://wiki.growstuff.org/index.php/Crop_wrangling" on the Growstuff wiki. .form-group - = f.label :crop_id, :class => 'control-label col-md-2' + = 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') + = collection_select(:scientific_name, :crop_id, Crop.all, :id, + :name, { selected: @scientific_name.crop_id || @crop.id }, + class: 'form-control') .form-group - = f.label :name, :class => 'control-label col-md-2' + = f.label :name, class: 'control-label col-md-2' .col-md-8 - = f.text_field :name, :class => 'form-control' + = f.text_field :name, class: 'form-control' .form-group .form-actions.col-md-offset-2.col-md-8 - = f.submit 'Save', :class => 'btn btn-primary' + = f.submit 'Save', class: 'btn btn-primary' diff --git a/app/views/scientific_names/index.html.haml b/app/views/scientific_names/index.html.haml index 235760960..6e6379c0c 100644 --- a/app/views/scientific_names/index.html.haml +++ b/app/views/scientific_names/index.html.haml @@ -1,7 +1,7 @@ - content_for :title, "Listing scientific names" - if can? :create, ScientificName - %p= link_to 'New Scientific name', new_scientific_name_path, :class => 'btn btn-primary' + %p= link_to 'New Scientific name', new_scientific_name_path, class: 'btn btn-primary' %table %tr @@ -17,7 +17,8 @@ %td= link_to 'Show', scientific_name %td - if can? :edit, scientific_name - = link_to 'Edit', edit_scientific_name_path(scientific_name), :class => 'btn btn-default btn-xs' + = link_to 'Edit', edit_scientific_name_path(scientific_name), class: 'btn btn-default btn-xs' %td - if can? :destroy, scientific_name - = link_to 'Delete', scientific_name, method: :delete, data: { confirm: 'Are you sure?' }, :class => 'btn btn-default btn-xs' + = link_to 'Delete', scientific_name, method: :delete, data: { confirm: 'Are you sure?' }, + class: 'btn btn-default btn-xs' diff --git a/app/views/scientific_names/show.html.haml b/app/views/scientific_names/show.html.haml index 4ae435def..02d0a8e6f 100644 --- a/app/views/scientific_names/show.html.haml +++ b/app/views/scientific_names/show.html.haml @@ -9,7 +9,7 @@ %p#notice= notice -= render :partial => 'crops/approval_status_message', :locals => { :crop => @scientific_name.crop } += render partial: 'crops/approval_status_message', locals: { crop: @scientific_name.crop } %p %b Scientific name: @@ -20,6 +20,6 @@ - if can? :edit, @scientific_name - = link_to 'Edit', edit_scientific_name_path(@scientific_name), :class => 'btn btn-default btn-xs' + = link_to 'Edit', edit_scientific_name_path(@scientific_name), class: 'btn btn-default btn-xs' \| = link_to 'Back', scientific_names_path From 9b7a7d3e8fc5c4d80b47897b3cbc9a004eddbcf3 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Thu, 9 Feb 2017 21:03:34 +1300 Subject: [PATCH 05/14] Haml clean up for product views --- app/views/products/_form.html.haml | 10 ++++++---- app/views/products/index.html.haml | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/app/views/products/_form.html.haml b/app/views/products/_form.html.haml index 78908001a..a3aa8a2f0 100644 --- a/app/views/products/_form.html.haml +++ b/app/views/products/_form.html.haml @@ -1,17 +1,19 @@ = form_for @product do |f| - if @product.errors.any? #error_explanation - %h2= "#{pluralize(@product.errors.size, "error")} prohibited this product from being saved:" + %h2 + = pluralize(@product.errors.size, "error") + prohibited this product from being saved: %ul - @product.errors.full_messages.each do |msg| %li= msg .field = f.label :name - = f.text_field :name, :class => 'form-control' + = f.text_field :name, class: 'form-control' .field = f.label :description - = f.text_area :description, :class => 'form-control' + = f.text_area :description, class: 'form-control' .field = f.label :min_price, "Minimum price (in cents)" = f.text_field :min_price @@ -21,7 +23,7 @@ .field = f.label :account_type = collection_select(:product, :account_type_id, AccountType.all, :id, - :name, :selected => @product.account_type_id ) + :name, selected: @product.account_type_id) .field = f.label :paid_months = f.text_field :paid_months diff --git a/app/views/products/index.html.haml b/app/views/products/index.html.haml index 17053aeca..4945d130e 100644 --- a/app/views/products/index.html.haml +++ b/app/views/products/index.html.haml @@ -22,7 +22,7 @@ %td= product.paid_months %td= link_to 'Show', product %td= link_to 'Edit', edit_product_path(product) - %td= link_to 'Destroy', product, :method => :delete, :data => { :confirm => 'Are you sure?' } + %td= link_to 'Destroy', product, method: :delete, data: { confirm: 'Are you sure?' } %br From c89d1ae94e316016ac7b541ecce868535828af0e Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Thu, 9 Feb 2017 21:05:03 +1300 Subject: [PATCH 06/14] Haml clean ups for plantings views --- app/views/plantings/_nav.haml | 1 + app/views/plantings/_progress_bar.html.haml | 1 + app/views/plantings/_thumbnail.html.haml | 1 - app/views/plantings/show.html.haml | 1 - 4 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/plantings/_nav.haml b/app/views/plantings/_nav.haml index 396d6e021..bb81da701 100644 --- a/app/views/plantings/_nav.haml +++ b/app/views/plantings/_nav.haml @@ -15,3 +15,4 @@ = link_to 'Plant something', new_planting_path, class: 'btn btn-primary' - else = render partial: 'shared/signin_signup', locals: { to: "track what you've planted" } + diff --git a/app/views/plantings/_progress_bar.html.haml b/app/views/plantings/_progress_bar.html.haml index c8f4b20a2..be38c00fc 100644 --- a/app/views/plantings/_progress_bar.html.haml +++ b/app/views/plantings/_progress_bar.html.haml @@ -1,2 +1,3 @@ .progress %div{ class: "progress-bar progress-bar-#{status}", role: "progressbar", style: "width: #{progress}" } + diff --git a/app/views/plantings/_thumbnail.html.haml b/app/views/plantings/_thumbnail.html.haml index 3267dfc79..7edffc7ad 100644 --- a/app/views/plantings/_thumbnail.html.haml +++ b/app/views/plantings/_thumbnail.html.haml @@ -45,7 +45,6 @@ planting, method: :delete, data: { confirm: 'Are you sure?' }, class: 'btn btn-default btn-xs' - .row .col-xs-12.col-md-4 %dl diff --git a/app/views/plantings/show.html.haml b/app/views/plantings/show.html.haml index 7af75f903..f8883ea41 100644 --- a/app/views/plantings/show.html.haml +++ b/app/views/plantings/show.html.haml @@ -27,7 +27,6 @@ = link_to @planting.garden, @planting.garden - unless @planting.owner.location.blank? (#{@planting.owner.location}) - %dt Quantity: %dd = display_planting_quantity(@planting) From 6ecb919f343b987a153a9fae6053858598957c82 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Thu, 9 Feb 2017 21:05:28 +1300 Subject: [PATCH 07/14] haml clean ups for members views --- app/views/members/_contact.html.haml | 6 +++--- app/views/members/_gardens.html.haml | 12 ++++++------ app/views/members/_stats.html.haml | 12 ++++++------ app/views/members/_thumbnail.html.haml | 7 +++++-- app/views/members/finish_signup.haml | 6 +++--- app/views/members/index.html.haml | 7 +++++-- app/views/members/nearby.html.haml | 2 +- app/views/members/show.html.haml | 17 ++++++++++------- app/views/members/show.rss.haml | 4 ++-- 9 files changed, 41 insertions(+), 32 deletions(-) diff --git a/app/views/members/_contact.html.haml b/app/views/members/_contact.html.haml index 224d9c491..3eb55d73e 100644 --- a/app/views/members/_contact.html.haml +++ b/app/views/members/_contact.html.haml @@ -3,17 +3,17 @@ - if twitter_auth %p - = image_tag "twitter_32.png", :size => "32x32", alt: 'Twitter logo' + = image_tag "twitter_32.png", size: "32x32", alt: 'Twitter logo' = link_to twitter_auth.name, "http://twitter.com/#{twitter_auth.name}" - if flickr_auth %p - = image_tag "flickr_32.png", :size => "32x32", alt: 'Flickr logo' + = image_tag "flickr_32.png", size: "32x32", alt: 'Flickr logo' = link_to flickr_auth.name, "http://flickr.com/photos/#{flickr_auth.uid}" - if facebook_auth %p - = image_tag "facebook_32.png", :size => "32x32", alt: 'Facebook logo' + = image_tag "facebook_32.png", size: "32x32", alt: 'Facebook logo' = link_to facebook_auth.name, "http://facebook.com/profile/#{facebook_auth.uid}" - if member.show_email diff --git a/app/views/members/_gardens.html.haml b/app/views/members/_gardens.html.haml index 798ae961b..f09fc42c1 100644 --- a/app/views/members/_gardens.html.haml +++ b/app/views/members/_gardens.html.haml @@ -10,11 +10,11 @@ %li.navbar-right = link_to new_garden_path, class: 'btn' do Add New Garden - .tab-content{style: "padding-top: 1em"} + .tab-content{ style: "padding-top: 1em" } - first_garden = true - gardens.each do |g| - %div{ class: ['tab-pane', first_garden ? 'active' : ''], id: "garden#{g.id}"} + %div{ class: ['tab-pane', first_garden ? 'active' : ''], id: "garden#{g.id}" } - first_garden = false .container @@ -30,7 +30,7 @@ = link_to 'tell us more.', edit_garden_path(g) - - if g.photos.size > 0 or (can? :edit, g and can? :create, Photo) + - if !g.photos.empyy? || (can?(:edit, g) && can?(:create, Photo)) .row %h3 Photos %p= localize_plural(g.photos, Photo) @@ -40,16 +40,16 @@ .col-md-2.six-across = render partial: 'photos/thumbnail', locals: { photo: p } .row - - if can? :create, Photo and can? :edit, g + - if can?(:create, Photo) && can?(:edit, g) %p = link_to "Add photo", new_photo_path(type: "garden", id: g.id), class: 'btn btn-primary' %h3 What's planted here? .row - - if g.featured_plantings.size > 0 + - unless g.featured_plantings.empty? - g.featured_plantings.each.with_index do |planting| .col-xs-12.col-lg-6 - = render partial: "plantings/thumbnail", locals: {:planting => planting} + = render partial: "plantings/thumbnail", locals: { planting: planting } %p = link_to "More about this garden...", url_for(g) diff --git a/app/views/members/_stats.html.haml b/app/views/members/_stats.html.haml index 586ae6d04..346d71296 100644 --- a/app/views/members/_stats.html.haml +++ b/app/views/members/_stats.html.haml @@ -2,34 +2,34 @@ %ul.list-inline %li - - unless member.plantings.empty? + - if !member.plantings.empty? = link_to localize_plural(member.plantings, Planting), plantings_by_owner_path(owner: member) - else 0 plantings %li - - unless member.harvests.empty? + - if !member.harvests.empty? = link_to localize_plural(member.harvests, Harvest), harvests_by_owner_path(owner: member) - else 0 harvests %li - - unless member.seeds.empty? + - if !member.seeds.empty? = link_to localize_plural(member.seeds, Seed), seeds_by_owner_path(owner: member) - else 0 seeds %li - - unless member.posts.empty? + - if !member.posts.empty? = link_to localize_plural(member.posts, Post), posts_by_author_path(author: member) - else 0 posts %li - - unless member.followed.empty? + - if !member.followed.empty? = link_to localize_plural(member.followed, Follow), member_follows_path(member) - else 0 following %li - - unless member.followers.empty? + - if !member.followers.empty? = link_to pluralize(member.followers.size, "follower"), member_followers_path(member) - else 0 followers diff --git a/app/views/members/_thumbnail.html.haml b/app/views/members/_thumbnail.html.haml index 4b57feb78..5ddce4c9f 100644 --- a/app/views/members/_thumbnail.html.haml +++ b/app/views/members/_thumbnail.html.haml @@ -13,7 +13,7 @@ %small %br/ Recently planted: - != member.plantings.first(3).map{|p| link_to p.crop_name, p }.join(", ") + != member.plantings.first(3).map { |p| link_to p.crop_name, p }.join(", ") %p %small Joined @@ -21,4 +21,7 @@ ago. %p %small - = [localize_plural(member.gardens, Garden), localize_plural(member.plantings, Planting), localize_plural(member.seeds, Seed)].join(", ") + = [localize_plural(member.gardens, Garden), + localize_plural(member.plantings, Planting), + localize_plural(member.seeds, Seed)].join(", ") + diff --git a/app/views/members/finish_signup.haml b/app/views/members/finish_signup.haml index 3f0ec03c8..720535a00 100644 --- a/app/views/members/finish_signup.haml +++ b/app/views/members/finish_signup.haml @@ -2,7 +2,7 @@ %p Sign up for a Growstuff account to track your veggie garden and connect with other local growers. -= form_for(current_member, as: 'member', url: finish_signup_path(current_member), html: { role: 'form'}) do |f| += form_for(current_member, as: 'member', url: finish_signup_path(current_member), html: { role: 'form' }) do |f| - if @show_errors && current_member.errors.any? .alert.alert-danger - current_member.errors.full_messages.each do |msg| @@ -31,10 +31,10 @@ .form-group .col-md-offset-2.col-md-8.checkbox %label - = f.check_box :newsletter, :checked => true + = f.check_box :newsletter, checked: true Subscribe to the #{ENV['GROWSTUFF_SITE_NAME']} newsletter .help-inline = render partial: 'devise/registrations/newsletter_blurb' .actions - = f.submit 'Continue', class: 'btn btn-primary' \ No newline at end of file + = f.submit 'Continue', class: 'btn btn-primary' diff --git a/app/views/members/index.html.haml b/app/views/members/index.html.haml index 878c02ea4..a320a4882 100644 --- a/app/views/members/index.html.haml +++ b/app/views/members/index.html.haml @@ -1,9 +1,12 @@ -= content_for :title, t(".title", site_name: "#{ENV['GROWSTUFF_SITE_NAME']}") += content_for :title, t(".title", site_name: ENV['GROWSTUFF_SITE_NAME']) = form_tag(members_path, method: :get, class: 'form-inline', role: 'form') do .form-group = label_tag :sort, "Sort by:", class: 'sr-only' - = select_tag "sort", options_for_select({"Sort alphabetically" => 'alpha', "Sort by recently joined" => "recently_joined"}, @sort || 'alpha'), class: 'form-control' + = select_tag "sort", + options_for_select({ "Sort alphabetically": 'alpha', "Sort by recently joined": "recently_joined" }, + @sort || 'alpha'), + class: 'form-control' = submit_tag "Show", class: 'btn btn-primary' .pagination diff --git a/app/views/members/nearby.html.haml b/app/views/members/nearby.html.haml index a99ce90da..2d9750c3e 100644 --- a/app/views/members/nearby.html.haml +++ b/app/views/members/nearby.html.haml @@ -6,7 +6,7 @@ = form_tag(nearby_members_path, method: :get, class: 'form-inline') do = label_tag :distance, "Find members within", class: 'control-label' = text_field_tag :distance, @distance, class: 'input-mini' - = select_tag :units, options_for_select({"miles" => :mi, "km" => :km}, @units), class: 'input-small' + = select_tag :units, options_for_select({ "miles": :mi, "km": :km }, @units), class: 'input-small' = label_tag :location, "of", class: 'control-label' = text_field_tag :location, @location = submit_tag "Search", class: 'btn btn-primary' diff --git a/app/views/members/show.html.haml b/app/views/members/show.html.haml index 0633eacae..f0214a52f 100644 --- a/app/views/members/show.html.haml +++ b/app/views/members/show.html.haml @@ -12,14 +12,14 @@ = link_to 'Edit profile', edit_member_registration_path, class: 'btn btn-default' - if @member == current_member && !@member.paid? = link_to "Upgrade account", shop_path, class: 'btn btn-default' - - if can? :create, Notification and current_member != @member - = link_to 'Send message', new_notification_path(:recipient_id => @member.id), class: 'btn btn-default' + - if can?(:create, Notification) && current_member != @member + = link_to 'Send message', new_notification_path(recipient_id: @member.id), class: 'btn btn-default' - - if current_member and current_member != @member # must be logged in, can't follow yourself + - if current_member && current_member != @member # must be logged in, can't follow yourself - follow = current_member.get_follow(@member) - - if !follow and can? :create, Follow # not already following - = link_to 'Follow', follows_path(:followed_id => @member.id), method: :post, class: 'btn btn-default' - - if follow and can? :destroy, follow # already following + - if !follow && can?(:create, Follow) # not already following + = link_to 'Follow', follows_path(followed_id: @member.id), method: :post, class: 'btn btn-default' + - if follow && can?(:destroy, follow) # already following = link_to 'Unfollow', follow_path(follow), method: :delete, class: 'btn btn-default' - content_for :member_rss_login_name, @member.login_name @@ -35,4 +35,7 @@ = render partial: "avatar", locals: { member: @member } = render partial: "account", locals: { member: @member } = render partial: "stats", locals: { member: @member } - = render partial: "contact", locals: { member: @member, :twitter_auth => @twitter_auth, :flickr_auth => @flickr_auth, :facebook_auth => @facebook_auth } + = render partial: "contact", locals: { member: @member, + twitter_auth: @twitter_auth, + flickr_auth: @flickr_auth, + facebook_auth: @facebook_auth } diff --git a/app/views/members/show.rss.haml b/app/views/members/show.rss.haml index fa88b66a9..075e3fafb 100644 --- a/app/views/members/show.rss.haml +++ b/app/views/members/show.rss.haml @@ -1,12 +1,12 @@ -%rss{version: 2.0} +%rss{ version: 2.0 } %channel %title #{@member.login_name}'s recent posts (#{ENV['GROWSTUFF_SITE_NAME']}) %link= member_url(@member) - @posts.each do |post| %item %title #{post.subject} by #{post.author.login_name} - %pubDate= post.created_at.to_s(:rfc822) + %pubdate= post.created_at.to_s(:rfc822) %link= post_url(post) %guid= post_url(post) %description From f5e786401df9a159669fd5eb2958ebcb0d8d9d2b Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Fri, 10 Feb 2017 20:00:55 +1300 Subject: [PATCH 08/14] fixed typo --- app/views/members/_gardens.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/members/_gardens.html.haml b/app/views/members/_gardens.html.haml index f09fc42c1..eb69d39a7 100644 --- a/app/views/members/_gardens.html.haml +++ b/app/views/members/_gardens.html.haml @@ -30,7 +30,7 @@ = link_to 'tell us more.', edit_garden_path(g) - - if !g.photos.empyy? || (can?(:edit, g) && can?(:create, Photo)) + - if !g.photos.empty? || (can?(:edit, g) && can?(:create, Photo)) .row %h3 Photos %p= localize_plural(g.photos, Photo) From 123c34b6d1588008d4cd0e56ba10486ea39fb669 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Mon, 13 Feb 2017 07:33:48 +1300 Subject: [PATCH 09/14] Haml cleanup for layout --- app/views/layouts/_footer.html.haml | 6 +-- app/views/layouts/_header.html.haml | 64 +++++++++++++------------ app/views/layouts/_meta.html.haml | 27 +++++++---- app/views/layouts/application.html.haml | 12 ++--- 4 files changed, 61 insertions(+), 48 deletions(-) diff --git a/app/views/layouts/_footer.html.haml b/app/views/layouts/_footer.html.haml index 75e93f27f..e004bf69a 100644 --- a/app/views/layouts/_footer.html.haml +++ b/app/views/layouts/_footer.html.haml @@ -7,6 +7,6 @@ != cms_snippet_content(:footer2) .col-md-4#footer3 != cms_snippet_content(:footer3) - %div(style="float: right;") - %a(href="http://opendefinition.org/ossd/") - %img(src="http://assets.okfn.org/images/ok_buttons/os_80x15_blue.png" alt="") + %div{ style: "float: right;" } + %a{ href: "http://opendefinition.org/ossd/" } + %img{ src: "http://assets.okfn.org/images/ok_buttons/os_80x15_blue.png", alt: "" } diff --git a/app/views/layouts/_header.html.haml b/app/views/layouts/_header.html.haml index 6b50c1845..3eb0d8ca0 100644 --- a/app/views/layouts/_header.html.haml +++ b/app/views/layouts/_header.html.haml @@ -1,33 +1,36 @@ .sr-only - =link_to t(".skip"), "#skipnav" -.navbar.navbar-default.navbar-fixed-top(role="navigation") + = link_to t(".skip"), "#skipnav" +.navbar.navbar-default.navbar-fixed-top{ role: "navigation" } .container .navbar-header - %button.navbar-toggle(data-target="#navbar-collapse" data-toggle="collapse") + %button.navbar-toggle{ 'data-target': "#navbar-collapse", 'data-toggle': "collapse" } %span.sr-only= t('.toggle_navigation') %span.icon-bar %span.icon-bar %span.icon-bar - %a.navbar-brand.hidden-xs(href=root_path) - = image_tag("growstuff-brand.png", :size => "200x50", :alt => ENV['GROWSTUFF_SITE_NAME']) - %a.navbar-brand.visible-xs(href=root_path) - = image_tag("growstuff-apple-touch-icon-precomposed.png", :size => "50x50", :class=>"img-responsive", :alt => ENV['GROWSTUFF_SITE_NAME']) + %a.navbar-brand.hidden-xs{ href: root_path } + = image_tag("growstuff-brand.png", size: "200x50", alt: ENV['GROWSTUFF_SITE_NAME']) + %a.navbar-brand.visible-xs{ href: root_path } + = image_tag("growstuff-apple-touch-icon-precomposed.png", + size: "50x50", + class: "img-responsive", + alt: ENV['GROWSTUFF_SITE_NAME']) .form.navbar-form.pull-left - = form_tag crops_search_path, :method => :get, :id => 'navbar-search' do - = label_tag :term, "Search crop database:", :class => 'sr-only' + = form_tag crops_search_path, method: :get, id: 'navbar-search' do + = label_tag :term, "Search crop database:", class: 'sr-only' .input .input-group - = text_field_tag 'term', nil, :class => 'search-query input-medium form-control', :placeholder => 'Search crops' + = text_field_tag 'term', nil, class: 'search-query input-medium form-control', placeholder: 'Search crops' .input-group-btn - %button.btn.btn-default{:style => "height: 34px;"} - = submit_tag "Search", :class => 'btn sr-only' + %button.btn.btn-default{ style: "height: 34px;" } + = submit_tag "Search", class: 'btn sr-only' %span.glyphicon.glyphicon-search .navbar-collapse.collapse#navbar-collapse %ul.nav.navbar-nav.navbar-right %li.dropdown< - %a.dropdown-toggle{'data-toggle' => 'dropdown', :href => crops_path} + %a.dropdown-toggle{ 'data-toggle': 'dropdown', href: crops_path } = t('.crops') %b.caret %ul.dropdown-menu @@ -36,7 +39,7 @@ %li= link_to t('.plantings'), plantings_path %li= link_to t('.harvests'), harvests_path %li.dropdown< - %a.dropdown-toggle{'data-toggle' => 'dropdown', :href => members_path} + %a.dropdown-toggle{ 'data-toggle': 'dropdown', href: members_path } = t('.community') %b.caret %ul.dropdown-menu @@ -48,39 +51,40 @@ - if member_signed_in? %li.dropdown< - %a.dropdown-toggle{'data-toggle' => 'dropdown', :href => root_path} - - if current_member.notifications.unread_count > 0 + %a.dropdown-toggle{ 'data-toggle': 'dropdown', href: root_path } + - if current_member.notifications.unread_count.positive? = t('.your_stuff', unread_count: current_member.notifications.unread_count) - else - = t('.current_memberlogin_name', :current_memberlogin_name => (current_member.login_name)) + = t('.current_memberlogin_name', current_memberlogin_name: current_member.login_name) %b.caret %ul.dropdown-menu %li= link_to t('.profile'), member_path(current_member) - %li= link_to t('.gardens'), gardens_by_owner_path(:owner => current_member.slug) - %li= link_to t('.plantings'), plantings_by_owner_path(:owner => current_member.slug) - %li= link_to t('.harvest'), harvests_by_owner_path(:owner => current_member.slug) - %li= link_to t('.seeds'), seeds_by_owner_path(:owner => current_member.slug) - %li= link_to t('.posts'), posts_by_author_path(:author => current_member.slug) + %li= link_to t('.gardens'), gardens_by_owner_path(owner: current_member.slug) + %li= link_to t('.plantings'), plantings_by_owner_path(owner: current_member.slug) + %li= link_to t('.harvest'), harvests_by_owner_path(owner: current_member.slug) + %li= link_to t('.seeds'), seeds_by_owner_path(owner: current_member.slug) + %li= link_to t('.posts'), posts_by_author_path(author: current_member.slug) %li= link_to t('.account'), orders_path %li - - if current_member.notifications.unread_count > 0 - = link_to(t('.inbox_unread', unread_count: current_member.notifications.unread_count), notifications_path) + - if current_member.notifications.unread_count.positive? + = link_to(t('.inbox_unread', unread_count: current_member.notifications.unread_count), + notifications_path) - else = link_to(t('.inbox'), notifications_path) - if current_member.role?(:crop_wrangler) || current_member.role?(:admin) - %li{:class => 'divider', :role => 'presentation'} + %li.divider{ role: 'presentation' } - if current_member.role?(:crop_wrangler) %li= link_to t('.crop_wrangling'), wrangle_crops_path - if current_member.role?(:admin) %li= link_to t('.admin'), admin_path - %li= link_to t('.sign_out'), destroy_member_session_path, :method => :delete + %li= link_to t('.sign_out'), destroy_member_session_path, method: :delete - else - %li= link_to t('.sign_in'), new_member_session_path, :id => 'navbar-signin' - %li= link_to t('.sign_up'), new_member_registration_path, :id => 'navbar-signup' + %li= link_to t('.sign_in'), new_member_session_path, id: 'navbar-signin' + %li= link_to t('.sign_up'), new_member_registration_path, id: 'navbar-signup' -- # anchor tag for accessibility link to skip the navigation menu -%a{:name => 'skipnav'} +-# anchor tag for accessibility link to skip the navigation menu +%a{ name: 'skipnav' } diff --git a/app/views/layouts/_meta.html.haml b/app/views/layouts/_meta.html.haml index 70785e06d..bdba1c88f 100644 --- a/app/views/layouts/_meta.html.haml +++ b/app/views/layouts/_meta.html.haml @@ -5,24 +5,33 @@ = yield(:opengraph) - else = tag("meta", property: "og:image", content: image_url('facebook-thumbnail.png')) - = tag("meta", property: "og:title", content: "#{content_for?(:title) ? yield(:title) + " - #{ ENV['GROWSTUFF_SITE_NAME']} " : ENV['GROWSTUFF_SITE_NAME']}") + = tag("meta", property: "og:title", + content: (content_for?(:title) ? yield(:title) + " - " : "") + ENV['GROWSTUFF_SITE_NAME']) = tag("meta", property: "og:type", content: "website") = tag("meta", property: "og:url", content: root_url) = tag("meta", property: "og:site_name", content: ENV['GROWSTUFF_SITE_NAME']) - - if (content_for?(:member_rss_login_name) && content_for(:member_rss_slug)) - = auto_discovery_link_tag(:rss, { :controller => "/members", :action => 'show', :format => "rss", :id => yield(:member_rss_slug) }, { :title => "#{ ENV['GROWSTUFF_SITE_NAME'] }- #{yield(:member_rss_login_name)}'s posts" }) - = auto_discovery_link_tag(:rss, { :controller => "/posts", :format => "rss" }, { :title => "#{ ENV['GROWSTUFF_SITE_NAME'] } - Recent posts from all members" }) - = auto_discovery_link_tag(:rss, { :controller => "/crops", :format => "rss" }, { :title => "#{ ENV['GROWSTUFF_SITE_NAME'] } - Recently added crops" }) - = auto_discovery_link_tag(:rss, { :controller => "/plantings", :format => "rss" }, { :title => "#{ ENV['GROWSTUFF_SITE_NAME'] } - Recent plantings from all members" }) + - if content_for?(:member_rss_login_name) && content_for(:member_rss_slug) + = auto_discovery_link_tag(:rss, + { controller: "/members", action: 'show', format: "rss", id: yield(:member_rss_slug) }, + title: "#{ENV['GROWSTUFF_SITE_NAME']}- #{yield(:member_rss_login_name)}'s posts") + = auto_discovery_link_tag(:rss, + { controller: "/posts", format: "rss" }, + title: "#{ENV['GROWSTUFF_SITE_NAME']} - Recent posts from all members") + = auto_discovery_link_tag(:rss, + { controller: "/crops", format: "rss" }, + title: "#{ENV['GROWSTUFF_SITE_NAME']} - Recently added crops") + = auto_discovery_link_tag(:rss, + { controller: "/plantings", format: "rss" }, + title: "#{ENV['GROWSTUFF_SITE_NAME']} - Recent plantings from all members") %title - = content_for?(:title) ? yield(:title) + " - #{ ENV['GROWSTUFF_SITE_NAME']} " : ENV['GROWSTUFF_SITE_NAME'] + = content_for?(:title) ? yield(:title) + " - #{ENV['GROWSTUFF_SITE_NAME']} " : ENV['GROWSTUFF_SITE_NAME'] = csrf_meta_tags / Le HTML5 shim, for IE6-8 support of HTML elements /[if lt IE 9] = javascript_include_tag "http://html5shim.googlecode.com/svn/trunk/html5.js" - = stylesheet_link_tag "application", :media => "all" + = stylesheet_link_tag "application", media: "all" - %link(href="/growstuff-apple-touch-icon-precomposed.png" rel="apple-touch-icon-precomposed") + %link{ href: "/growstuff-apple-touch-icon-precomposed.png", rel: "apple-touch-icon-precomposed" } = favicon_link_tag 'favicon.ico' diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index 7a8c5bd8f..7fe945d8a 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -1,10 +1,10 @@ !!! 5 -%html(lang="en" prefix="og: http://ogp.me/ns#") - = render :partial => "layouts/meta" +%html{ lang: "en", prefix: "og: http://ogp.me/ns#" } + = render partial: "layouts/meta" %body - = render :partial => "layouts/header" + = render partial: "layouts/header" - #maincontainer.container + .container#maincontainer .row .col-md-12 - if content_for?(:title) @@ -17,11 +17,11 @@ %p .btn-group = yield(:buttonbar) - = render :partial => "shared/flash_messages", flash: flash + = render partial: "shared/flash_messages", flash: flash = yield %footer - = render :partial => "layouts/footer" + = render partial: "layouts/footer" / Javascripts \================================================== From 21c989989cd9fe42b0ee10254b826641b6725dfe Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Fri, 10 Feb 2017 20:20:20 +1300 Subject: [PATCH 10/14] add missing new line at end of haml file --- app/views/notifications/_notification.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/notifications/_notification.html.haml b/app/views/notifications/_notification.html.haml index 00748e728..898bfe736 100644 --- a/app/views/notifications/_notification.html.haml +++ b/app/views/notifications/_notification.html.haml @@ -10,4 +10,4 @@ .well :growstuff_markdown - #{ strip_tags(notification.body) } \ No newline at end of file + #{ strip_tags(notification.body) } From 0f520c0928a0d27a7ac682627933f56c10dc78a7 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Fri, 10 Feb 2017 20:55:06 +1300 Subject: [PATCH 11/14] More haml clean up for home views --- app/views/home/_crops.html.haml | 6 ++--- app/views/home/_discuss.html.haml | 2 +- app/views/home/_seeds.html.haml | 40 +++++++++++++++---------------- app/views/home/_stats.html.haml | 9 +++---- 4 files changed, 28 insertions(+), 29 deletions(-) diff --git a/app/views/home/_crops.html.haml b/app/views/home/_crops.html.haml index 686b68cb1..8c29a11d3 100644 --- a/app/views/home/_crops.html.haml +++ b/app/views/home/_crops.html.haml @@ -1,6 +1,6 @@ .row .col-md-8 - - cache cache_key_for(Crop, 'interesting'), :expires_in => 1.day do + - cache cache_key_for(Crop, 'interesting'), expires_in: 1.day do %h2= t('.our_crops') .hidden-xs - Crop.interesting.first(8).each do |c| @@ -14,7 +14,7 @@ .col-md-4.hidden-xs - cache cache_key_for(Planting) do %h2= t('.recently_planted') - = render partial: 'plantings/list', locals: { :plantings => Planting.interesting.first(6) } + = render partial: 'plantings/list', locals: { plantings: Planting.interesting.first(6) } .row .col-md-12 @@ -22,7 +22,7 @@ %p{ style: 'margin-top: 11.25px' } %strong #{t('.recently_added')}: - != Crop.recent.limit(12).map {|c| link_to(c, c) }.join(", ") + != Crop.recent.limit(12).map { |c| link_to(c, c) }.join(", ") %p.text-right = link_to "#{t('.view_all')} »", crops_path diff --git a/app/views/home/_discuss.html.haml b/app/views/home/_discuss.html.haml index 855b2cdaf..9159cde46 100644 --- a/app/views/home/_discuss.html.haml +++ b/app/views/home/_discuss.html.haml @@ -2,7 +2,7 @@ - posts = Post.limit(6) - if posts - = render partial: "posts/summary", locals: {posts: posts, howmany: 6 } + = render partial: "posts/summary", locals: { posts: posts, howmany: 6 } - cache cache_key_for(Forum) do - forums = Forum.all diff --git a/app/views/home/_seeds.html.haml b/app/views/home/_seeds.html.haml index 2a01973a7..98ea77b48 100644 --- a/app/views/home/_seeds.html.haml +++ b/app/views/home/_seeds.html.haml @@ -1,30 +1,28 @@ - seeds = Seed.interesting.first(6) - if seeds.present? - %h2= t('.title') - - cache cache_key_for(Seed) do - - if seeds.size > 0 + %table.table.table-striped + %tr + %th= t('.owner') + %th= t('.crop') + %th.hidden-xs.hidden-sm= t('.description') + %th= t('.trade_to') + %th= t('.from') + %th - %table.table.table-striped + - seeds.each do |seed| %tr - %th= t('.owner') - %th= t('.crop') - %th.hidden-xs.hidden-sm= t('.description') - %th= t('.trade_to') - %th= t('.from') - %th - - - seeds.each do |seed| - %tr - %td= link_to seed.owner.login_name, seed.owner - %td= link_to seed.crop.name, seed.crop - %td.hidden-xs.hidden-sm= truncate(seed.description, :length => 40, :separator => ' ') - %td= seed.tradable? ? seed.tradable_to : '' - %td - - if seed.tradable? - = seed.owner.location.blank? ? t('.unspecified') : truncate(seed.owner.location, :length => 25, :separator => ', ') - %td= link_to t('.details'), seed, class: 'btn btn-default btn-xs' + %td= link_to seed.owner.login_name, seed.owner + %td= link_to seed.crop.name, seed.crop + %td.hidden-xs.hidden-sm= truncate(seed.description, length: 40, separator: ' ') + %td= seed.tradable? ? seed.tradable_to : '' + %td + - if seed.tradable? && seed.owner.location.blank? + = t('.unspecified') + - elsif seed.tradable? + = truncate(seed.owner.location, length: 25, separator: ', ') + %td= link_to t('.details'), seed, class: 'btn btn-default btn-xs' %p.text-right = link_to "#{t('.view_all')} »", seeds_path diff --git a/app/views/home/_stats.html.haml b/app/views/home/_stats.html.haml index ee334b86d..9d5f189ca 100644 --- a/app/views/home/_stats.html.haml +++ b/app/views/home/_stats.html.haml @@ -1,8 +1,9 @@ - cache("homepage_stats") do %p.stats - = t('.message_html', { member: link_to(t('.member_linktext', count: Member.confirmed.size.to_i), members_path), - number_crops: link_to(t('.number_crops_linktext', count: Crop.count.to_i), crops_path), - number_plantings: link_to(t('.number_plantings_linktext', count: Planting.count.to_i), plantings_path), - number_gardens: link_to(t('.number_gardens_linktext', count: Garden.count.to_i), gardens_path) }) + = t('.message_html', + member: link_to(t('.member_linktext', count: Member.confirmed.size.to_i), members_path), + number_crops: link_to(t('.number_crops_linktext', count: Crop.count.to_i), crops_path), + number_plantings: link_to(t('.number_plantings_linktext', count: Planting.count.to_i), plantings_path), + number_gardens: link_to(t('.number_gardens_linktext', count: Garden.count.to_i), gardens_path)) From 93202fc13c560fc84d49cfd2b9cf4358bbde097e Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Fri, 10 Feb 2017 21:09:16 +1300 Subject: [PATCH 12/14] haml clean up for devise views --- app/views/devise/confirmations/new.html.haml | 12 ++++--- .../confirmation_instructions.html.haml | 6 ++-- .../reset_password_instructions.html.haml | 4 +-- .../mailer/unlock_instructions.html.haml | 4 +-- app/views/devise/passwords/edit.html.haml | 14 ++++---- app/views/devise/passwords/new.html.haml | 11 +++--- .../devise/registrations/_edit_apps.html.haml | 34 ++++++++++++------- .../registrations/_edit_email.html.haml | 15 ++++---- .../registrations/_edit_password.html.haml | 20 ++++++----- .../registrations/_edit_profile.html.haml | 19 ++++++----- app/views/devise/registrations/edit.html.haml | 18 +++++----- app/views/devise/registrations/new.html.haml | 26 +++++++------- app/views/devise/sessions/new.html.haml | 14 ++++---- app/views/devise/unlocks/new.html.haml | 12 ++++--- 14 files changed, 119 insertions(+), 90 deletions(-) diff --git a/app/views/devise/confirmations/new.html.haml b/app/views/devise/confirmations/new.html.haml index 03a021478..e817346c8 100644 --- a/app/views/devise/confirmations/new.html.haml +++ b/app/views/devise/confirmations/new.html.haml @@ -1,17 +1,21 @@ - content_for :title, "Resend confirmation instructions" -= form_for(resource, :as => resource_name, :url => confirmation_path(resource_name), :html => { :method => :post, :class => 'form-horizontal', :role => 'form' }) 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. .form-group - = f.label :login, :class => 'control-label col-md-2' + = f.label :login, class: 'control-label col-md-2' .col-md-8 - = f.text_field :login, :class => 'form-control' + = 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' + = f.submit "Resend confirmation instructions", class: 'btn btn-primary' .form-group .col-md-offset-2.col-md-8 diff --git a/app/views/devise/mailer/confirmation_instructions.html.haml b/app/views/devise/mailer/confirmation_instructions.html.haml index f8a275dba..333258a5d 100644 --- a/app/views/devise/mailer/confirmation_instructions.html.haml +++ b/app/views/devise/mailer/confirmation_instructions.html.haml @@ -5,7 +5,7 @@ Your account on #{site_name} has been created. You just need to confirm your email address through the link below: -%p= link_to 'Confirm my account', confirmation_url(@resource, :confirmation_token => @token) +%p= link_to 'Confirm my account', confirmation_url(@resource, confirmation_token: @token) %p Once you're confirmed, you can sign in with your login name @@ -17,9 +17,9 @@ We're excited to have you as a member, and hope you'll enjoy what #{site_name} has to offer. Take a look around the site, = succeed "," do - = link_to('plant some things', url_for(:controller => '/crops', :only_path => false)) + = link_to('plant some things', url_for(controller: '/crops', only_path: false)) and feel free to drop in on the - = link_to 'forums', url_for(:controller => '/forums', :only_path => false) + = link_to 'forums', url_for(controller: '/forums', only_path: false) if you have any questions or feedback. %p diff --git a/app/views/devise/mailer/reset_password_instructions.html.haml b/app/views/devise/mailer/reset_password_instructions.html.haml index 4a80b1065..2af1c27f3 100644 --- a/app/views/devise/mailer/reset_password_instructions.html.haml +++ b/app/views/devise/mailer/reset_password_instructions.html.haml @@ -5,7 +5,7 @@ Someone has requested a link to reset your password on #{site_name}. We presume this was you, in which case you can do so through this link: -%p= link_to 'Change my password', edit_password_url(@resource, :reset_password_token => @token) +%p= link_to 'Change my password', edit_password_url(@resource, reset_password_token: @token) %p If it wasn't you, then someone's made a typo or has been messing @@ -17,5 +17,5 @@ %p The #{site_name} team. %br/ - =link_to root_url, root_url + = link_to root_url, root_url diff --git a/app/views/devise/mailer/unlock_instructions.html.haml b/app/views/devise/mailer/unlock_instructions.html.haml index 971a00d59..9bdc87543 100644 --- a/app/views/devise/mailer/unlock_instructions.html.haml +++ b/app/views/devise/mailer/unlock_instructions.html.haml @@ -8,7 +8,7 @@ forgotten your password. In either case, use the link below to unlock your account: -%p= link_to 'Unlock my account', unlock_url(@resource, :unlock_token => @token) +%p= link_to 'Unlock my account', unlock_url(@resource, unlock_token: @token) %p If you have actually forgotten your password, you can @@ -20,4 +20,4 @@ %p The #{site_name} team. %br/ - =link_to root_url, root_url + = link_to root_url, root_url diff --git a/app/views/devise/passwords/edit.html.haml b/app/views/devise/passwords/edit.html.haml index 8e31924e5..e71357b32 100644 --- a/app/views/devise/passwords/edit.html.haml +++ b/app/views/devise/passwords/edit.html.haml @@ -1,21 +1,23 @@ - content_for :title, "Change your password" -= form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :put, :class => 'form-horizontal', :role => 'form' }) 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 .form-group - = f.label :password, "New password", :class => 'control-label col-md-2' + = f.label :password, "New password", class: 'control-label col-md-2' .col-md-8 - = f.password_field :password, :class => 'form-control' + = f.password_field :password, class: 'form-control' .form-group - = f.label :password_confirmation, "Confirm new password", :class => 'control-label col-md-2' + = f.label :password_confirmation, "Confirm new password", class: 'control-label col-md-2' .col-md-8 - = f.password_field :password_confirmation, :class => 'form-control' + = f.password_field :password_confirmation, class: 'form-control' .form-group .form-actions.col-md-offset-2.col-md-8 - = f.submit "Change my password", :class => 'btn btn-primary' + = 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 2044264c8..c137a797b 100644 --- a/app/views/devise/passwords/new.html.haml +++ b/app/views/devise/passwords/new.html.haml @@ -1,15 +1,18 @@ - content_for :title, "Forgot your password?" -= form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :post, :class => 'form-horizontal', :role => 'form' }) do |f| += form_for(resource, as: resource_name, + url: password_path(resource_name), + html: { method: :post, + class: 'form-horizontal', role: 'form' }) do |f| = devise_error_messages! .form-group - = f.label :login, :class => 'control-label col-md-2' + = f.label :login, class: 'control-label col-md-2' .col-md-8 - = f.text_field :login, :class => 'form-control' + = 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' + = f.submit "Send me reset password instructions", class: 'btn btn-primary' .form-group .col-md-offset-2.col-md-8 diff --git a/app/views/devise/registrations/_edit_apps.html.haml b/app/views/devise/registrations/_edit_apps.html.haml index e4d49c9ef..caea27165 100644 --- a/app/views/devise/registrations/_edit_apps.html.haml +++ b/app/views/devise/registrations/_edit_apps.html.haml @@ -1,39 +1,47 @@ -= form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => { :method => :put, :class => 'form-horizontal' }) do |f| += form_for(resource, as: resource_name, + url: registration_path(resource_name), + html: { method: :put, class: 'form-horizontal' }) do |_f| %br/ = devise_error_messages! .row .col-md-12 %p - = image_tag "twitter_32.png", :size => "32x32", :alt => 'Twitter logo' + = image_tag "twitter_32.png", size: "32x32", alt: 'Twitter logo' - if @twitter_auth You are connected to Twitter as = succeed "." do - =link_to @twitter_auth.name, "http://twitter.com/#{@twitter_auth.name}" - = link_to "Disconnect", @twitter_auth, :confirm => "Are you sure you want to remove this connection?", :method => :delete, :class => "remove" + = link_to @twitter_auth.name, "http://twitter.com/#{@twitter_auth.name}" + = link_to "Disconnect", @twitter_auth, + confirm: "Are you sure you want to remove this connection?", + method: :delete, class: "remove" - else - =link_to 'Connect to Twitter', '/auth/twitter' + = link_to 'Connect to Twitter', '/auth/twitter' .row .col-md-12 %p - = image_tag "flickr_32.png", :size => "32x32", :alt => 'Flickr logo' + = image_tag "flickr_32.png", size: "32x32", alt: 'Flickr logo' - if @flickr_auth You are connected to Flickr as = succeed "." do - =link_to @flickr_auth.name, "http://flickr.com/photos/#{@flickr_auth.uid}" - = link_to "Disconnect", @flickr_auth, :confirm => "Are you sure you want to remove this connection?", :method => :delete, :class => "remove" + = link_to @flickr_auth.name, "http://flickr.com/photos/#{@flickr_auth.uid}" + = link_to "Disconnect", @flickr_auth, + confirm: "Are you sure you want to remove this connection?", + method: :delete, class: "remove" - else - =link_to 'Connect to Flickr', '/auth/flickr' + = link_to 'Connect to Flickr', '/auth/flickr' .row .col-md-12 %p - = image_tag "facebook_32.png", :size => "32x32", :alt => 'Facebook logo' + = image_tag "facebook_32.png", size: "32x32", alt: 'Facebook logo' - if @facebook_auth You are connected to Facebook as = succeed "." do - =link_to @facebook_auth.name, "http://facebook.com/profile/#{@facebook_auth.uid}" - = link_to "Disconnect", @facebook_auth, :confirm => "Are you sure you want to remove this connection?", :method => :delete, :class => "remove" + = link_to @facebook_auth.name, "http://facebook.com/profile/#{@facebook_auth.uid}" + = link_to "Disconnect", @facebook_auth, + confirm: "Are you sure you want to remove this connection?", + method: :delete, class: "remove" - else - =link_to 'Connect to Facebook', '/auth/facebook' \ No newline at end of file + = link_to 'Connect to Facebook', '/auth/facebook' diff --git a/app/views/devise/registrations/_edit_email.html.haml b/app/views/devise/registrations/_edit_email.html.haml index a44fbc3c8..c351897b6 100644 --- a/app/views/devise/registrations/_edit_email.html.haml +++ b/app/views/devise/registrations/_edit_email.html.haml @@ -1,11 +1,13 @@ -= form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => { :method => :put, :class => 'form-horizontal' }) do |f| += form_for(resource, as: resource_name, + url: registration_path(resource_name), + html: { method: :put, class: 'form-horizontal' }) do |f| %br/ = devise_error_messages! .form-group - = f.label :email, :class => 'control-label col-md-2' + = f.label :email, class: 'control-label col-md-2' .col-md-8 - = f.email_field :email, :class => 'form-control' + = f.email_field :email, class: 'form-control' %span.help-block If you change your email address you will have to reconfirm. .form-group @@ -32,10 +34,9 @@ = f.check_box :newsletter Subscribe to the #{ENV['GROWSTUFF_SITE_NAME']} newsletter .help-block - = render :partial => 'newsletter_blurb' + = render partial: 'newsletter_blurb' .form-group .form-actions.col-md-offset-2.col-md-8 - = f.submit "Save", :class => 'btn btn-primary' - - =f.hidden_field(:tos_agreement, :value => true) + = f.submit "Save", class: 'btn btn-primary' + = f.hidden_field(:tos_agreement, value: true) diff --git a/app/views/devise/registrations/_edit_password.html.haml b/app/views/devise/registrations/_edit_password.html.haml index 3e660ab98..c36f287b4 100644 --- a/app/views/devise/registrations/_edit_password.html.haml +++ b/app/views/devise/registrations/_edit_password.html.haml @@ -1,23 +1,25 @@ -= form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => { :method => :put, :class => 'form-horizontal' }) do |f| += form_for(resource, as: resource_name, + url: registration_path(resource_name), + html: { method: :put, class: 'form-horizontal' }) do |f| %br/ = devise_error_messages! .form-group - = f.label :current_password, :class => 'control-label col-md-2' + = f.label :current_password, class: 'control-label col-md-2' .col-md-4 - = f.password_field :current_password, :class => 'form-control' + = f.password_field :current_password, class: 'form-control' .form-group - = f.label :password, "New password", :class => 'control-label col-md-2' + = f.label :password, "New password", class: 'control-label col-md-2' .col-md-4 - = f.password_field :password, :autocomplete => "off", :class => 'form-control' + = f.password_field :password, autocomplete: "off", class: 'form-control' .form-group - = f.label :password_confirmation, :class => 'control-label col-md-2' - .col-md-4= f.password_field :password_confirmation, :class => 'form-control' + = f.label :password_confirmation, class: 'control-label col-md-2' + .col-md-4= f.password_field :password_confirmation, class: 'form-control' .form-group .form-actions.col-md-offset-2.col-md-8 - = f.submit "Save", :class => 'btn btn-primary' + = f.submit "Save", class: 'btn btn-primary' - =f.hidden_field(:tos_agreement, :value => true) + = f.hidden_field(:tos_agreement, value: true) diff --git a/app/views/devise/registrations/_edit_profile.html.haml b/app/views/devise/registrations/_edit_profile.html.haml index 003cdbe1e..f12d68e20 100644 --- a/app/views/devise/registrations/_edit_profile.html.haml +++ b/app/views/devise/registrations/_edit_profile.html.haml @@ -1,23 +1,25 @@ -= form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => { :method => :put, :class => 'form-horizontal' }) do |f| += form_for(resource, as: resource_name, + url: registration_path(resource_name), + html: { method: :put, class: 'form-horizontal' }) do |f| %br/ = devise_error_messages! .form-group - =f.label :location, 'Your location', :class => 'control-label col-md-2' + = f.label :location, 'Your location', class: 'control-label col-md-2' .col-md-8 - =f.text_field :location, :autocomplete => "off", :class => 'form-control' + = f.text_field :location, autocomplete: "off", class: 'form-control' %span.help-block This will be displayed on a map. You can be as detailed or vague as you like. .form-group - =f.label :bio, :class => 'control-label col-md-2' + = f.label :bio, class: 'control-label col-md-2' .col-md-8 - =f.text_area :bio, :rows => 6, :class => 'form-control' + = f.text_area :bio, rows: 6, class: 'form-control' .form-group %label.control-label.col-md-2 Profile picture .col-md-8 - = render :partial => "members/avatar", :locals => { :member => @member } + = render partial: "members/avatar", locals: { member: @member } - unless @member.preferred_avatar_uri.present? %p %br/ @@ -27,6 +29,5 @@ .form-group .form-actions.col-md-offset-2.col-md-8 - = f.submit "Save", :class => 'btn btn-primary' - - =f.hidden_field(:tos_agreement, :value => true) + = f.submit "Save", class: 'btn btn-primary' + = f.hidden_field(:tos_agreement, value: true) diff --git a/app/views/devise/registrations/edit.html.haml b/app/views/devise/registrations/edit.html.haml index 85ba205d9..c1e59214d 100644 --- a/app/views/devise/registrations/edit.html.haml +++ b/app/views/devise/registrations/edit.html.haml @@ -1,25 +1,25 @@ - content_for :title, "Settings for #{current_member.login_name}" -%ul.nav.nav-tabs{:role => 'tablist'} +%ul.nav.nav-tabs{ role: 'tablist' } %li.active - %a{:href => '#profile', :role => 'tab', 'data-toggle' => 'tab'} + %a{ href: '#profile', role: 'tab', 'data-toggle': 'tab' } Profile %li - %a{:href => '#email', :role => 'tab', 'data-toggle' => 'tab'} + %a{ href: '#email', role: 'tab', 'data-toggle': 'tab' } Email %li - %a{:href => '#apps', :role => 'tab', 'data-toggle' => 'tab'} + %a{ href: '#apps', role: 'tab', 'data-toggle': 'tab' } Apps %li - %a{:href => '#password', :role => 'tab', 'data-toggle' => 'tab'} + %a{ href: '#password', role: 'tab', 'data-toggle': 'tab' } Password .tab-content .tab-pane.active#profile - = render :partial => 'edit_profile' + = render partial: 'edit_profile' .tab-pane#email - = render :partial => 'edit_email' + = render partial: 'edit_email' .tab-pane#apps - = render :partial => 'edit_apps' + = render partial: 'edit_apps' .tab-pane#password - = render :partial => 'edit_password' + = render partial: 'edit_password' diff --git a/app/views/devise/registrations/new.html.haml b/app/views/devise/registrations/new.html.haml index 3ec01a0ef..8632b782e 100644 --- a/app/views/devise/registrations/new.html.haml +++ b/app/views/devise/registrations/new.html.haml @@ -2,28 +2,30 @@ %p Sign up for a Growstuff account to track your veggie garden and connect with other local growers. -= form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => {:class => "form-horizontal"}) do |f| += form_for(resource, as: resource_name, + url: registration_path(resource_name), + html: { class: "form-horizontal" }) do |f| = devise_error_messages! .form-group - = f.label :login_name, :class => "control-label col-md-2" + = f.label :login_name, class: "control-label col-md-2" .col-md-8 - = f.text_field :login_name, :class => 'form-control' + = f.text_field :login_name, class: 'form-control' %span.help-inline This is the name that will show on the website. .form-group - = f.label :email, :class => "control-label col-md-2" + = f.label :email, class: "control-label col-md-2" .col-md-8 - = f.email_field :email, :class => 'form-control' + = f.email_field :email, class: 'form-control' %span.help-inline We'll use this address to contact you (we never spam!) .form-group - = f.label :password, :class => "control-label col-md-2" - .col-md-8= f.password_field :password, :class => 'form-control' + = f.label :password, class: "control-label col-md-2" + .col-md-8= f.password_field :password, class: 'form-control' .form-group - = f.label :password_confirmation, :class => "control-label col-md-2" - .col-md-8= f.password_field :password_confirmation, :class => 'form-control' + = f.label :password_confirmation, class: "control-label col-md-2" + .col-md-8= f.password_field :password_confirmation, class: 'form-control' .form-group .col-md-offset-2.col-md-8.checkbox @@ -35,14 +37,14 @@ .form-group .col-md-offset-2.col-md-8.checkbox %label - = f.check_box :newsletter, :checked => true + = f.check_box :newsletter, checked: true Subscribe to the #{ENV['GROWSTUFF_SITE_NAME']} newsletter .help-inline - = render :partial => 'newsletter_blurb' + = render partial: 'newsletter_blurb' .form-group .form-actions.col-md-offset-2.col-md-8 - = f.submit "Sign up", :class => 'btn btn-primary' + = f.submit "Sign up", class: 'btn btn-primary' .form-group .col-md-offset-2.col-md-8 diff --git a/app/views/devise/sessions/new.html.haml b/app/views/devise/sessions/new.html.haml index 4fdef08be..3645463e4 100644 --- a/app/views/devise/sessions/new.html.haml +++ b/app/views/devise/sessions/new.html.haml @@ -1,17 +1,19 @@ - content_for :title, "Sign in" -= form_for(resource, :as => resource_name, :url => session_path(resource_name), :html => {:class => "form-horizontal"}) do |f| += form_for(resource, as: resource_name, + url: session_path(resource_name), + html: { class: "form-horizontal" }) do |f| = devise_error_messages! .form-group - = f.label :login, :class => "control-label col-md-2" + = f.label :login, class: "control-label col-md-2" .col-md-8 - = f.text_field :login, :class => 'form-control' + = f.text_field :login, class: 'form-control' .form-group - = f.label :password, :class => "control-label col-md-2" + = f.label :password, class: "control-label col-md-2" .col-md-8 - = f.password_field :password, :class => 'form-control' + = f.password_field :password, class: 'form-control' - if devise_mapping.rememberable? .form-group @@ -22,7 +24,7 @@ .form-group .form-actions.col-md-8.col-md-offset-2 - = f.submit "Sign in", :class => 'btn btn-primary' + = f.submit "Sign in", class: 'btn btn-primary' .form-group .col-md-8.col-md-offset-2 diff --git a/app/views/devise/unlocks/new.html.haml b/app/views/devise/unlocks/new.html.haml index 1e612e9bf..6dbcd8af3 100644 --- a/app/views/devise/unlocks/new.html.haml +++ b/app/views/devise/unlocks/new.html.haml @@ -1,15 +1,19 @@ - content_for :title, "Resend unlock instructions" -= form_for(resource, :as => resource_name, :url => unlock_path(resource_name), :html => { :method => :post, :class => 'form-horizontal', :role => 'form' }) 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! .form-group - = f.label :email, :class => 'control-label col-md-2' + = f.label :email, class: 'control-label col-md-2' .col-md-8 - = f.email_field :email, :class => 'form-control' + = 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' + = f.submit "Resend unlock instructions", class: 'btn btn-primary' .form-group .col-md-offset-2.col-md-8 From 8b4491d0abc0215028fb0dfccfa57056c7845870 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Mon, 13 Feb 2017 07:38:26 +1300 Subject: [PATCH 13/14] Tabulation on wrapped form_for --- app/views/devise/confirmations/new.html.haml | 8 ++++---- app/views/devise/passwords/edit.html.haml | 4 ++-- app/views/devise/passwords/new.html.haml | 6 +++--- app/views/devise/registrations/_edit_apps.html.haml | 4 ++-- app/views/devise/registrations/_edit_email.html.haml | 4 ++-- app/views/devise/registrations/_edit_password.html.haml | 4 ++-- app/views/devise/registrations/_edit_profile.html.haml | 4 ++-- app/views/devise/registrations/new.html.haml | 4 ++-- app/views/devise/sessions/new.html.haml | 4 ++-- app/views/devise/unlocks/new.html.haml | 8 ++++---- 10 files changed, 25 insertions(+), 25 deletions(-) diff --git a/app/views/devise/confirmations/new.html.haml b/app/views/devise/confirmations/new.html.haml index e817346c8..025fc9c47 100644 --- a/app/views/devise/confirmations/new.html.haml +++ b/app/views/devise/confirmations/new.html.haml @@ -1,10 +1,10 @@ - content_for :title, "Resend confirmation instructions" = form_for(resource, as: resource_name, - url: confirmation_path(resource_name), - html: { method: :post, - class: 'form-horizontal', - role: 'form' }) do |f| + 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. diff --git a/app/views/devise/passwords/edit.html.haml b/app/views/devise/passwords/edit.html.haml index e71357b32..f1f73875c 100644 --- a/app/views/devise/passwords/edit.html.haml +++ b/app/views/devise/passwords/edit.html.haml @@ -1,8 +1,8 @@ - content_for :title, "Change your password" = form_for(resource, as: resource_name, - url: password_path(resource_name), - html: { method: :put, class: 'form-horizontal', role: 'form' }) do |f| + url: password_path(resource_name), + html: { method: :put, class: 'form-horizontal', role: 'form' }) do |f| = devise_error_messages! = f.hidden_field :reset_password_token diff --git a/app/views/devise/passwords/new.html.haml b/app/views/devise/passwords/new.html.haml index c137a797b..95ea33ff5 100644 --- a/app/views/devise/passwords/new.html.haml +++ b/app/views/devise/passwords/new.html.haml @@ -1,9 +1,9 @@ - content_for :title, "Forgot your password?" = form_for(resource, as: resource_name, - url: password_path(resource_name), - html: { method: :post, - class: 'form-horizontal', role: 'form' }) do |f| + url: password_path(resource_name), + html: { method: :post, + class: 'form-horizontal', role: 'form' }) do |f| = devise_error_messages! .form-group diff --git a/app/views/devise/registrations/_edit_apps.html.haml b/app/views/devise/registrations/_edit_apps.html.haml index caea27165..d0482e015 100644 --- a/app/views/devise/registrations/_edit_apps.html.haml +++ b/app/views/devise/registrations/_edit_apps.html.haml @@ -1,6 +1,6 @@ = form_for(resource, as: resource_name, - url: registration_path(resource_name), - html: { method: :put, class: 'form-horizontal' }) do |_f| + url: registration_path(resource_name), + html: { method: :put, class: 'form-horizontal' }) do |_f| %br/ = devise_error_messages! diff --git a/app/views/devise/registrations/_edit_email.html.haml b/app/views/devise/registrations/_edit_email.html.haml index c351897b6..c72237693 100644 --- a/app/views/devise/registrations/_edit_email.html.haml +++ b/app/views/devise/registrations/_edit_email.html.haml @@ -1,6 +1,6 @@ = form_for(resource, as: resource_name, - url: registration_path(resource_name), - html: { method: :put, class: 'form-horizontal' }) do |f| + url: registration_path(resource_name), + html: { method: :put, class: 'form-horizontal' }) do |f| %br/ = devise_error_messages! diff --git a/app/views/devise/registrations/_edit_password.html.haml b/app/views/devise/registrations/_edit_password.html.haml index c36f287b4..61d608de4 100644 --- a/app/views/devise/registrations/_edit_password.html.haml +++ b/app/views/devise/registrations/_edit_password.html.haml @@ -1,6 +1,6 @@ = form_for(resource, as: resource_name, - url: registration_path(resource_name), - html: { method: :put, class: 'form-horizontal' }) do |f| + url: registration_path(resource_name), + html: { method: :put, class: 'form-horizontal' }) do |f| %br/ = devise_error_messages! diff --git a/app/views/devise/registrations/_edit_profile.html.haml b/app/views/devise/registrations/_edit_profile.html.haml index f12d68e20..2550dc1ad 100644 --- a/app/views/devise/registrations/_edit_profile.html.haml +++ b/app/views/devise/registrations/_edit_profile.html.haml @@ -1,6 +1,6 @@ = form_for(resource, as: resource_name, - url: registration_path(resource_name), - html: { method: :put, class: 'form-horizontal' }) do |f| + url: registration_path(resource_name), + html: { method: :put, class: 'form-horizontal' }) do |f| %br/ = devise_error_messages! diff --git a/app/views/devise/registrations/new.html.haml b/app/views/devise/registrations/new.html.haml index 8632b782e..b9e61347c 100644 --- a/app/views/devise/registrations/new.html.haml +++ b/app/views/devise/registrations/new.html.haml @@ -3,8 +3,8 @@ %p Sign up for a Growstuff account to track your veggie garden and connect with other local growers. = form_for(resource, as: resource_name, - url: registration_path(resource_name), - html: { class: "form-horizontal" }) do |f| + url: registration_path(resource_name), + html: { class: "form-horizontal" }) do |f| = devise_error_messages! .form-group diff --git a/app/views/devise/sessions/new.html.haml b/app/views/devise/sessions/new.html.haml index 3645463e4..085ae9fe3 100644 --- a/app/views/devise/sessions/new.html.haml +++ b/app/views/devise/sessions/new.html.haml @@ -1,8 +1,8 @@ - content_for :title, "Sign in" = form_for(resource, as: resource_name, - url: session_path(resource_name), - html: { class: "form-horizontal" }) do |f| + url: session_path(resource_name), + html: { class: "form-horizontal" }) do |f| = devise_error_messages! .form-group diff --git a/app/views/devise/unlocks/new.html.haml b/app/views/devise/unlocks/new.html.haml index 6dbcd8af3..be29d7fb5 100644 --- a/app/views/devise/unlocks/new.html.haml +++ b/app/views/devise/unlocks/new.html.haml @@ -1,10 +1,10 @@ - content_for :title, "Resend unlock instructions" = form_for(resource, as: resource_name, - url: unlock_path(resource_name), - html: { method: :post, - class: 'form-horizontal', - role: 'form' }) do |f| + url: unlock_path(resource_name), + html: { method: :post, + class: 'form-horizontal', + role: 'form' }) do |f| = devise_error_messages! .form-group From 65024d8f837d688296cf0718825965e7d6ca9a19 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sun, 12 Feb 2017 20:41:22 +0000 Subject: [PATCH 14/14] Moved hash in haml onto one line, for clarity and glory --- app/views/devise/confirmations/new.html.haml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/views/devise/confirmations/new.html.haml b/app/views/devise/confirmations/new.html.haml index 025fc9c47..526b99efa 100644 --- a/app/views/devise/confirmations/new.html.haml +++ b/app/views/devise/confirmations/new.html.haml @@ -2,9 +2,7 @@ = form_for(resource, as: resource_name, url: confirmation_path(resource_name), - html: { method: :post, - class: 'form-horizontal', - role: 'form' }) do |f| + 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.