<% item_type = item.class.to_s.tableize.singularize %>
<%= t(".landmark") %>
<% if policy(item).hide? %>
-
<% if item.hidden_by_admin? %>
<%= link_to t(".unhide.#{item_type}"),
hide_admin_user_creation_path(item, creation_type: item.class, hidden: "false"),
method: :put %>
<% else %>
<%= link_to t(".hide.#{item_type}"),
hide_admin_user_creation_path(item, creation_type: item.class, hidden: "true"),
method: :put %>
<% end %>
<% end %>
<% if @work.present? %>
<% if policy(@work).edit_tags? %>
-
<%= link_to t(".edit_tags"), edit_tags_work_path(@work) %>
<% end %>
<% if policy(@work).set_spam? %>
-
<% if @work.spam? %>
<%= link_to t(".not_spam"),
set_spam_admin_user_creation_path(@work.id, creation_type: @work.class, spam: "false"),
method: :put %>
<% else %>
<%= link_to t(".spam"),
set_spam_admin_user_creation_path(@work.id, creation_type: @work.class, spam: "true"),
method: :put %>
<% end %>
<% end %>
<% if policy(@work).remove_pseud? %>
<% orphan_pseuds = @work.orphan_pseuds %>
<% if orphan_pseuds.length == 1 %>
-
<%= link_to t(".remove_pseud"),
confirm_remove_pseud_admin_user_creation_path(@work),
data: { confirm: t(".remove_pseud_confirmation") } %>
<% elsif orphan_pseuds.length > 1 %>
-
<%= link_to t(".remove_pseud"), confirm_remove_pseud_admin_user_creation_path(@work) %>
<% end %>
<% end %>
<% end %>
<% if item.class == ExternalWork %>
<% if policy(item).edit? %>
-
<%= link_to t(".edit.#{item_type}"), edit_external_work_path(item) %>
<% end %>
<% end %>
<% if policy(item).destroy? %>
-
<%= link_to t(".delete.#{item_type}"),
admin_user_creation_path(item, creation_type: item.class),
data: {
confirm: t(".delete.confirmation")
},
method: :delete %>
<% end %>