<% @users.each do |user| %> <% end %>
Username Email State Active agents Deactivated agents Registered since Options
<%= link_to user.username, edit_admin_user_path(user) %> <%= user.email %> <%= user_account_state(user) %> <%= link_to user.agents.active.count, switch_to_user_admin_user_path(user), data: { confirm: 'This will log you in as another user. Would you like to continue?' } %> <%= link_to user.agents.inactive.count, switch_to_user_admin_user_path(user), data: { confirm: 'This will log you in as another user. Would you like to continue?' } %> <%= time_ago_in_words user.created_at %> ago
<% if user != current_user %> <%= link_to 'Become User', switch_to_user_admin_user_path(user), class: "btn btn-default", data: { confirm: 'This will log you in as another user. Would you like to continue?' } %> <% if user.active? %> <%= link_to 'Deactivate', deactivate_admin_user_path(user), method: :put, class: "btn btn-default" %> <% else %> <%= link_to 'Activate', activate_admin_user_path(user), method: :put, class: "btn btn-default" %> <% end %> <%= link_to 'Delete', admin_user_path(user), method: :delete, data: { confirm: 'Are you sure? This can not be undone.' }, class: "btn btn-default" %> <% end %>
<%= paginate @users, theme: 'twitter-bootstrap-3' %>
<%= link_to icon_tag('glyphicon-plus') + ' New User', new_admin_user_path, class: "btn btn-default" %>