summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/views/users/_user.html.erb51
-rw-r--r--public/stylesheets/admin.css28
2 files changed, 65 insertions, 14 deletions
diff --git a/app/views/users/_user.html.erb b/app/views/users/_user.html.erb
index ba82375d..c9b21f0a 100644
--- a/app/views/users/_user.html.erb
+++ b/app/views/users/_user.html.erb
@@ -8,38 +8,61 @@
8 <span class="field_hint"><%= t(".no_roles") %></span> 8 <span class="field_hint"><%= t(".no_roles") %></span>
9 <% end %> 9 <% end %>
10 </td> 10 </td>
11 <td><%= link_to t("admin.common.show"), user_path(user) %></td> 11 <td class="user_action">
12 <td> 12 <%= link_to user_path(user), "aria-label" => t("admin.common.show"),
13 title: t("admin.common.show") do %>
14 <%= icon("eye", library: "tabler", "aria-hidden": true) %>
15 <% end %>
16 </td>
17 <td class="user_action">
13 <% if current_user.admin? || current_user == user %> 18 <% if current_user.admin? || current_user == user %>
14 <%= link_to t("admin.common.edit"), edit_user_path(user) %> 19 <%= link_to edit_user_path(user), "aria-label" => t("admin.common.edit"),
20 title: t("admin.common.edit") do %>
21 <%= icon("edit", library: "tabler", "aria-hidden": true) %>
22 <% end %>
15 <% end %> 23 <% end %>
16 </td> 24 </td>
17 <td> 25 <td class="user_action">
18 <% if current_user.admin? && current_user != user %> 26 <% if current_user.admin? && current_user != user %>
19 <% if user.alumni? %> 27 <% if user.alumni? %>
20 <%= button_to t(".reactivate"), reactivate_user_path(user), method: :put, 28 <%= button_to reactivate_user_path(user), method: :put,
21 form: { class: 'button_to state_changing' } %> 29 form: { class: 'button_to state_changing' },
30 "aria-label" => t(".reactivate"), title: t(".reactivate") do %>
31 <%= icon("user-check", library: "tabler", "aria-hidden": true) %>
32 <% end %>
22 <% else %> 33 <% else %>
23 <%= button_to t(".deactivate"), deactivate_user_path(user), method: :put, 34 <%= button_to deactivate_user_path(user), method: :put,
24 form: { data: { confirm: t(".confirm_deactivate", :login => user.login) }, 35 form: { data: { confirm: t(".confirm_deactivate", :login => user.login) },
25 class: 'button_to destructive' } %> 36 class: 'button_to destructive' },
37 "aria-label" => t(".deactivate"), title: t(".deactivate") do %>
38 <%= icon("user-off", library: "tabler", "aria-hidden": true) %>
39 <% end %>
26 <% end %> 40 <% end %>
27 <% end %> 41 <% end %>
28 </td> 42 </td>
29 <td> 43 <td class="user_action">
30 <% if current_user.redaktion? && !user.alumni? %> 44 <% if current_user.redaktion? && !user.alumni? %>
31 <% if user.redaktion? %> 45 <% if user.redaktion? %>
32 <% unless user == current_user %> 46 <% unless user == current_user %>
33 <%= button_to t(".revoke_redaktion"), revoke_redaktion_user_path(user), method: :put, 47 <%= button_to revoke_redaktion_user_path(user), method: :put,
34 form: { data: { confirm: t(".confirm_revoke_redaktion", :login => user.login) }, 48 form: { data: { confirm: t(".confirm_revoke_redaktion", :login => user.login) },
35 class: 'button_to destructive' } %> 49 class: 'button_to destructive' },
50 "aria-label" => t(".revoke_redaktion"), title: t(".revoke_redaktion") do %>
51 <%= icon("user-minus", library: "tabler", "aria-hidden": true) %>
52 <% end %>
36 <% end %> 53 <% end %>
37 <% elsif user.otp_enrolled? %> 54 <% elsif user.otp_enrolled? %>
38 <%= button_to t(".grant_redaktion"), grant_redaktion_user_path(user), method: :put, 55 <%= button_to grant_redaktion_user_path(user), method: :put,
39 form: { data: { confirm: t(".confirm_grant_redaktion", :login => user.login) }, 56 form: { data: { confirm: t(".confirm_grant_redaktion", :login => user.login) },
40 class: 'button_to state_changing' } %> 57 class: 'button_to state_changing' },
58 "aria-label" => t(".grant_redaktion"), title: t(".grant_redaktion") do %>
59 <%= icon("user-plus", library: "tabler", "aria-hidden": true) %>
60 <% end %>
41 <% else %> 61 <% else %>
42 <span class="field_hint"><%= t(".needs_otp") %></span> 62 <span class="field_hint" title="<%= t(".needs_otp") %>"
63 aria-label="<%= t(".needs_otp") %>">
64 <%= icon("shield-off", library: "tabler", "aria-hidden": true) %>
65 </span>
43 <% end %> 66 <% end %>
44 <% end %> 67 <% end %>
45 </td> 68 </td>
diff --git a/public/stylesheets/admin.css b/public/stylesheets/admin.css
index be8725d3..a54c47a3 100644
--- a/public/stylesheets/admin.css
+++ b/public/stylesheets/admin.css
@@ -137,6 +137,7 @@ input[type=radio] {
137 137
138#wrapper { 138#wrapper {
139 margin: 0 5px; 139 margin: 0 5px;
140 padding-bottom: calc(2rem + env(safe-area-inset-bottom));
140} 141}
141 142
142@media(min-width:1016px) { 143@media(min-width:1016px) {
@@ -846,6 +847,33 @@ table.revisions_table tr:hover {
846 color: var(--text-muted); 847 color: var(--text-muted);
847} 848}
848 849
850.user_table td.user_action {
851 width: 1px;
852 white-space: nowrap;
853 text-align: center;
854}
855
856.user_table td.user_action a {
857 text-decoration: none;
858}
859
860.user_table td.user_action svg {
861 width: 1.25rem;
862 height: 1.25rem;
863}
864
865.user_table td.user_action .field_hint svg {
866 color: var(--text-muted);
867 vertical-align: middle;
868}
869
870/* Four groups stacked, and the last one needs clearance from the wrapper. */
871.user_table {
872 width: 100%;
873 max-width: 44rem;
874 margin-bottom: 1.5rem;
875}
876
849.role_choice { 877.role_choice {
850 display: block; 878 display: block;
851 margin-bottom: 0.35rem; 879 margin-bottom: 0.35rem;