summaryrefslogtreecommitdiff
path: root/app/views/users/_user.html.erb
blob: 04884be84a7167456e8cff1a015931fe651ab06a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<% users.each do |user| %>
<tr>
  <td class="user_login"><%= user.login %></td>
  <td class="user_roles">
    <% if user.roles.any? %>
      <%= user.role_labels.join(", ") %>
    <% else %>
      <span class="field_hint"><%= t(".no_roles") %></span>
    <% end %>
  </td>
  <td><%= link_to t("admin.common.show"), user_path(user) %></td>
  <% if current_user.admin? || current_user == user %>
  <td><%= link_to t("admin.common.edit"), edit_user_path(user) %></td>
  <td>
  <%= button_to user_path(user), method: :delete,
        form: { data: { confirm: t(".confirm_destroy", :login => user.login) }, class: 'button_to destructive' } do %>
    <%= icon("trash", library: "tabler", "aria-hidden": true) %> <%= t("admin.common.destroy") %>
  <% end %>
  </td>
  <% end %>
</tr>
<% end %>