2025-12-26 23:19:39 -08:00
|
|
|
|
- is_worn = @outfit.worn_items.include?(item)
|
2026-02-06 07:54:09 -08:00
|
|
|
|
- is_closeted = @outfit.closeted_items.include?(item)
|
2026-02-06 17:05:01 -08:00
|
|
|
|
%item-card{data: {is_worn: is_worn || nil, is_closeted: is_closeted || nil}}
|
2026-02-06 16:42:42 -08:00
|
|
|
|
- if defined?(zone_id) && zone_id
|
|
|
|
|
|
%label.item-card-label
|
|
|
|
|
|
%input.visually-hidden{type: "radio", name: "zone_#{zone_id}", checked: is_worn || nil, "aria-label": item.name}
|
|
|
|
|
|
= render "wardrobe/items/item_card_content", item: item
|
|
|
|
|
|
- else
|
2026-02-06 17:05:01 -08:00
|
|
|
|
%label.item-card-label
|
|
|
|
|
|
%input.visually-hidden{type: "checkbox", checked: is_worn || nil, "aria-label": item.name}
|
|
|
|
|
|
= render "wardrobe/items/item_card_content", item: item
|
2025-12-26 23:19:39 -08:00
|
|
|
|
- if is_worn
|
2026-02-06 07:54:09 -08:00
|
|
|
|
= button_to @wardrobe_path, method: :get, class: "item-hide-button", title: "Hide #{item.name}", "aria-label": "Hide #{item.name}" do
|
|
|
|
|
|
👁️🗨️
|
|
|
|
|
|
= outfit_state_params @outfit.hide_item(item)
|
|
|
|
|
|
= button_to @wardrobe_path, method: :get, class: "item-remove-button", title: "Remove #{item.name}", "aria-label": "Remove #{item.name}" do
|
|
|
|
|
|
❌
|
|
|
|
|
|
= outfit_state_params @outfit.without_item(item)
|
|
|
|
|
|
- elsif is_closeted
|
|
|
|
|
|
= button_to @wardrobe_path, method: :get, class: "item-show-button", title: "Show #{item.name}", "aria-label": "Show #{item.name}" do
|
|
|
|
|
|
👁️
|
|
|
|
|
|
= outfit_state_params @outfit.with_item(item)
|
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)
|