Extract outfit-viewer to a separate template

Just cuz this is gonna get more complex down the line!
This commit is contained in:
Emi Matchu 2024-07-02 22:43:36 -07:00
parent 76d2cc6c21
commit 81a58f8656
2 changed files with 10 additions and 9 deletions

View file

@ -0,0 +1,9 @@
.outfit-viewer
- outfit.visible_layers.each do |swf_asset|
%outfit-layer{
data: {
"asset-id": swf_asset.id,
"zone": swf_asset.zone.label,
},
}
= image_tag swf_asset.image_url, alt: ""

View file

@ -14,15 +14,7 @@
sorry!
= turbo_frame_tag "item-preview" do
.outfit-viewer
- @preview_outfit.visible_layers.each do |swf_asset|
%outfit-layer{
data: {
"asset-id": swf_asset.id,
"zone": swf_asset.zone.label,
},
}
= image_tag swf_asset.image_url, alt: ""
= render partial: "outfit_viewer", locals: {outfit: @preview_outfit}
= form_for item_path(@item), method: :get, class: "species-color-picker",
data: {"is-valid": @preview_error.nil?} do |f|