summaryrefslogtreecommitdiff
path: root/app/views/users/index.html.erb
blob: 854811a25ac106f0c962ff89b5f97237c5e36fdb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<h1><%= t(".title") %></h1>

<p class="button_row">
  <% UsersController::ROLE_PRESETS.each_key do |preset| %>
    <%= link_to new_user_path(:preset => preset), class: 'action_button' do %>
      <%= icon("plus", library: "tabler", "aria-hidden": true) %>
      <%= t(".create_#{preset}") %>
    <% end %>
  <% end %>
</p>

<% UsersController::GROUP_ORDER.each do |group| %>
  <% members = @users[group] || [] %>
  <h2 class="user_group_heading <%= "user_group_alumni" if group == :alumni %>">
    <%= t(".group_#{group}") %>
    <span class="dashboard_widget_meta"><%= members.size %></span>
  </h2>
  <% if members.any? %>
    <table class="user_table <%= "user_table_alumni" if group == :alumni %>">
      <tr class="header">
        <th><%= t("users.labels.login") %></th>
        <th><%= t("users.labels.roles") %></th>
        <th></th>
        <th></th>
        <th></th>
      </tr>
      <%= render :partial => "user", :locals => { :users => members } %>
    </table>
  <% else %>
    <p class="field_hint"><%= t(".group_empty") %></p>
  <% end %>
<% end %>