<% content_for :page_title do %> <%= plural_resource_name(Spree::Product) %> <% end %> <% content_for :page_actions do %> <%= button_link_to Spree.t(:new_product), new_object_url, { class: "btn-success", icon: 'add', id: 'admin_new_product' } %> <% end if can?(:create, Spree::Product) %> <% content_for :table_filter do %>
<%= search_form_for [:admin, @search] do |f| %> <%- locals = {f: f} %>
<%= f.label :name_cont, Spree.t(:name) %> <%= f.text_field :name_cont, size: 15, class: "form-control js-quick-search-target" %>
<%= f.label :variants_including_master_sku_cont, Spree.t(:sku) %> <%= f.text_field :variants_including_master_sku_cont, size: 15, class: "form-control" %>
<%= button Spree.t(:search), 'search' %>
<% end %>
<% end %> <%= render partial: 'spree/admin/shared/index_table_options', locals: { collection: @collection } %> <% if @collection.any? %> <% @collection.each do |product| %> id="<%= spree_dom_id product %>" data-hook="admin_products_index_rows" class="<%= cycle('odd', 'even') %>"> <% end %>
<%= Spree.t(:sku) %> <%= Spree.t(:status) %> <%= sort_link @search,:name, Spree.t(:name), { default_order: "desc" }, {title: 'admin_products_listing_name_title'} %> <%= sort_link @search, :master_default_price_amount, Spree.t(:master_price), {}, {title: 'admin_products_listing_price_title'} %>
<%= product.sku rescue '' %> <%= available_status(product) %> <%= mini_image product %> <%= link_to product.try(:name), edit_admin_product_path(product) %> <%= product.display_price.to_html rescue '' %> <%= link_to_edit product, no_text: true, class: 'edit' if can?(:edit, product) && !product.deleted? %> <%= link_to_clone product, no_text: true, class: 'clone' if can?(:clone, product) %> <%= link_to_delete product, no_text: true if can?(:delete, product) && !product.deleted? %>
<% else %>
<%= Spree.t(:no_resource_found, resource: plural_resource_name(Spree::Product)) %>, <%= link_to Spree.t(:add_one), new_object_url %>!
<% end %> <%= render partial: 'spree/admin/shared/index_table_options', locals: { collection: @collection } %>