diff --git a/app/views/items/_outfit_viewer.html.haml b/app/views/items/_outfit_viewer.html.haml new file mode 100644 index 00000000..95bc452f --- /dev/null +++ b/app/views/items/_outfit_viewer.html.haml @@ -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: "" \ No newline at end of file diff --git a/app/views/items/show.html.haml b/app/views/items/show.html.haml index 856d6537..df187658 100644 --- a/app/views/items/show.html.haml +++ b/app/views/items/show.html.haml @@ -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|