From 43813d1318b8842325cc2b8652358b9699c51e9e Mon Sep 17 00:00:00 2001 From: jenkr55 Date: Sat, 7 Apr 2018 14:58:07 -0500 Subject: [PATCH 1/6] Fixing various wrapping issues --- CONTRIBUTORS.md | 1 + app/assets/stylesheets/overrides.sass | 8 +++++++- app/views/seeds/index.html.haml | 4 ++-- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 568137391..4b79a82a7 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -83,6 +83,7 @@ submit the change with your pull request. - Jeff Kingswood / [ancyentmariner](https://github.com/ancyentmariner) - Logan Gingerich / [logangingerich](https://github.com/logangingerich) - Mark Taffman / [mftaff](https://github.com/mftaff) +- Jennifer Kruse / [mftaff](https://github.com/mftaff) ## Bots diff --git a/app/assets/stylesheets/overrides.sass b/app/assets/stylesheets/overrides.sass index 6a97975fb..71dc96630 100644 --- a/app/assets/stylesheets/overrides.sass +++ b/app/assets/stylesheets/overrides.sass @@ -73,10 +73,16 @@ p.stats display: flex flex: none flex-wrap: wrap - justify-content: space-between + +.seeds-row + display: grid + grid-template-columns: 50% 50% + grid-gap: 25px + grid-row-gap: 5px .member-thumbnail padding: .25em + margin: 1em div width: 5em diff --git a/app/views/seeds/index.html.haml b/app/views/seeds/index.html.haml index e7e1ec3e3..0be394edf 100644 --- a/app/views/seeds/index.html.haml +++ b/app/views/seeds/index.html.haml @@ -24,10 +24,10 @@ = page_entries_info @seeds = will_paginate @seeds -.row +.seeds-row - unless @seeds.empty? - @seeds.each do |seed| - .col-md-6 + .seedcard = render 'seeds/card', seed: seed .pagination From efa8c513eaacedf89fa6f91a3e6b36dd1019179d Mon Sep 17 00:00:00 2001 From: jenkr55 Date: Sat, 7 Apr 2018 14:59:14 -0500 Subject: [PATCH 2/6] Adding myself as a contributor --- CONTRIBUTORS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 4b79a82a7..87b153b17 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -83,7 +83,7 @@ submit the change with your pull request. - Jeff Kingswood / [ancyentmariner](https://github.com/ancyentmariner) - Logan Gingerich / [logangingerich](https://github.com/logangingerich) - Mark Taffman / [mftaff](https://github.com/mftaff) -- Jennifer Kruse / [mftaff](https://github.com/mftaff) +- Jennifer Kruse / [jenkr55](https://github.com/jenkr55) ## Bots From 3e2b4f4183fc7a4ab7b5698586210a3cddb0f02a Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sun, 8 Apr 2018 09:56:19 +1200 Subject: [PATCH 3/6] Pick the first photo --- app/helpers/photos_helper.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/helpers/photos_helper.rb b/app/helpers/photos_helper.rb index b77f35bd9..618e0ac93 100644 --- a/app/helpers/photos_helper.rb +++ b/app/helpers/photos_helper.rb @@ -17,7 +17,7 @@ module PhotosHelper def planting_image_path(planting) if planting.photos.present? - planting.photos.first.thumbnail_url + planting.photos.order(date_taken: :desc).first.thumbnail_url else placeholder_image end @@ -25,9 +25,9 @@ module PhotosHelper def harvest_image_path(harvest) if harvest.photos.present? - harvest.photos.first.thumbnail_url - elsif harvest.planting.present? && harvest.planting.photos.present? - harvest.planting.photos.first.thumbnail_url + harvest.photos.order(date_taken: :desc).first.thumbnail_url + elsif harvest.planting.present? + planting_image_path(harvest.planting) else placeholder_image end From 6b68e9ee4d58b11c21205e96f7292014fd5ac805 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sun, 8 Apr 2018 10:04:43 +1200 Subject: [PATCH 4/6] Style fix --- app/helpers/photos_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/helpers/photos_helper.rb b/app/helpers/photos_helper.rb index 618e0ac93..6087a9c74 100644 --- a/app/helpers/photos_helper.rb +++ b/app/helpers/photos_helper.rb @@ -27,7 +27,7 @@ module PhotosHelper if harvest.photos.present? harvest.photos.order(date_taken: :desc).first.thumbnail_url elsif harvest.planting.present? - planting_image_path(harvest.planting) + planting_image_path(harvest.planting) else placeholder_image end From d38167fd14de267a221c76ca69b8775f34adb2f4 Mon Sep 17 00:00:00 2001 From: jenkr55 Date: Sun, 8 Apr 2018 09:47:15 -0500 Subject: [PATCH 5/6] Only show planting suggestion if theres a match --- app/views/harvests/_planting.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/harvests/_planting.haml b/app/views/harvests/_planting.haml index 085f24c7c..c58f5f6f4 100644 --- a/app/views/harvests/_planting.haml +++ b/app/views/harvests/_planting.haml @@ -3,7 +3,7 @@ planting_path(@harvest.planting) in = link_to @harvest.planting.garden, garden_path(@harvest.planting.garden) -- elsif @matching_plantings && @harvest.owner == current_member +- elsif @matching_plantings.any? && @harvest.owner == current_member Is this from one of these plantings? = form_for(@harvest) do |f| - @matching_plantings.each do |planting| From 9c0ddb61e7406a042dadf1b1ac751156a0f24fce Mon Sep 17 00:00:00 2001 From: jenkr55 Date: Sun, 8 Apr 2018 10:17:06 -0500 Subject: [PATCH 6/6] Prevent error when @matching_plantings is nil --- app/views/harvests/_planting.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/harvests/_planting.haml b/app/views/harvests/_planting.haml index c58f5f6f4..6e6ba03c2 100644 --- a/app/views/harvests/_planting.haml +++ b/app/views/harvests/_planting.haml @@ -3,7 +3,7 @@ planting_path(@harvest.planting) in = link_to @harvest.planting.garden, garden_path(@harvest.planting.garden) -- elsif @matching_plantings.any? && @harvest.owner == current_member +- elsif @matching_plantings && @matching_plantings.any? && @harvest.owner == current_member Is this from one of these plantings? = form_for(@harvest) do |f| - @matching_plantings.each do |planting|