= render partial: 'spree/admin/shared/product_sub_menu'

= render partial: 'spree/admin/shared/product_tabs', locals: {current: 'Variants'}

#new_variant
- if @variants.any?
  %table.index.sortable{"data-sortable-link" => update_positions_admin_product_variants_path(@product)}
    %colgroup
      %col{style: "width: 5%"}/
      %col{style: "width: 25%"}/
      %col{style: "width: 20%"}/
      %col{style: "width: 20%"}/
      %col{style: "width: 15%"}/
      %col{style: "width: 15%"}/
    %thead
      %tr
        %th{colspan: "2"}= t('.options')
        %th= t('.price')
        %th= t('.sku')
        %th.actions
    %tbody
      - @variants.each do |variant|
        %tr{id: spree_dom_id(variant), class: cycle('odd', 'even'), style: "#{"color:red;" if variant.deleted? }" }
          %td.no-border
            %span.handle
          %td= variant.full_name
          %td.align-center= variant.display_price.to_html
          %td.align-center= variant.sku
          %td.actions
            = link_to_edit(variant, no_text: true) unless variant.deleted?
            = link_to_delete(variant, no_text: true) unless variant.deleted?
    - unless @product.has_variants?
      %tr
        %td{colspan: "5"}= t(:none)

- else
  .alpha.twelve.columns.no-objects-found
    = t('.no_results')
    \.

- if @product.empty_option_values?
  %p.first_add_option_types.no-objects-found
    = t('.to_add_variants_you_must_first_define')
    = link_to t('.option_types'), admin_product_url(@product)
    = t('.and')
    = link_to t('.option_values'), admin_option_types_url

- else
  - content_for :page_actions do
    %ul.inline-menu
      %li#new_var_link
        = link_to_with_icon('icon-plus', t('.new_variant'), new_admin_product_variant_url(@product), remote: true, 'data-update' => 'new_variant', class: 'button')

      %li= link_to_with_icon('icon-filter', @deleted.blank? ? t('.show_deleted') : t('.show_active'), admin_product_variants_url(@product, deleted: @deleted.blank? ? "on" : "off"), class: 'button')
