impress/app/views/wardrobe/_item_card.html.haml

18 lines
732 B
Text
Raw Normal View History

2025-12-26 23:19:39 -08:00
- is_worn = @outfit.worn_items.include?(item)
%li.item-card
.item-thumbnail
= image_tag item.thumbnail_url, alt: item.name, loading: "lazy"
.item-info
.item-name= item.name
.item-badges
= render "items/badges/kind", item: item
= render "items/badges/first_seen", item: item
- if is_worn
2026-02-05 20:47:05 -08:00
= button_to @wardrobe_path, method: :get, class: "item-remove-button", title: "Remove #{item.name}", "aria-label": "Remove #{item.name}" do
2025-12-26 23:19:39 -08:00
= outfit_state_params @outfit.without_item(item)
- else
2026-02-05 20:47:05 -08:00
= button_to @wardrobe_path, method: :get, class: "item-add-button", title: "Add #{item.name}", "aria-label": "Add #{item.name}" do
2025-12-26 23:19:39 -08:00
= outfit_state_params @outfit.with_item(item)