diff options
| author | erdgeist <erdgeist@erdgeist.org> | 2026-07-31 15:55:43 +0200 |
|---|---|---|
| committer | erdgeist <erdgeist@erdgeist.org> | 2026-07-31 15:55:43 +0200 |
| commit | 464dd4266bdc433805010b5dca428f4cb75c2a81 (patch) | |
| tree | 47fdf4f065960d49da015eafdf56cb817dcf9ea4 /app/views/users/_user.html.erb | |
| parent | 5f17f421b176d48ef556fb379f59bbb7d284b48e (diff) | |
Group user accounts by role
Replaces the two-way admin/user split with four groups ordered by
capability: administration, Redaktion, editors, alumni. alumni takes
precedence over capability in role_group, so a retired admin appears at the
bottom rather than the top.
Forms now offer the three roles as checkboxes rather than a single admin
checkbox, with a trailing hidden blank so an empty set can be posted, and
user_params permits roles only for admins. Three create buttons prefill the
common combinations.
Diffstat (limited to 'app/views/users/_user.html.erb')
| -rw-r--r-- | app/views/users/_user.html.erb | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/app/views/users/_user.html.erb b/app/views/users/_user.html.erb index 9c6466a2..04884be8 100644 --- a/app/views/users/_user.html.erb +++ b/app/views/users/_user.html.erb | |||
| @@ -1,11 +1,16 @@ | |||
| 1 | <% users.each do |user| %> | 1 | <% users.each do |user| %> |
| 2 | <tr> | 2 | <tr> |
| 3 | <td class="user_login"><%= user.login %></td> | 3 | <td class="user_login"><%= user.login %></td> |
| 4 | <td><%= link_to "show", user_path(user) %></td> | 4 | <td class="user_roles"> |
| 5 | <% if current_user.admin? || current_user == user %> | 5 | <% if user.roles.any? %> |
| 6 | <td> | 6 | <%= user.role_labels.join(", ") %> |
| 7 | <%= link_to "edit", edit_user_path(user) %> | 7 | <% else %> |
| 8 | <span class="field_hint"><%= t(".no_roles") %></span> | ||
| 9 | <% end %> | ||
| 8 | </td> | 10 | </td> |
| 11 | <td><%= link_to t("admin.common.show"), user_path(user) %></td> | ||
| 12 | <% if current_user.admin? || current_user == user %> | ||
| 13 | <td><%= link_to t("admin.common.edit"), edit_user_path(user) %></td> | ||
| 9 | <td> | 14 | <td> |
| 10 | <%= button_to user_path(user), method: :delete, | 15 | <%= button_to user_path(user), method: :delete, |
| 11 | form: { data: { confirm: t(".confirm_destroy", :login => user.login) }, class: 'button_to destructive' } do %> | 16 | form: { data: { confirm: t(".confirm_destroy", :login => user.login) }, class: 'button_to destructive' } do %> |
