<% admin_layout "full-width" %> <%= paginate @variants, theme: "solidus_admin" %> <% variants.each do |variant| %> <% end %>
<%= t('spree.item') %> <%= Spree::Variant.model_name.human %> <%= Spree::StockLocation.model_name.human %> <%= t('spree.backorderable_header') %> <%= t('spree.count_on_hand') %> <%= t('spree.modify_stock_count') %>
<%= render 'spree/admin/shared/image', image: variant.gallery.images.first, size: :small %>
<% @variant_display_attributes.each do |display_attribute| %> <% end %>
<%= t(display_attribute[:translation_key], scope: 'spree') %> <%= variant.send(display_attribute[:attr_name]) %>
<% variant.option_values.sort_by(&:option_type_name).each do |option_value| %> <% end %>
<%= option_value.option_type_presentation %> <%= option_value.presentation %>
<% variant.stock_items.each do |item| %> <% if @stock_item_stock_locations.include?(item.stock_location) %> <%# This is rendered in JS %> <% end %> <% end %> <% locations_without_items = @stock_item_stock_locations - variant.stock_items.flat_map(&:stock_location) %> <% if locations_without_items.any? && can?(:create, Spree::StockItem) %> <% end %>
<%= select_tag :stock_location_id, options_from_collection_for_select(locations_without_items, :id, :name), class: 'custom-select', prompt: t('spree.add_to_stock_location'), id: "variant-stock-location-#{variant.id}" %> <%= check_box_tag :backorderable, 'backorderable', false, id: "variant-backorderable-#{variant.id}" %> <%= number_field_tag :count_on_hand, "", class: 'fullwidth', id: "variant-count-on-hand-#{variant.id}" %> <%= link_to_with_icon 'plus', t('spree.actions.create'), '#', no_text: true, data: { action: 'add' }, class: "submit" %>
<%= paginate @variants, theme: "solidus_admin" %>