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

- content_for :page_title do
  = t("spree.tax_rates")

- content_for :page_actions do
  %li
    = button_link_to t("spree.new_tax_rate"), new_object_url, icon: 'icon-plus'

- unless @tax_rates.any?
  .no-objects-found
    = t("spree.no_results")
- else
  %table.index
    %colgroup
      %col{style: "width: 15%"}/
      %col{style: "width: 15%"}/
      %col{style: "width: 10%"}/
      %col{style: "width: 10%"}/
      %col{style: "width: 10%"}/
      %col{style: "width: 10%"}/
      %col{style: "width: 15%"}/
      %col{style: "width: 15%"}/
    %thead
      %tr
        %th= t("spree.zone")
        %th= t("spree.name")
        %th= t("spree.category")
        %th= t("spree.amount")
        %th= t("spree.included_in_price")
        %th= t("spree.show_rate_in_label")
        %th= t("spree.calculator")
        %th.actions
    %tbody
      - @tax_rates.each do |tax_rate|
        - tr_class = cycle('odd', 'even')
        - tr_id = spree_dom_id(tax_rate)
        %tr{class: tr_class, id: tr_id}
          %td= tax_rate.zone.try(:name) || t("spree.not_available")
          %td= tax_rate.name
          %td= tax_rate.tax_category.try(:name) || t("spree.not_available")
          %td.align-center= tax_rate.amount
          %td.align-center= tax_rate.included_in_price
          %td.align-center= tax_rate.show_rate_in_label
          %td.align-center= tax_rate.calculator.to_s
          %td.actions
            = link_to_edit tax_rate, no_text: true
            = link_to_delete tax_rate, no_text: true
