<% content_for :page_actions do %>
  • <%= button_link_to Spree.t(:back_to_products_list), session[:return_to] || admin_products_url, :icon => 'icon-arrow-left' %>
  • <% end %> <%= render :partial => 'spree/admin/shared/product_sub_menu' %> <%= render :partial => 'spree/admin/shared/product_tabs', :locals => { :current => 'Stock Management' } %> <%= render :partial => 'spree/shared/error_messages', :locals => { :target => @product } %>
    <%= render 'add_stock_form' %>
    <% @variants.each do |variant| %> <% if variant.stock_items.present? %> <% reset_cycle("stock_locations") %> <% end %> <% end %>
    <%= Spree.t(:variant) %> <%= Spree.t(:stock_location_info) %>
    <%= variant.sku %>
    <% if variant.images.present? %> <%= image_tag variant.images.first.attachment.url(:mini) %> <% end %>
    <% variant.stock_items.each do |item| %> <% next unless @stock_locations.include?(item.stock_location) %> <% end %>
    <%= Spree.t(:stock_location) %> <%= Spree.t(:count_on_hand) %> <%= Spree.t(:backorderable) %>
    <%= item.stock_location.name %> <%= item.count_on_hand %> <%= form_tag admin_stock_item_path(item), method: :put, class: 'toggle_stock_item_backorderable' do %> <%= check_box_tag 'stock_item[backorderable]', 1, item.backorderable?, class: 'stock_item_backorderable', id: "stock_item_backorderable_#{item.stock_location.id}" %> <% end %> <%= link_to(icon('delete'), [:admin, item], method: :delete, remote: true, confirm: Spree.t(:are_you_sure), class: 'icon_link with-tip icon-trash no-text', title: Spree.t(:remove), data: { action: :remove }) %>