28 lines
1.5 KiB
Text
28 lines
1.5 KiB
Text
- is_worn = @outfit.worn_items.include?(item)
|
||
- is_closeted = @outfit.closeted_items.include?(item)
|
||
%li.item-card{data: {is_worn: is_worn || nil, is_closeted: is_closeted || nil}}
|
||
.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
|
||
= 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)
|
||
= 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)
|
||
- else
|
||
= button_to @wardrobe_path, method: :get, class: "item-add-button", title: "Add #{item.name}", "aria-label": "Add #{item.name}" do
|
||
➕
|
||
= outfit_state_params @outfit.with_item(item)
|