mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-03-27 03:02:43 -04:00
24 lines
1.1 KiB
Plaintext
24 lines
1.1 KiB
Plaintext
.card
|
|
.card-body
|
|
%h3 #{crop.name.capitalize} harvests
|
|
- if crop.harvests.none?
|
|
%p Nobody has harvested this crop yet.
|
|
- unless crop.harvests.empty?
|
|
%ul.list-group.list-group-flush
|
|
- Harvest.where(crop: crop).includes(:owner).order(harvested_at: :desc).limit(3).each do |harvest|
|
|
%li.list-group-item
|
|
= link_to harvest_path(harvest), class: 'card-link' do
|
|
= harvest_icon
|
|
#{harvest.owner} harvested #{display_quantity(harvest)}.
|
|
.float-right= render 'members/location', member: harvest.owner
|
|
.harvest-timeago
|
|
%small #{standard_time_distance(harvest.harvested_at, Time.zone.now.to_date)}
|
|
%li.list-group-item= link_to "View all #{crop.name} harvests", crop_harvests_path(crop), class: 'card-link'
|
|
- if crop.approved?
|
|
- if current_member
|
|
%li.list-group-item= link_to "Harvest #{crop.name}", new_harvest_path(crop_id: crop.id), class: 'btn btn-block'
|
|
- else
|
|
%li.list-group-item.active
|
|
= icon 'fas', 'user'
|
|
= render partial: 'shared/signin_signup', locals: { to: "track your #{crop.name} harvests" }
|