Files
growstuff/app/views/seeds/_page_head.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

32 lines
1.4 KiB
Plaintext

-# The top of the page: whose library it is and what is in it, which crop's
-# seeds these are with the ways to plant or save it, or what the page is for.
%header.seed-head
- if @owner
= link_to image_tag(avatar_uri(@owner, 72), alt: @owner.login_name, width: 72, height: 72, class: 'seed-head-image'), member_path(@owner)
- elsif @crop
= link_to image_tag(crop_image_path(@crop), alt: "Image of #{@crop.name}", width: 72, height: 72, class: 'seed-head-image'), crop_path(@crop)
.seed-head-about
- if @owner
%h1
= succeed "'s seed library" do
%span.login-name= link_to @owner.login_name, member_path(@owner)
.seed-head-sub= @owner.location
- elsif @crop
%h1= link_to "#{@crop.name} seeds", crop_path(@crop)
.seed-head-sub= @crop.default_scientific_name
- elsif @planting
%h1= title('seeds', nil, nil, @planting)
- else
%h1 Seeds
.seed-head-sub Seeds that gardeners have chosen to share
- if @stats
%ul.seed-head-stats
- { packets: 'packets', varieties: 'varieties', crops: 'crops', own: 'my own saving' }.each do |key, label|
%li
%b= @stats[key]
= label
- elsif @crop && member_signed_in?
.seed-head-actions
= render 'plantings/modal', planting: Planting.new(crop: @crop, owner: current_member)
= render 'seeds/modal', seed: Seed.new(crop: @crop, owner: current_member)