mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-05-18 21:56:55 -04:00
Render history
This commit is contained in:
@@ -20,6 +20,7 @@ class GardensController < DataController
|
||||
def show
|
||||
@current_plantings = @garden.plantings.current.where.not(failed: true).includes(:crop, :owner).order(planted_at: :desc)
|
||||
@current_activities = @garden.activities.current.includes(:owner).order(created_at: :desc)
|
||||
@finished_activities = @garden.activities.finished.includes(:owner).order(created_at: :desc)
|
||||
@finished_plantings = @garden.plantings.finished.includes(:crop)
|
||||
@suggested_companions = Crop.approved.where(
|
||||
id: CropCompanion.where(crop_a_id: @current_plantings.select(:crop_id)).select(:crop_b_id)
|
||||
|
||||
@@ -37,6 +37,7 @@ class PlantingsController < DataController
|
||||
@photos = @planting.photos.includes(:owner).order(date_taken: :desc)
|
||||
@harvests = Harvest.search(where: { planting_id: @planting.id })
|
||||
@current_activities = @planting.activities.current.includes(:owner).order(created_at: :desc)
|
||||
@finished_activities = @planting.activities.finished.includes(:owner).order(created_at: :desc)
|
||||
@matching_seeds = matching_seeds
|
||||
@crop = @planting.crop
|
||||
|
||||
|
||||
@@ -16,3 +16,8 @@
|
||||
.col-md-12
|
||||
%p Nothing has been planted here.
|
||||
|
||||
- if @finished_activities&.size&.positive?
|
||||
%h2 Finished activities in garden
|
||||
.index-cards
|
||||
- @finished_activities.each do |activity|
|
||||
= render "activities/card", activity: activity
|
||||
@@ -89,7 +89,11 @@
|
||||
- else
|
||||
.col-md-12
|
||||
%p Nothing is currently planned here.
|
||||
|
||||
- if @finished_activities&.size&.positive?
|
||||
%h2 Finished activities for planting
|
||||
.index-cards
|
||||
- @finished_activities.each do |activity|
|
||||
= render "activities/card", activity: activity
|
||||
|
||||
.col-md-4.col-xs-12
|
||||
= render @planting.crop
|
||||
|
||||
Reference in New Issue
Block a user