mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-11-02 11:14:23 -05:00
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>
17 lines
850 B
Plaintext
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}")
|