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

80 lines
3.2 KiB
Text
Raw Normal View History

2026-02-05 21:58:27 -08:00
- title @outfit.name
2025-11-02 00:43:54 -07:00
!!! 5
%html
%head
%meta{charset: 'utf-8'}
%meta{name: 'viewport', content: 'width=device-width, initial-scale=1'}
2026-02-05 21:58:27 -08:00
%title #{yield :title} | #{t "app_name"}
2025-11-02 00:43:54 -07:00
%link{href: image_path('favicon.png'), rel: 'icon'}
= stylesheet_link_tag "application/hanger-spinner"
= stylesheet_link_tag "application/outfit-viewer"
2025-11-11 17:21:03 -08:00
= page_stylesheet_link_tag "wardrobe/show"
2025-11-02 00:43:54 -07:00
= javascript_include_tag "application", async: true
= javascript_include_tag "idiomorph", async: true
= javascript_include_tag "outfit-viewer", async: true
= javascript_include_tag "species-color-picker", async: true
2025-11-11 17:41:57 -08:00
= javascript_include_tag "pose-picker", async: true
2026-02-05 18:04:49 -08:00
= javascript_include_tag "tab-panel", async: true
= javascript_include_tag "outfit-rename-field", async: true
2025-11-11 17:21:03 -08:00
= javascript_include_tag "wardrobe/show", async: true
2025-11-02 01:55:17 -07:00
= csrf_meta_tags
%meta{name: 'outfit-viewer-morph-mode', value: 'full-page'}
2025-11-02 00:43:54 -07:00
%body.wardrobe-v2
2026-02-05 20:47:05 -08:00
- if flash[:alert]
.flash-messages
.flash-alert= flash[:alert]
.wardrobe-container{data: @saved_outfit ? {"has-unsaved-changes": @has_unsaved_changes.to_s} : {}}
2025-11-02 01:55:17 -07:00
.outfit-preview-section
- if @pet_type.nil?
.no-preview-message
%p
We haven't seen this kind of pet before! Try a different species/color
combination.
- else
= outfit_viewer @outfit, id: "wardrobe-outfit-viewer",
preferred_image_format: :svg # TODO: Make this a selectable option
2025-11-02 00:43:54 -07:00
2025-11-11 18:07:06 -08:00
.preview-controls
.preview-controls-top
%outfit-viewer-play-pause-toggle{for: "wardrobe-outfit-viewer"}
%label.play-pause-control-button.button
%input{type: "checkbox", checked: cookies[:DTIOutfitViewerIsPlaying] != "false"}
%span.paused-label Paused
%span.playing-label Playing
2025-11-11 17:41:57 -08:00
.preview-controls-bottom
= render "appearance/species_color_picker"
- if @pet_type
= render "appearance/pose_picker"
2025-11-02 00:43:54 -07:00
2025-11-02 01:55:17 -07:00
.outfit-controls-section
2025-12-26 23:01:40 -08:00
.item-search-form
- if @search_mode
2026-02-05 20:47:05 -08:00
= button_to @wardrobe_path, method: :get, class: "back-button" do
2025-12-26 23:01:40 -08:00
= outfit_state_params except: [:q]
2026-02-05 20:47:05 -08:00
= form_with url: @wardrobe_path, method: :get, class: "search-form" do |f|
2025-12-26 23:01:40 -08:00
= outfit_state_params
= f.text_field "q[name]", placeholder: "Search for items...", value: params.dig(:q, :name), "aria-label": "Search for items"
= f.submit "Search"
2025-11-02 23:04:59 -08:00
- if @search_mode
= render "items/search_results"
2025-12-26 22:43:17 -08:00
- else
2026-02-05 20:47:05 -08:00
.outfit-header
- if @saved_outfit && !@is_owner
.outfit-name-static= @outfit.name
- else
= render "header/outfit_rename_field"
= render "header/save_button"
- if @outfit.worn_items.any? || @outfit.closeted_items.any?
.outfit-items
2025-12-26 22:43:17 -08:00
- outfit_items_by_zone(@outfit).each do |zone_group|
.zone-group
%h3.zone-label= zone_group[:zone_label]
%ul.items-list
- zone_group[:items].each do |entry|
= render "items/item_card", item: entry[:item]