diff --git a/app/views/crops/_harvests.html.haml b/app/views/crops/_harvests.html.haml index 8bb70032d..6e19723ef 100644 --- a/app/views/crops/_harvests.html.haml +++ b/app/views/crops/_harvests.html.haml @@ -1,11 +1,11 @@ -%h4 #{crop.name.capitalize} harvests +%h3 #{crop.name.capitalize} harvests - if crop.harvests.empty? %p Nobody has harvested this crop yet. - else - %ul + %ul.list-group.list-group-flush - crop.harvests.order(harvested_at: :desc).limit(3).each do |harvest| - %li + %li.list-group-item = link_to "#{harvest.owner} harvested #{display_quantity(harvest)}.", harvest_path(harvest) = render 'members/location', member: harvest.owner %small @@ -15,6 +15,6 @@ = link_to "View all #{crop.name} harvests", crop_harvests_path(crop) - if crop.approved? - if current_member - %p= link_to "Harvest #{crop.name}", new_harvest_path(crop_id: crop.id) + %p= link_to "Harvest #{crop.name}", new_harvest_path(crop_id: crop.id), class: 'btn' - else = render partial: 'shared/signin_signup', locals: { to: "track your #{crop.name} harvests" } diff --git a/app/views/crops/_plantings.html.haml b/app/views/crops/_plantings.html.haml index 1da5c3644..d0359ec89 100644 --- a/app/views/crops/_plantings.html.haml +++ b/app/views/crops/_plantings.html.haml @@ -1,20 +1,9 @@ -%h4 See who's planted #{crop.name.pluralize} -- if crop.plantings.empty? - %p - Nobody has planted this crop yet. -- else - %ul - - crop.plantings.order(planted_at: :desc).limit(3).each do |planting| - %li - = link_to planting, planting_path(planting) - = render partial: 'members/location', locals: { member: planting.owner } - %small - = distance_of_time_in_words(planting.created_at, Time.zone.now) - ago. - %p - = link_to "View all #{crop.name} plantings", crop_plantings_path(crop) -- if crop.approved? - - if current_member - %p= link_to "Plant #{crop.name}", new_planting_path(crop_id: crop.id) - - else - = render partial: 'shared/signin_signup', locals: { to: "track your #{crop.name} plantings" } +%h3 See who's planted #{crop.name.pluralize} +%ul.list-group.list-group-flush + - crop.plantings.order(planted_at: :desc).limit(5).each do |planting| + %li.list-group-item + = planting_icon + = link_to planting do + = planting + - if planting.owner.location.present? + %small=planting.owner.location \ No newline at end of file diff --git a/app/views/crops/show.html.haml b/app/views/crops/show.html.haml index 2abffc22b..72d9b8abc 100644 --- a/app/views/crops/show.html.haml +++ b/app/views/crops/show.html.haml @@ -103,26 +103,16 @@ = link_to member_seeds_path(current_member, crop_slug: @crop.slug) do = display_seed_availability(@current_member, @crop) - .card-body - = render 'scientific_names', crop: @crop - = render 'alternate_names', crop: @crop - .card-body - %h3 See who's planted #{@crop.name.pluralize} - %ul.list-group.list-group-flush - - @crop.plantings.order(planted_at: :desc).limit(5).each do |planting| - %li.list-group-item - = link_to planting do - = planting_icon - = planting - - if planting.owner.location.present? - %small=planting.owner.location + .card-body + = render 'scientific_names', crop: @crop + = render 'alternate_names', crop: @crop + = render 'plantings', crop: @crop + = render 'harvests', crop: @crop - %hr/ = render 'find_seeds', crop: @crop - %hr/ .card .card-body %h5.card-title Learn more about #{@crop.name.pluralize}