<div class="row">
<div class="col-md-12">
<div class="table-responsive">
<table class="table table-hover table-bordered user_accounts">
<thead>
<tr>
<th><%= _('Name') %> <%= paginable_sort_link('firstname') %></th>
<th><%= _('Email') %> <%= paginable_sort_link('email') %></th>
<th class="text-center"><%= _('Last activity') %> <%= paginable_sort_link('last_sign_in_at') %></th>
<th class="text-center sorter-false"><%= _('Plans') %></th>
<th class="text-center sorter-false"><%= _('Current Privileges') %></th>
<th class="text-center sorter-false"><%= _('Edit Privileges') %></th>
</tr>
</thead>
<tbody>
<% scope.each do |user| %>
<% if !user.nil? then%>
<tr>
<td>
<% if !user.name.nil? %>
<%= user.name(false) %>
<% end %>
</td>
<td>
<%= user.email %>
</td>
<td class="text-center">
<% if !user.last_sign_in_at.nil? %>
<%= l user.last_sign_in_at.to_date, :formats => :short %>
<% end %>
</td>
<td class="text-center">
<% unless user.roles.nil? %>
<%= user.roles.where(Role.not_reviewer_condition).length %>
<% end %>
</td>
<td class="text-center">
<% if user.can_super_admin? %>
<%= _("Super admin privileges") %>
<% elsif user.can_org_admin? %>
<%= _("Org admin privileges") %>
<% else %>
<%= _("") %>
<% end %>
</td>
<td class="text-center">
<% unless current_user == user %>
<% b_label = _('Edit') %>
<%= link_to b_label, admin_grant_permissions_user_path(user), 'data-toggle' => 'modal', 'data-target' => '#modal-permissions', class: 'modal-window' %>
<div id="modal-permissions" class="modal" tabindex="-1" role="dialog"></div>
<% end %>
</td>
</tr>
<% end %>
<% end %>
</tbody>
</table>
</div>
</div>
</div>