|
<% if user.otp_enrolled? %>
<%= flag("shield-check", t(".otp_enrolled")) %>
<% elsif user.otp_pending_secret.present? %>
<%= flag("shield-half", t(".otp_pending"), :tier => :attention) %>
<% else %>
<%= flag("shield-off", t(".otp_missing"), :tier => :attention) %>
<% end %>
<% if (tier = user.staleness_tier) %>
<% hint = tier == :never ? t(".stale_never")
: t(".stale_#{tier}", :year => user.last_login_at.year) %>
<%= flag(tier == :amber ? "clock-exclamation" : "alert-triangle", hint,
:tier => tier == :amber ? :attention : :alert) %>
<% 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.is_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 %>
<%= link_to admin_log_path(:user_id => user.id),
"aria-label" => t(".action_log"), title: t(".action_log") do %>
<%= icon("history", library: "tabler", "aria-hidden": true) %>
<% end %>
<% if current_user.is_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("users-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("users-plus", library: "tabler", "aria-hidden": true) %>
<% end %>
<% else %>
<% end %>
<% end %>
|
<% end %>