2026-02-05 21:56:23 -08:00
|
|
|
- if @saved_outfit
|
|
|
|
|
- form_url = outfit_path(@saved_outfit)
|
|
|
|
|
- form_method = :patch
|
|
|
|
|
- field_name = "outfit[name]"
|
|
|
|
|
- else
|
|
|
|
|
- form_url = @wardrobe_path
|
|
|
|
|
- form_method = :get
|
|
|
|
|
- field_name = :name
|
|
|
|
|
|
|
|
|
|
%outfit-rename-field
|
|
|
|
|
.outfit-rename-static-display
|
|
|
|
|
%span.outfit-rename-name= @outfit.name.presence || "Untitled outfit"
|
|
|
|
|
%button.outfit-rename-pencil{type: "button", "aria-label": "Rename outfit"} ✏️
|
|
|
|
|
= form_with url: form_url, method: form_method, class: "outfit-name-form" do |f|
|
|
|
|
|
= hidden_field_tag :return_to, request.fullpath
|
|
|
|
|
- unless @saved_outfit
|
|
|
|
|
= outfit_state_params except: [:name]
|
|
|
|
|
= f.text_field field_name, value: @outfit.name,
|
|
|
|
|
class: "outfit-name-input", placeholder: "Untitled outfit",
|
|
|
|
|
"aria-label": "Outfit name"
|
|
|
|
|
= f.submit "Rename", name: nil, class: "outfit-name-submit"
|
2026-02-05 22:01:45 -08:00
|
|
|
|