From 86781f3491274d3714db88c078eb7d98d6428cfb Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sat, 21 Apr 2018 21:14:18 +1200 Subject: [PATCH 01/15] Bundle upgrade --- Gemfile.lock | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 8f7585851..e19af5749 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -51,7 +51,7 @@ GEM public_suffix (>= 2.0.2, < 4.0) arel (6.0.4) ast (2.4.0) - autoprefixer-rails (8.2.0) + autoprefixer-rails (8.3.0) execjs bcrypt (3.1.11) better_errors (2.2.0) @@ -76,7 +76,7 @@ GEM activesupport (>= 3.0.0) uniform_notifier (~> 1.11.0) byebug (10.0.2) - cancancan (2.1.3) + cancancan (2.2.0) capybara (2.18.0) addressable mini_mime (>= 0.1.3) @@ -84,13 +84,13 @@ GEM rack (>= 1.0.0) rack-test (>= 0.5.4) xpath (>= 2.0, < 4.0) - capybara-email (2.5.0) - capybara (~> 2.4) + capybara-email (3.0.1) + capybara (>= 2.4, < 4.0) mail - capybara-screenshot (1.0.18) - capybara (>= 1.0, < 3) + capybara-screenshot (1.0.19) + capybara (>= 1.0, < 4) launchy - chartkick (2.3.3) + chartkick (2.3.4) childprocess (0.9.0) ffi (~> 1.0, >= 1.0.11) climate_control (0.2.0) @@ -130,11 +130,11 @@ GEM term-ansicolor (~> 1.3) thor (~> 0.19.1) tins (~> 1.6) - crass (1.0.3) + crass (1.0.4) csv_shaper (1.3.0) activesupport (>= 3.0.0) - dalli (2.7.7) - database_cleaner (1.6.2) + dalli (2.7.8) + database_cleaner (1.7.0) debug_inspector (0.0.3) devise (4.4.3) bcrypt (~> 3.0) @@ -251,7 +251,7 @@ GEM parser (>= 2.2.3.0) term-ansicolor (>= 1.3.2) terminal-table (>= 1.5.1) - jquery-rails (4.3.1) + jquery-rails (4.3.3) rails-dom-testing (>= 1, < 3) railties (>= 4.2.0) thor (>= 0.14, < 2.0) @@ -326,7 +326,7 @@ GEM omniauth (1.8.1) hashie (>= 3.4.6, < 3.6.0) rack (>= 1.6.2, < 3) - omniauth-facebook (4.0.0) + omniauth-facebook (5.0.0) omniauth-oauth2 (~> 1.2) omniauth-flickr (0.0.19) multi_json (~> 1.11.0) @@ -348,7 +348,7 @@ GEM mimemagic (~> 0.3.0) terrapin (~> 0.6.0) parallel (1.12.1) - parser (2.5.0.5) + parser (2.5.1.0) ast (~> 2.4.0) pg (0.21.0) platform-api (2.1.0) @@ -469,9 +469,9 @@ GEM selenium-webdriver (3.11.0) childprocess (~> 0.5) rubyzip (~> 1.2) - sexp_processor (4.10.1) + sexp_processor (4.11.0) shellany (0.0.1) - sidekiq (5.1.2) + sidekiq (5.1.3) concurrent-ruby (~> 1.0) connection_pool (~> 2.2, >= 2.2.0) rack-protection (>= 1.5.0) @@ -481,8 +481,8 @@ GEM json (>= 1.8, < 3) simplecov-html (~> 0.10.0) simplecov-html (0.10.2) - sparkpost_rails (1.5.0) - rails (>= 4.0, < 5.2) + sparkpost_rails (1.5.1) + rails (>= 4.0, < 5.3) sprockets (3.7.1) concurrent-ruby (~> 1.0) rack (> 1, < 3) @@ -507,9 +507,9 @@ GEM trollop (1.16.2) tzinfo (1.2.5) thread_safe (~> 0.1) - uglifier (4.1.8) + uglifier (4.1.9) execjs (>= 0.3.0, < 3) - unicode-display_width (1.3.0) + unicode-display_width (1.3.2) unicorn (5.4.0) kgio (~> 2.6) raindrops (~> 0.7) From 6310c518790c1ffbfb53d030368c711b8c7d11a3 Mon Sep 17 00:00:00 2001 From: jenkr55 Date: Sat, 21 Apr 2018 09:08:02 -0500 Subject: [PATCH 02/15] Only show data prompt when there are plantings --- app/views/plantings/_nav.haml | 1 - app/views/plantings/index.html.haml | 21 +++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/app/views/plantings/_nav.haml b/app/views/plantings/_nav.haml index bb81da701..396d6e021 100644 --- a/app/views/plantings/_nav.haml +++ b/app/views/plantings/_nav.haml @@ -15,4 +15,3 @@ = 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/index.html.haml b/app/views/plantings/index.html.haml index 8ad0277d2..b7b3e5785 100644 --- a/app/views/plantings/index.html.haml +++ b/app/views/plantings/index.html.haml @@ -19,13 +19,14 @@ = page_entries_info @plantings = will_paginate @plantings - %ul.list-inline - %li The data on this page is available in the following formats: - - if @owner - %li= link_to "CSV", plantings_by_owner_path(@owner, format: 'csv') - %li= link_to "JSON", plantings_by_owner_path(@owner, format: 'json') - %li= link_to "RSS", plantings_by_owner_path(@owner, format: 'rss') - - else - %li= link_to "CSV", plantings_path(format: 'csv') - %li= link_to "JSON", plantings_path(format: 'json') - %li= link_to "RSS", plantings_path(format: 'rss') + - if @plantings.length > 0 + %ul.list-inline + %li The data on this page is available in the following formats: + - if @owner + %li= link_to "CSV", plantings_by_owner_path(@owner, format: 'csv') + %li= link_to "JSON", plantings_by_owner_path(@owner, format: 'json') + %li= link_to "RSS", plantings_by_owner_path(@owner, format: 'rss') + - else + %li= link_to "CSV", plantings_path(format: 'csv') + %li= link_to "JSON", plantings_path(format: 'json') + %li= link_to "RSS", plantings_path(format: 'rss') From 585e45487a3c892075b14699f72b03d84ba93170 Mon Sep 17 00:00:00 2001 From: jenkr55 Date: Sat, 21 Apr 2018 09:16:17 -0500 Subject: [PATCH 03/15] Fixing button layout issue --- app/assets/stylesheets/overrides.sass | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/assets/stylesheets/overrides.sass b/app/assets/stylesheets/overrides.sass index dda6ecaef..4a4ec6411 100644 --- a/app/assets/stylesheets/overrides.sass +++ b/app/assets/stylesheets/overrides.sass @@ -100,6 +100,8 @@ p.stats dd margin-left: auto +.layout-actions + width: 100% #placesmap, #cropmap height: 500px From cb5d490b1c5774ee8567a6ceb1b3d21f2a454ed7 Mon Sep 17 00:00:00 2001 From: jenkr55 Date: Sat, 21 Apr 2018 10:26:19 -0500 Subject: [PATCH 04/15] Fixing params not being passed to plantings controller --- app/helpers/application_helper.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 639d27686..0b8339960 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -89,8 +89,11 @@ module ApplicationHelper plantings_by_owner_path(owner: owner.slug, all: all) if type == 'plantings' gardens_by_owner_path(owner: owner.slug, all: all) if type == 'gardens' else - plantings_path(all: all) if type == 'plantings' - gardens_path(all: all) if type == 'gardens' + if type == 'plantings' then + plantings_path(all: all) + elsif type == 'gardens' then + gardens_path(all: all) + end end end From 6cbf7d0bba0064980b50d7cf3e69d4b368ba445c Mon Sep 17 00:00:00 2001 From: jenkr55 Date: Sat, 21 Apr 2018 10:29:13 -0500 Subject: [PATCH 05/15] Fixing parmas issue for owner --- app/helpers/application_helper.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 0b8339960..9259f38d2 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -86,8 +86,11 @@ module ApplicationHelper def show_inactive_tickbox_path(type, owner, show_all) all = show_all ? '' : 1 if owner - plantings_by_owner_path(owner: owner.slug, all: all) if type == 'plantings' - gardens_by_owner_path(owner: owner.slug, all: all) if type == 'gardens' + if type == 'plantings' then + plantings_by_owner_path(owner: owner.slug, all: all) + elsif type == 'gardens' then + gardens_by_owner_path(owner: owner.slug, all: all) + end else if type == 'plantings' then plantings_path(all: all) From e767ea6b38b6aee024d67e8cb560a5c45e6e86cf Mon Sep 17 00:00:00 2001 From: jenkr55 Date: Sat, 21 Apr 2018 10:36:33 -0500 Subject: [PATCH 06/15] Fixing planting wrapping issue --- app/assets/stylesheets/overrides.sass | 2 +- app/views/plantings/index.html.haml | 4 ++-- app/views/seeds/index.html.haml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/assets/stylesheets/overrides.sass b/app/assets/stylesheets/overrides.sass index 4a4ec6411..f61ec813a 100644 --- a/app/assets/stylesheets/overrides.sass +++ b/app/assets/stylesheets/overrides.sass @@ -74,7 +74,7 @@ p.stats flex: none flex-wrap: wrap -.seeds-row +.card-row display: grid grid-template-columns: 50% 50% grid-gap: 25px diff --git a/app/views/plantings/index.html.haml b/app/views/plantings/index.html.haml index b7b3e5785..c5161b9d1 100644 --- a/app/views/plantings/index.html.haml +++ b/app/views/plantings/index.html.haml @@ -9,10 +9,10 @@ = page_entries_info @plantings = will_paginate @plantings -.row +.card-row - unless @plantings.empty? - @plantings.each.with_index do |planting| - .col-xs-12.col-lg-6 + .card = render partial: "plantings/card", locals: { planting: planting } .pagination diff --git a/app/views/seeds/index.html.haml b/app/views/seeds/index.html.haml index 0be394edf..5e2eabece 100644 --- a/app/views/seeds/index.html.haml +++ b/app/views/seeds/index.html.haml @@ -24,7 +24,7 @@ = page_entries_info @seeds = will_paginate @seeds -.seeds-row +.card-row - unless @seeds.empty? - @seeds.each do |seed| .seedcard From 0b191049b2028c71f9226fb12de6157738324661 Mon Sep 17 00:00:00 2001 From: jenkr55 Date: Sat, 21 Apr 2018 10:46:27 -0500 Subject: [PATCH 07/15] Undo this --- app/views/plantings/index.html.haml | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/app/views/plantings/index.html.haml b/app/views/plantings/index.html.haml index c5161b9d1..3302bdacb 100644 --- a/app/views/plantings/index.html.haml +++ b/app/views/plantings/index.html.haml @@ -19,14 +19,13 @@ = page_entries_info @plantings = will_paginate @plantings - - if @plantings.length > 0 - %ul.list-inline - %li The data on this page is available in the following formats: - - if @owner - %li= link_to "CSV", plantings_by_owner_path(@owner, format: 'csv') - %li= link_to "JSON", plantings_by_owner_path(@owner, format: 'json') - %li= link_to "RSS", plantings_by_owner_path(@owner, format: 'rss') - - else - %li= link_to "CSV", plantings_path(format: 'csv') - %li= link_to "JSON", plantings_path(format: 'json') - %li= link_to "RSS", plantings_path(format: 'rss') + %ul.list-inline + %li The data on this page is available in the following formats: + - if @owner + %li= link_to "CSV", plantings_by_owner_path(@owner, format: 'csv') + %li= link_to "JSON", plantings_by_owner_path(@owner, format: 'json') + %li= link_to "RSS", plantings_by_owner_path(@owner, format: 'rss') + - else + %li= link_to "CSV", plantings_path(format: 'csv') + %li= link_to "JSON", plantings_path(format: 'json') + %li= link_to "RSS", plantings_path(format: 'rss') From ef74cc293d42569d5c67e9e9e6c98efcf079b30c Mon Sep 17 00:00:00 2001 From: jenkr55 Date: Sat, 21 Apr 2018 10:51:19 -0500 Subject: [PATCH 08/15] Rubocop --- app/helpers/application_helper.rb | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 9259f38d2..7ef7bc02f 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -86,17 +86,15 @@ module ApplicationHelper def show_inactive_tickbox_path(type, owner, show_all) all = show_all ? '' : 1 if owner - if type == 'plantings' then + if type == 'plantings' plantings_by_owner_path(owner: owner.slug, all: all) - elsif type == 'gardens' then + elsif type == 'gardens' gardens_by_owner_path(owner: owner.slug, all: all) end - else - if type == 'plantings' then - plantings_path(all: all) - elsif type == 'gardens' then - gardens_path(all: all) - end + elsif type == 'plantings' + plantings_path(all: all) + elsif type == 'gardens' + gardens_path(all: all) end end From c94d08c816832ea43ded72217d78179a7a62bfac Mon Sep 17 00:00:00 2001 From: jenkr55 Date: Sat, 21 Apr 2018 20:09:23 -0500 Subject: [PATCH 09/15] Moving bio to be by other profile information --- app/views/members/show.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/members/show.html.haml b/app/views/members/show.html.haml index 478574b3b..74c61ebd7 100644 --- a/app/views/members/show.html.haml +++ b/app/views/members/show.html.haml @@ -27,10 +27,10 @@ .col-md-9 = render partial: "map", locals: { member: @member } - = render partial: "bio", locals: { member: @member } = render partial: "gardens", locals: { member: @member, gardens: @gardens } .col-md-3 = render partial: "avatar", locals: { member: @member } + = render partial: "bio", locals: { member: @member } = render partial: "roles", locals: { member: @member } = render partial: "stats", locals: { member: @member } = render partial: "contact", locals: { member: @member, From 7be10957ec4f527cdaec67c116189a8a7d02d6f5 Mon Sep 17 00:00:00 2001 From: jenkr55 Date: Sat, 21 Apr 2018 21:05:58 -0500 Subject: [PATCH 10/15] WIP different profile page --- app/assets/stylesheets/overrides.sass | 25 +++++++++++++++++++++++++ app/controllers/members_controller.rb | 1 + app/views/members/_avatar.html.haml | 2 +- app/views/members/_gardens.html.haml | 5 ++--- app/views/members/_harvests.html.haml | 4 ++++ app/views/members/_map.html.haml | 2 +- app/views/members/_stats.html.haml | 2 +- app/views/members/show.html.haml | 22 ++++++++++++++++------ 8 files changed, 51 insertions(+), 12 deletions(-) create mode 100644 app/views/members/_harvests.html.haml diff --git a/app/assets/stylesheets/overrides.sass b/app/assets/stylesheets/overrides.sass index f61ec813a..3de542b21 100644 --- a/app/assets/stylesheets/overrides.sass +++ b/app/assets/stylesheets/overrides.sass @@ -12,6 +12,10 @@ body .list-inline > li.first padding-left: 0px +.activity-list + list-style-type: none + padding: 0 + h2 font-size: 150% @@ -34,6 +38,20 @@ h3 max-width: 100% height: auto +.profile-img + border-radius: 50% + z-index: 2 + position: relative + width: 80% + +.profile-sidebar + margin-top: -5rem + +.profile-activity + background: white + padding: 2em + margin-top: 2em + .sidebar border-left: 1px solid darken($beige, 10%) margin-left: -1px @@ -80,6 +98,12 @@ p.stats grid-gap: 25px grid-row-gap: 5px +.card-row-short + display: grid + grid-template-columns: 47.5% 47.5% + grid-gap: 25px + grid-row-gap: 5px + .member-thumbnail padding: .25em margin: 1em @@ -108,6 +132,7 @@ p.stats #membermap height: 250px + z-index: 0 .location-not-set height: 250px diff --git a/app/controllers/members_controller.rb b/app/controllers/members_controller.rb index c346eb8e3..ae720e57b 100644 --- a/app/controllers/members_controller.rb +++ b/app/controllers/members_controller.rb @@ -20,6 +20,7 @@ class MembersController < ApplicationController @facebook_auth = @member.auth('facebook') @posts = @member.posts @gardens = @member.gardens.active.order(:name) + @harvests = @member.harvests # The garden form partial is called from the "New Garden" tab; # it requires a garden to be passed in @garden. diff --git a/app/views/members/_avatar.html.haml b/app/views/members/_avatar.html.haml index 421424256..9417f466f 100644 --- a/app/views/members/_avatar.html.haml +++ b/app/views/members/_avatar.html.haml @@ -1,5 +1,5 @@ - if member = link_to image_tag(avatar_uri(member, 150), alt: '', - class: 'img img-responsive avatar'), + class: 'img img-responsive avatar profile-img'), member_path(member) diff --git a/app/views/members/_gardens.html.haml b/app/views/members/_gardens.html.haml index 7e1bc61ca..ee41feb77 100644 --- a/app/views/members/_gardens.html.haml +++ b/app/views/members/_gardens.html.haml @@ -1,4 +1,3 @@ -%h2 #{member.login_name}'s gardens .tabbable %ul.nav.nav-tabs - first_garden = true @@ -45,10 +44,10 @@ = link_to "Add photo", new_photo_path(type: "garden", id: g.id), class: 'btn btn-primary' %h3 What's planted here? - .row + .card-row-short - unless g.featured_plantings.empty? - g.featured_plantings.each.with_index do |planting| - .col-xs-12.col-lg-6 + .card = render partial: "plantings/card", locals: { planting: planting } %p diff --git a/app/views/members/_harvests.html.haml b/app/views/members/_harvests.html.haml new file mode 100644 index 000000000..3a5a54a0a --- /dev/null +++ b/app/views/members/_harvests.html.haml @@ -0,0 +1,4 @@ +.card-row-short + - harvests.each do |harvest| + .card + = render partial: "harvests/card", locals: { harvest: harvest } diff --git a/app/views/members/_map.html.haml b/app/views/members/_map.html.haml index 253f3b3ec..711e4d9e0 100644 --- a/app/views/members/_map.html.haml +++ b/app/views/members/_map.html.haml @@ -1,6 +1,6 @@ - if member.latitude && member.longitude #membermap - %p + %p.pull-right See other members, plantings, seeds and more near = link_to member.location, place_path(member.location, anchor: "members") - else diff --git a/app/views/members/_stats.html.haml b/app/views/members/_stats.html.haml index a2ebab47d..2db447d4c 100644 --- a/app/views/members/_stats.html.haml +++ b/app/views/members/_stats.html.haml @@ -7,7 +7,7 @@ %h3 Activity -%ul.list-inline +%ul.activity-list %li - if !member.plantings.empty? = link_to localize_plural(member.plantings, Planting), plantings_by_owner_path(owner: member) diff --git a/app/views/members/show.html.haml b/app/views/members/show.html.haml index 74c61ebd7..7682fd49b 100644 --- a/app/views/members/show.html.haml +++ b/app/views/members/show.html.haml @@ -9,7 +9,7 @@ = tag("meta", property: "og:site_name", content: ENV['GROWSTUFF_SITE_NAME']) - content_for :buttonbar do - if can? :update, @member - = link_to 'Edit profile', edit_member_registration_path, class: 'btn btn-default' + = link_to 'Edit profile', edit_member_registration_path, class: 'btn btn-default pull-right' - if can?(:create, Notification) && current_member != @member = link_to 'Send message', new_notification_path(recipient_id: @member.id), class: 'btn btn-default' @@ -24,11 +24,8 @@ - content_for :member_rss_slug, @member.slug .row - - .col-md-9 - = render partial: "map", locals: { member: @member } - = render partial: "gardens", locals: { member: @member, gardens: @gardens } - .col-md-3 + = render partial: "map", locals: { member: @member } + .col-md-2.profile-sidebar = render partial: "avatar", locals: { member: @member } = render partial: "bio", locals: { member: @member } = render partial: "roles", locals: { member: @member } @@ -37,3 +34,16 @@ twitter_auth: @twitter_auth, flickr_auth: @flickr_auth, facebook_auth: @facebook_auth } + + .col-md-10 + %ul.nav.nav-pills.nav-justified + %li.active + %a{"data-toggle" => "tab", href: "#gardens"} Gardens + %li + %a{"data-toggle" => "tab", href: "#harvests"} Harvests + / Tab panes + .tab-content.profile-activity + #gardens.tab-pane.active + = render partial: "gardens", locals: { member: @member, gardens: @gardens } + #harvests.tab-pane + = render partial: "harvests", locals: { member: @member, harvests: @harvests } From 77978a76f2576496c0b19bbb5ec1e0b5a473e1a1 Mon Sep 17 00:00:00 2001 From: jenkr55 Date: Sat, 21 Apr 2018 21:27:40 -0500 Subject: [PATCH 11/15] Fixing notes display bug on harvest card --- app/views/harvests/_card.html.haml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/harvests/_card.html.haml b/app/views/harvests/_card.html.haml index 52cfb3627..c2f528cdc 100644 --- a/app/views/harvests/_card.html.haml +++ b/app/views/harvests/_card.html.haml @@ -21,8 +21,8 @@ %dd= display_quantity(harvest) %dt Harvest date : %dd= harvest.harvested_at - %dd Notes: - %dt=display_harvest_description(harvest) + %dt Notes: + %dd=display_harvest_description(harvest) - if harvest.planting.present? %dt Harvested from %dd= link_to(harvest.planting, planting_path(harvest.planting)) From fa28fe25b62a516836bdd4991c4d5eebfe6f270e Mon Sep 17 00:00:00 2001 From: jenkr55 Date: Sat, 21 Apr 2018 21:43:19 -0500 Subject: [PATCH 12/15] Fixing responsive design issues --- app/assets/stylesheets/overrides.sass | 19 +++++++------------ app/views/members/_gardens.html.haml | 2 +- app/views/members/_harvests.html.haml | 2 ++ app/views/members/show.html.haml | 7 +++---- 4 files changed, 13 insertions(+), 17 deletions(-) diff --git a/app/assets/stylesheets/overrides.sass b/app/assets/stylesheets/overrides.sass index 3de542b21..c7cee0cc4 100644 --- a/app/assets/stylesheets/overrides.sass +++ b/app/assets/stylesheets/overrides.sass @@ -38,19 +38,20 @@ h3 max-width: 100% height: auto -.profile-img - border-radius: 50% - z-index: 2 - position: relative - width: 80% - .profile-sidebar margin-top: -5rem + .avatar + border-radius: 50% + border-radius: 50% + z-index: 2 + position: relative .profile-activity background: white padding: 2em margin-top: 2em + .container + width: 100% .sidebar border-left: 1px solid darken($beige, 10%) @@ -98,12 +99,6 @@ p.stats grid-gap: 25px grid-row-gap: 5px -.card-row-short - display: grid - grid-template-columns: 47.5% 47.5% - grid-gap: 25px - grid-row-gap: 5px - .member-thumbnail padding: .25em margin: 1em diff --git a/app/views/members/_gardens.html.haml b/app/views/members/_gardens.html.haml index ee41feb77..5872f4926 100644 --- a/app/views/members/_gardens.html.haml +++ b/app/views/members/_gardens.html.haml @@ -44,7 +44,7 @@ = link_to "Add photo", new_photo_path(type: "garden", id: g.id), class: 'btn btn-primary' %h3 What's planted here? - .card-row-short + .card-row - unless g.featured_plantings.empty? - g.featured_plantings.each.with_index do |planting| .card diff --git a/app/views/members/_harvests.html.haml b/app/views/members/_harvests.html.haml index 3a5a54a0a..248510c27 100644 --- a/app/views/members/_harvests.html.haml +++ b/app/views/members/_harvests.html.haml @@ -2,3 +2,5 @@ - harvests.each do |harvest| .card = render partial: "harvests/card", locals: { harvest: harvest } +- if !harvests.any? + #{member.login_name} hasn't harvested anything yet. diff --git a/app/views/members/show.html.haml b/app/views/members/show.html.haml index 7682fd49b..500ea039c 100644 --- a/app/views/members/show.html.haml +++ b/app/views/members/show.html.haml @@ -11,14 +11,14 @@ - if can? :update, @member = link_to 'Edit profile', edit_member_registration_path, class: 'btn btn-default pull-right' - if can?(:create, Notification) && current_member != @member - = link_to 'Send message', new_notification_path(recipient_id: @member.id), class: 'btn btn-default' + = link_to 'Send message', new_notification_path(recipient_id: @member.id), class: 'btn btn-default pull-right' - if current_member && current_member != @member # must be logged in, can't follow yourself - follow = current_member.get_follow(@member) - if !follow && can?(:create, Follow) # not already following - = link_to 'Follow', follows_path(followed_id: @member.id), method: :post, class: 'btn btn-default' + = link_to 'Follow', follows_path(followed_id: @member.id), method: :post, class: 'btn btn-default pull-right' - if follow && can?(:destroy, follow) # already following - = link_to 'Unfollow', follow_path(follow), method: :delete, class: 'btn btn-default' + = link_to 'Unfollow', follow_path(follow), method: :delete, class: 'btn btn-default pull-right' - content_for :member_rss_login_name, @member.login_name - content_for :member_rss_slug, @member.slug @@ -41,7 +41,6 @@ %a{"data-toggle" => "tab", href: "#gardens"} Gardens %li %a{"data-toggle" => "tab", href: "#harvests"} Harvests - / Tab panes .tab-content.profile-activity #gardens.tab-pane.active = render partial: "gardens", locals: { member: @member, gardens: @gardens } From 028c2a28a5cc6f32fcd29c5bd20056b905980ac0 Mon Sep 17 00:00:00 2001 From: jenkr55 Date: Sat, 21 Apr 2018 21:52:55 -0500 Subject: [PATCH 13/15] unneeded class --- app/views/members/_avatar.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/members/_avatar.html.haml b/app/views/members/_avatar.html.haml index 9417f466f..421424256 100644 --- a/app/views/members/_avatar.html.haml +++ b/app/views/members/_avatar.html.haml @@ -1,5 +1,5 @@ - if member = link_to image_tag(avatar_uri(member, 150), alt: '', - class: 'img img-responsive avatar profile-img'), + class: 'img img-responsive avatar'), member_path(member) From 25bba9c1267ade296ccb89d4f51b6340efc2cc67 Mon Sep 17 00:00:00 2001 From: jenkr55 Date: Sat, 21 Apr 2018 21:55:29 -0500 Subject: [PATCH 14/15] format fixes --- app/views/harvests/_card.html.haml | 2 +- app/views/members/show.html.haml | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/views/harvests/_card.html.haml b/app/views/harvests/_card.html.haml index c2f528cdc..02ad5d3e0 100644 --- a/app/views/harvests/_card.html.haml +++ b/app/views/harvests/_card.html.haml @@ -22,7 +22,7 @@ %dt Harvest date : %dd= harvest.harvested_at %dt Notes: - %dd=display_harvest_description(harvest) + %dd= display_harvest_description(harvest) - if harvest.planting.present? %dt Harvested from %dd= link_to(harvest.planting, planting_path(harvest.planting)) diff --git a/app/views/members/show.html.haml b/app/views/members/show.html.haml index 500ea039c..621f35c51 100644 --- a/app/views/members/show.html.haml +++ b/app/views/members/show.html.haml @@ -38,11 +38,11 @@ .col-md-10 %ul.nav.nav-pills.nav-justified %li.active - %a{"data-toggle" => "tab", href: "#gardens"} Gardens + %a{ "data-toggle" => "tab", href: "#gardens" } Gardens %li - %a{"data-toggle" => "tab", href: "#harvests"} Harvests + %a{ "data-toggle" => "tab", href: "#harvests" } Harvests .tab-content.profile-activity - #gardens.tab-pane.active + .tab-pane.active#gardens = render partial: "gardens", locals: { member: @member, gardens: @gardens } - #harvests.tab-pane + .tab-pane#harvests = render partial: "harvests", locals: { member: @member, harvests: @harvests } From eed0b257fa26fee23fd332771d9e19554acb2335 Mon Sep 17 00:00:00 2001 From: jenkr55 Date: Sat, 21 Apr 2018 22:03:31 -0500 Subject: [PATCH 15/15] Fixing test because I removed this line --- spec/features/member_profile_spec.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/spec/features/member_profile_spec.rb b/spec/features/member_profile_spec.rb index 9f1005894..db7d4f595 100644 --- a/spec/features/member_profile_spec.rb +++ b/spec/features/member_profile_spec.rb @@ -9,7 +9,6 @@ feature "member profile", js: true do expect(page).to have_css("h1", text: member.login_name) expect(page).to have_content member.bio expect(page).to have_content "Member since: #{member.created_at.to_s(:date)}" - expect(page).to have_content "#{member.login_name}'s gardens" expect(page).to have_link "More about this garden...", href: garden_path(member.gardens.first) end