<% if can?(:update_positions, Spree::Image) %> <% end %> <%= render 'spree/admin/shared/image', image: image, size: :mini %> <%= render( "spree/admin/shared/modal", target: "modal-image-#{image.id}", title: image.alt, content: %{
#{image_tag(image.attachment.url(:large))}
}.html_safe ) %> <% if @product.has_variants? %> <%= fields_for image do |f| %> <%= f.select :viewable_id, options_for_select(@variants, image.viewable_id), {}, class: 'select2 fullwidth', autocomplete: "off" %> <% end %> <% end # @product.has_variants? %> <%= fields_for image do |f| %> <%= f.text_field :alt %> <% end %> <% if can?(:update, image) %> <%= link_to_with_icon 'check', Spree.t('actions.save'), api_variant_image_path(@product, image), no_text: true, data: {action: 'save'} %> <%= link_to_with_icon 'cancel', Spree.t('actions.cancel'), nil, no_text: true, data: {action: 'cancel'} %> <%= link_to_with_icon 'edit', Spree.t('actions.edit'), edit_admin_product_image_path(@product, image), no_text: true, data: {action: 'edit'} %> <% end %> <% if can?(:destroy, image) %> <%= link_to_delete image, { url: admin_product_image_url(@product, image), no_text: true } %> <% end %>