summaryrefslogtreecommitdiff
path: root/app/views/users/index.html.erb
diff options
context:
space:
mode:
authorerdgeist <erdgeist@erdgeist.org>2026-07-31 15:55:43 +0200
committererdgeist <erdgeist@erdgeist.org>2026-07-31 15:55:43 +0200
commit464dd4266bdc433805010b5dca428f4cb75c2a81 (patch)
tree47fdf4f065960d49da015eafdf56cb817dcf9ea4 /app/views/users/index.html.erb
parent5f17f421b176d48ef556fb379f59bbb7d284b48e (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/index.html.erb')
-rw-r--r--app/views/users/index.html.erb55
1 files changed, 30 insertions, 25 deletions
diff --git a/app/views/users/index.html.erb b/app/views/users/index.html.erb
index 0a003cb1..854811a2 100644
--- a/app/views/users/index.html.erb
+++ b/app/views/users/index.html.erb
@@ -1,27 +1,32 @@
1<h1><%= t(".admins") %></h1> 1<h1><%= t(".title") %></h1>
2<%= link_to new_user_path(admin: true), class: 'action_button' do %> 2
3 <%= icon("plus", library: "tabler", "aria-hidden": true) %> <%= t(".create_admin") %> 3<p class="button_row">
4<% end %> 4 <% UsersController::ROLE_PRESETS.each_key do |preset| %>
5<table class="user_table"> 5 <%= link_to new_user_path(:preset => preset), class: 'action_button' do %>
6 <tr class="header"> 6 <%= icon("plus", library: "tabler", "aria-hidden": true) %>
7 <th><%= t("users.labels.login") %></th> 7 <%= t(".create_#{preset}") %>
8 <th></th> 8 <% end %>
9 <th></th> 9 <% end %>
10 <th></th> 10</p>
11 </tr>
12 <%= render :partial => "user", :locals => {:users => @users[:admin] ||= []} %>
13</table>
14 11
15<h1><%= t(".users") %></h1> 12<% UsersController::GROUP_ORDER.each do |group| %>
16<%= link_to new_user_path, class: 'action_button' do %> 13 <% members = @users[group] || [] %>
17 <%= icon("plus", library: "tabler", "aria-hidden": true) %> <%= t(".create_user") %> 14 <h2 class="user_group_heading <%= "user_group_alumni" if group == :alumni %>">
15 <%= t(".group_#{group}") %>
16 <span class="dashboard_widget_meta"><%= members.size %></span>
17 </h2>
18 <% if members.any? %>
19 <table class="user_table <%= "user_table_alumni" if group == :alumni %>">
20 <tr class="header">
21 <th><%= t("users.labels.login") %></th>
22 <th><%= t("users.labels.roles") %></th>
23 <th></th>
24 <th></th>
25 <th></th>
26 </tr>
27 <%= render :partial => "user", :locals => { :users => members } %>
28 </table>
29 <% else %>
30 <p class="field_hint"><%= t(".group_empty") %></p>
31 <% end %>
18<% end %> 32<% end %>
19<table class="user_table">
20 <tr class="header">
21 <th><%= t("users.labels.login") %></th>
22 <th></th>
23 <th></th>
24 <th></th>
25 </tr>
26 <%= render :partial => "user", :locals => {:users => @users[:user] ||= []} %>
27</table>