Files
growstuff/app/views/photos/_packet_label.html.haml
T
Brenda WallaceandClaude Sonnet 5.5 4ec2bee2f7 Show the packet side of a photo as a Front | Back | None control
On a seed's own page, the owner now chooses which side of the packet a photo
is of with one small button group, the current choice lit, in place of a badge
and up to three long text links that wrapped in a narrow card. Everyone else
sees just a badge. The unused "mark as" locale keys are removed.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-28 21:39:29 +13:00

17 lines
850 B
Plaintext

-# On a seed's own page: which side of the packet each of its photos is of, if it
-# is of one. The seed's owner chooses with the buttons, the current choice
-# being the lit one; everyone else sees what it is.
- label = seed.label_of(photo)
.packet-label.mt-2
- if can?(:update, seed)
.btn-group.btn-group-sm{ role: 'group', 'aria-label': t('seeds.packet.group') }
- [*PhotoAssociation::LABELS['Seed'], nil].each do |choice|
- words = t("seeds.packet.choice_#{choice || 'none'}")
- if choice == label
%span.btn.btn-secondary.active{ 'aria-current': 'true' }= words
- else
- path = packet_label_path(seed, photo, choice.to_s)
= link_to words, path, method: :patch, class: 'btn btn-outline-secondary'
- elsif label
%span.badge.text-bg-secondary= t("seeds.packet.label_#{label}")