<% content_for :page_title do %> <%= Spree.t(:return_authorizations) %> <% end %> <% content_for :page_tabs do %>
  • "> <%= link_to Spree.t(:all), spree.admin_return_authorizations_path %>
  • "> <%= link_to Spree.t(:authorized), params.merge({q: {state_eq: :authorized}}) %>
  • "> <%= link_to Spree.t(:canceled), params.merge({q: {state_eq: :canceled}}) %>
  • <% end %> <% content_for :table_filter do %>
    <%= search_form_for [:admin, @search], url: spree.admin_return_authorizations_path do |f| %>
    <%= f.label :number_cont, Spree.t(:number) %> <%= f.text_field :number_cont, class: "form-control js-quick-search-target" %>
    <%= label_tag :q_state_eq, Spree.t(:status) %> <%= f.select :state_eq, Spree::ReturnAuthorization.state_machines[:state].states.collect {|s| [Spree.t("return_authorization_states.#{s.name}"), s.value]}, {include_blank: true}, class: 'select2' %>
    <%= button Spree.t(:search), 'search' %>
    <% end %>
    <% end %> <%= render partial: 'spree/admin/shared/index_table_options', locals: { collection: @collection, per_page_action: :return_authorizations } %> <% if @collection.any? %> <% @collection.each do |return_authorization| %> <% end %>
    <%= Spree.t(:created_at) %> <%= Spree.t(:number) %> <%= Spree.t(:order) %> <%= Spree.t(:state) %>
    <%= return_authorization.created_at.to_date %> <%= link_to return_authorization.number, spree.edit_admin_order_return_authorization_path(return_authorization.order, return_authorization) %> <%= link_to return_authorization.order.number, spree.edit_admin_order_path(return_authorization.order) %> <%= Spree.t("return_authorization_states.#{return_authorization.state}") %> <%= link_to_edit return_authorization, url: spree.edit_admin_order_return_authorization_path(return_authorization.order, return_authorization), no_text: true %>
    <% else %>
    <%= Spree.t(:no_resource_found, resource: Spree::ReturnAuthorization.model_name.human(count: :many)) %>.
    <% end %> <%= render partial: 'spree/admin/shared/index_table_options', locals: { collection: @collection, per_page_action: :return_authorizations } %>