<%= render partial: 'spree/admin/users/sidebar', locals: { current: :items } %> <%= render partial: 'spree/admin/users/user_page_actions' %> <% content_for :page_title do %> <%= link_to @user.email, spree.edit_admin_user_url(@user) %> / <%= Spree.t(:"admin.user.items_purchased") %> <% end %>
<% if @orders.any? %> <%# TODO add search interface %>
<% @orders.each do |order| %> <% order.line_items.each do |item| %> <% end %> <% end %>
<%= sort_link @search, :completed_at, I18n.t(:completed_at, scope: 'activerecord.attributes.spree/order'), {}, {title: 'orders_completed_at_title'} %> <%= Spree.t(:description) %> <%= I18n.t(:price, scope: 'activerecord.attributes.spree/line_item') %> <%= I18n.t(:quantity, scope: 'activerecord.attributes.spree/line_item') %> <%= Spree.t(:total) %> <%= sort_link @search, :state, I18n.t(:state, scope: 'activerecord.attributes.spree/order'), {}, {title: 'orders_state_title'} %> <%= sort_link @search, :number, Spree.t(:order_num, scope: 'admin.user'), {}, {title: 'orders_number_title'} %>
<%= order_time(order.completed_at) if order.completed_at %> <%= mini_image(item.variant) %> <%= item.name %>
<%= "(#{item.options_text})" if item.options_text.present? %> <% if item.sku.present? %> <%= Spree.t(:sku) %>: <%= item.variant.sku %> <% end %>
<%= item.single_money.to_html %> <%= item.quantity %> <%= item.money.to_html %>
<%= Spree.t("order_state.#{order.state.downcase}") %>
<% if order.payment_state %>
<%= link_to Spree.t("payment_states.#{order.payment_state}"), admin_order_payments_path(order) %>
<% end %> <% if Spree::Order.checkout_step_names.include?(:delivery) && order.shipment_state %>
<%= Spree.t("shipment_states.#{order.shipment_state}") %>
<% end %>
<%= link_to order.number, edit_admin_order_url(order) %>
<% else %>
<%= Spree.t(:no_resource_found, resource: plural_resource_name(Spree::Order)) %>, <%= link_to Spree.t(:add_one), spree.new_admin_order_path %>!
<% end %> <%= paginate @orders, theme: 'admin-twitter-bootstrap-4' %>
<%= render 'spree/admin/users/lifetime_stats' %>