impress/app/views/wardrobe/items/_item_card_content.html.haml
Emi Matchu 8d728c84d1 [WV2] Add zone badges to search results
Show which zones each item occupies in search result cards. Zone badges appear as small, muted labels (e.g., "Background", "Hat", "Static") after the NC/NP and date badges. Items that occupy multiple zones show multiple badges.

Zone badges only appear in search results, not in outfit items, since outfit items are already grouped by zone which provides sufficient context.

Implementation:
- Created zones badge partial to render zone labels from item appearances
- Updated controller to load item appearances with zone data for search results
- Pass appearance data through the rendering chain (search_results → item_card → item_card_content)
- Added subtle CSS styling for zone badges (light gray background, gray text)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-15 20:54:00 -08:00

12 lines
471 B
Text
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

.item-thumbnail
= image_tag item.thumbnail_url, alt: "", loading: "lazy"
.item-info
.item-name
= item.name
= link_to item_path(item), class: "item-info-link", target: "_blank", rel: "noopener" do
%span{aria: {label: "Item info"}}
.item-badges
= render "items/badges/kind", item: item
- if local_assigns[:appearance]
= render "wardrobe/items/badges/zones", appearance: appearance
= render "items/badges/first_seen", item: item