mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-10-31 03:09:06 -04:00
- 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.
21 lines
737 B
Plaintext
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
|