<% admin_breadcrumb(plural_resource_name(Spree::LegacyUser)) %> <% content_for :page_actions do %> <% if can?(:admin, Spree.user_class) && can?(:create, Spree.user_class) %>
  • <%= link_to t('spree.new_user'), new_admin_user_url, id: 'admin_new_user_link', class: 'btn btn-primary' %>
  • <% end %> <% end %> <% content_for :table_filter_title do %> <%= t('spree.search') %> <% end %> <% content_for :table_filter do %>
    <%= search_form_for [:admin, @search], url: admin_users_url do |f| %>
    <%= f.label :email_cont, t('spree.email') %> <%= f.text_field :email_cont, class: "form-control" %>
    <%= f.label :spree_roles_id_in, Spree.user_class.human_attribute_name(:spree_roles) %> <%= f.collection_select :spree_roles_id_in, @roles, :id, :name, {}, multiple: true, class: 'select2 fullwidth' %>
    <%= label_tag :q_created_at_gt, t('spree.member_since') %>
    <%= f.text_field :created_at_gt, class: 'datepicker form-control datepicker-from', value: params[:q].try!("[]", :created_at_gt), placeholder: t('spree.start') %>
    <%= f.text_field :created_at_lt, class: 'datepicker form-control datepicker-to', value: params[:q].try!("[]", :created_at_lt), placeholder: t('spree.stop') %>
    <%= button_tag t('spree.search'), class: 'btn btn-primary' %>
    <% end %>
    <% end %> <%= paginate @users, theme: "solidus_admin" %> <% @users.each do |user|%> <% end %>
    <%= sort_link @search, :email, Spree.user_class.human_attribute_name(:email), {}, {title: 'users_email_title'} %> <%= Spree.user_class.human_attribute_name(:spree_roles) %> <%= t('spree.num_orders') %> <%= Spree.user_class.human_attribute_name(:lifetime_value) %> <%= sort_link @search, :created_at, t('spree.member_since') %>
    <%=link_to user.email, edit_admin_user_url(user) %> <%= user.spree_roles.map(&:name).to_sentence %> <%= link_to user.order_count, spree.orders_admin_user_path(user) %> <%= link_to user.display_lifetime_value, spree.items_admin_user_path(user) %> <%= l user.created_at.to_date %> <% if can?(:edit, user) %> <%= link_to_edit user, no_text: true %> <% end %> <% if can?(:destroy, user) && user.orders.count.zero? %> <%= link_to_delete user, no_text: true %> <% end %>
    <%= paginate @users, theme: "solidus_admin" %>