<%= render "pseud_module", pseud: pseud %>
<% if current_user == pseud.user || policy(pseud).edit? %>
<%= t(".user_actions") %>
<%# These links use landmarks so they are distinct for screen readers,
# e.g., Edit Pseud1, Edit Pseud2. The landmark text " Pseud2" is inside the
# landmark span, so there's no extra space for sighted users. If your
# language says "Pseud2 Edit", your landmark text would be "Pseud 2 " and
# your link string "%{landmark_span}Edit". %>
- <%= link_to(
t(".edit_html",
landmark_span: content_tag(:span,
t(".edit_landmark_text", pseud: pseud.name),
class: "landmark")),
edit_user_pseud_path(@user, pseud),
id: "edit_#{pseud.name.downcase.gsub(' ', '_')}"
) %>
<% if pseud.works.present? && current_user == pseud.user %>
- <%= link_to(
t(".orphan_html",
landmark_span: content_tag(:span,
t(".orphan_landmark_text", pseud: pseud.name),
class: "landmark")),
new_orphan_path(pseud_id: pseud.id)
) %>
<% end %>
<% if pseud.is_default? %>
- <%= t(".default_pseud") %>
<% elsif @user.login != pseud.name && current_user == pseud.user %>
- <%= link_to(
t(".delete_html",
landmark_span: content_tag(:span,
t(".delete_landmark_text", pseud: pseud.name),
class: "landmark")),
user_pseud_path(@user, pseud),
data: { confirm: t(".confirm_delete") },
id: "delete_#{pseud.name.underscore}",
method: :delete
) %>
<% end %>
<% end %>