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/new.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/new.html.erb')
| -rw-r--r-- | app/views/users/new.html.erb | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/app/views/users/new.html.erb b/app/views/users/new.html.erb index 776e6e96..8d99fd92 100644 --- a/app/views/users/new.html.erb +++ b/app/views/users/new.html.erb | |||
| @@ -21,8 +21,18 @@ | |||
| 21 | <div class="layout_row_label"><%= t("users.labels.confirm") %></div> | 21 | <div class="layout_row_label"><%= t("users.labels.confirm") %></div> |
| 22 | <div class="layout_row_content"><%= f.password_field :password_confirmation %></div> | 22 | <div class="layout_row_content"><%= f.password_field :password_confirmation %></div> |
| 23 | 23 | ||
| 24 | <div class="layout_row_label"><%= t("users.labels.admin") %></div> | 24 | <div class="layout_row_label"><%= t("users.labels.roles") %></div> |
| 25 | <div class="layout_row_content"><%= f.check_box :admin %></div> | 25 | <div class="layout_row_content"> |
| 26 | <% User::ROLES.each do |role| %> | ||
| 27 | <label class="role_choice"> | ||
| 28 | <%= check_box_tag "user[roles][]", role, @user.roles.include?(role), | ||
| 29 | :id => "user_roles_#{role}" %> | ||
| 30 | <%= t("users.roles.#{role}") %> | ||
| 31 | <span class="field_hint"><%= t("users.role_hints.#{role}") %></span> | ||
| 32 | </label> | ||
| 33 | <% end %> | ||
| 34 | <%= hidden_field_tag "user[roles][]", "" %> | ||
| 35 | </div> | ||
| 26 | 36 | ||
| 27 | <div class="layout_row_label"></div> | 37 | <div class="layout_row_label"></div> |
| 28 | <div class="layout_row_content"><%= f.submit t("admin.common.create") %></div> | 38 | <div class="layout_row_content"><%= f.submit t("admin.common.create") %></div> |
