<%= render partial: 'spree/admin/shared/product_tabs', locals: { current: :images } %> <% content_for :page_actions do %>
<%= yield :page_actions %>
<%= product_preview_link(@product) %> <%= button_link_to(Spree.t(:new_image), spree.new_admin_product_image_url(@product), { class: "btn-success", icon: 'add', id: 'new_image_link' }) if can? :create, Spree::Image %> <% end %> <% has_variants = @product.has_variants? %> <% unless @product.variant_images.any? %>
<%= Spree.t(:no_resource_found, resource: plural_resource_name(Spree::Image)) %>.
<% else %> <% if has_variants %> <% end %> <% (@product.variant_images).each do |image| %> <% if has_variants %> <% end %> <% end %>
<%= Spree.t(:thumbnail) %> <%= Spree::Variant.model_name.human %> <%= Spree.t(:alt_text) %>
<% if can? :edit, image %> <% end %> <%= link_to image_tag(main_app.url_for(image.url(:mini))), main_app.rails_blob_url(image.attachment) %> <%= options_text_for(image) %><%= image.alt %> <%= link_to_with_icon('edit', Spree.t(:edit), spree.edit_admin_product_image_url(@product, image), class: 'btn btn-primary btn-sm', no_text: true, data: { action: 'edit' }) if can? :edit, image %> <%= link_to_delete(image, { url: spree.admin_product_image_url(@product, image), no_text: true }) if can? :destroy, image %>
<% end %>