From 464dd4266bdc433805010b5dca428f4cb75c2a81 Mon Sep 17 00:00:00 2001 From: erdgeist Date: Fri, 31 Jul 2026 15:55:43 +0200 Subject: 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. --- app/views/users/_user.html.erb | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'app/views/users/_user.html.erb') 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 @@ <% users.each do |user| %> <%= user.login %> - <%= link_to "show", user_path(user) %> - <% if current_user.admin? || current_user == user %> - - <%= link_to "edit", edit_user_path(user) %> + + <% if user.roles.any? %> + <%= user.role_labels.join(", ") %> + <% else %> + <%= t(".no_roles") %> + <% end %> + <%= link_to t("admin.common.show"), user_path(user) %> + <% if current_user.admin? || current_user == user %> + <%= link_to t("admin.common.edit"), edit_user_path(user) %> <%= button_to user_path(user), method: :delete, form: { data: { confirm: t(".confirm_destroy", :login => user.login) }, class: 'button_to destructive' } do %> -- cgit v1.3