Files
growstuff/app/views/seeds/_list.html.haml
T
Brenda Wallace fdebe79b7d Refactor seed management features
- Introduced `@other_count` in SeedsController to track in-stock and finished seeds based on the filter applied.
- Enhanced SeedsHelper with new methods: `seed_owner_label`, `seed_stacks`, and `seed_choice_link` for better organization and readability.
- Updated views to utilize new helper methods, improving the display of seed information and filtering options.
- Adjusted the Seed model to include methods for determining if a seed's sow-by date has passed and to return the heirloom type.
- Improved tests for filters and helper methods to ensure accurate functionality and coverage.
2026-10-16 17:32:09 +13:00

21 lines
737 B
Plaintext

-# The same shelves as a table: a row naming each shelf, a row for each variety,
-# and under a variety held in several packets a row for each packet.
%table.table.table-sm.seed-list
%thead
%tr
%th Crop
%th Sow before
%th Seeds
%th Where from
%th Type
%th Shared with
- shelves.each do |shelf, seeds|
%tbody
%tr.seed-list-shelf
%th{ colspan: 6 }= shelf.is_a?(Crop) ? link_to(shelf.name, crop_path(shelf)) : shelf.capitalize
- seed_stacks(seeds).each do |packets|
= render 'seeds/list_row', seed: packets.first, packets: packets
- if packets.size > 1
- packets.each do |packet|
= render 'seeds/list_row', seed: packet, packets: nil