<% users.each do |user| %> <% if user.otp_enrolled? %> " aria-label="<%= t(".otp_enrolled") %>"> <%= icon("shield-check", library: "tabler", "aria-hidden": true) %> <% elsif user.otp_pending_secret.present? %> " aria-label="<%= t(".otp_pending") %>"> <%= icon("shield-half", library: "tabler", "aria-hidden": true) %> <% else %> " aria-label="<%= t(".otp_missing") %>"> <%= icon("shield-off", library: "tabler", "aria-hidden": true) %> <% end %> <% if (tier = user.staleness_tier) %> <% hint = tier == :never ? t(".stale_never") : t(".stale_#{tier}", :year => user.last_login_at.year) %> <%= icon(tier == :amber ? "clock-exclamation" : "alert-triangle", library: "tabler", "aria-hidden": true) %> <% end %> <%= user.login %> <% if user.roles.any? %> <% user.role_labels.each do |label| %> <%= label %> <% end %> <% else %> <%= t(".no_roles") %> <% end %>
<%= link_to user_path(user), "aria-label" => t("admin.common.show"), title: t("admin.common.show") do %> <%= icon("eye", library: "tabler", "aria-hidden": true) %> <% end %> <% if current_user.admin? || current_user == user %> <%= link_to edit_user_path(user), "aria-label" => t("admin.common.edit"), title: t("admin.common.edit") do %> <%= icon("edit", library: "tabler", "aria-hidden": true) %> <% end %> <% end %> <% if current_user.admin? && current_user != user %> <% if user.alumni? %> <%= button_to reactivate_user_path(user), method: :put, form: { class: 'button_to state_changing' }, "aria-label" => t(".reactivate"), title: t(".reactivate") do %> <%= icon("user-check", library: "tabler", "aria-hidden": true) %> <% end %> <% else %> <%= button_to deactivate_user_path(user), method: :put, form: { data: { confirm: t(".confirm_deactivate", :login => user.login) }, class: 'button_to destructive' }, "aria-label" => t(".deactivate"), title: t(".deactivate") do %> <%= icon("user-off", library: "tabler", "aria-hidden": true) %> <% end %> <% end %> <% end %> <% if current_user.redaktion? && !user.alumni? %> <% if user.redaktion? %> <% unless user == current_user %> <%= button_to revoke_redaktion_user_path(user), method: :put, form: { data: { confirm: t(".confirm_revoke_redaktion", :login => user.login) }, class: 'button_to destructive' }, "aria-label" => t(".revoke_redaktion"), title: t(".revoke_redaktion") do %> <%= icon("user-minus", library: "tabler", "aria-hidden": true) %> <% end %> <% end %> <% elsif user.otp_enrolled? %> <%= button_to grant_redaktion_user_path(user), method: :put, form: { data: { confirm: t(".confirm_grant_redaktion", :login => user.login) }, class: 'button_to state_changing' }, "aria-label" => t(".grant_redaktion"), title: t(".grant_redaktion") do %> <%= icon("user-plus", library: "tabler", "aria-hidden": true) %> <% end %> <% else %> <% end %> <% end %>
<% end %>