<% admin_breadcrumb(link_to plural_resource_name(Spree::LegacyUser), spree.admin_users_path) %> <% admin_breadcrumb(link_to @user.email, edit_admin_user_url(@user)) %> <% admin_breadcrumb(Spree.t('admin.user.order_history')) %> <%= render 'spree/admin/users/sidebar' %> <%= render 'spree/admin/users/tabs', current: :orders %> <%= render partial: 'spree/admin/users/user_page_actions' %>
<%= Spree.t(:"admin.user.order_history") %> <%= paginate @orders, theme: "solidus_admin" %> <% if @orders.any? %> <%# TODO add search interface %> <% if Spree::Order.checkout_step_names.include?(:delivery) %> <% end %> <% @orders.each do |order| %> <% if Spree::Order.checkout_step_names.include?(:delivery) %> <% end %> <% end %>
<%= sort_link @search, :completed_at, Spree::Order.human_attribute_name(:completed_at), {}, {title: 'orders_completed_at_title'} %> <%= sort_link @search, :number, Spree::Order.human_attribute_name(:number), {}, {title: 'orders_number_title'} %> <%= sort_link @search, :state %> <%= sort_link @search, :payment_state %><%= sort_link @search, :shipment_state %><%= sort_link @search, :total, Spree::Order.human_attribute_name(:total), {}, {title: 'orders_total_title'} %>
<%= l(order.completed_at.to_date) if order.completed_at %> <% if can?([:admin, :edit], order) %> <%= link_to order.number, edit_admin_order_path(order) %> <% else %> <%= order.number %> <% end %> <%= Spree.t(order.state, scope: :order_state) %> <% if order.payment_state %> <%= Spree.t(order.payment_state, scope: :payment_states) %> <% end %> <% if order.shipment_state %> <%= Spree.t(order.shipment_state, scope: :shipment_states) %> <% end %> <%= order.display_total.to_html %>
<% else %>
<%= render 'spree/admin/shared/no_objects_found', resource: Spree::Order, new_resource_url: spree.new_admin_order_path %>
<% end %> <%= paginate @orders, theme: "solidus_admin" %>