<%= if not @comment.approved and not @comment.hidden_from_users and (can?(@conn, :hide, @comment) or @comment.user_id == @conn.assigns.current_user.id) do %>

This comment is pending approval from a staff member.

<%= if can?(@conn, :approve, @comment) do %>

  • <%= link(to: ~p"/images/#{@comment.image_id}/comments/#{@comment}/approve", data: [confirm: "Are you sure?"], method: "post", class: "button") do %> Approve <% end %>
  • Reject
<%= form_for :comment, ~p"/images/#{@comment.image_id}/comments/#{@comment}/hide", [class: "togglable-delete-form hidden flex", id: "inline-reject-form-comment-#{@comment.id}"], fn f -> %> <%= text_input(f, :deletion_reason, class: "input input--wide", placeholder: "Deletion Reason", id: "inline-reject-reason-comment-#{@comment.id}", required: true) %> <%= submit("Delete", class: "button") %> <% end %>

<% end %>
<% end %>
<%= render(PhilomenaWeb.UserAttributionView, "_anon_user_avatar.html", object: @comment, conn: @conn) %>
<%= render(PhilomenaWeb.UserAttributionView, "_anon_user.html", object: @comment, awards: true, conn: @conn) %>
<%= render(PhilomenaWeb.UserAttributionView, "_anon_user_title.html", object: @comment, conn: @conn) %>
<%= if @comment.hidden_from_users do %> Deletion reason: <%= @comment.deletion_reason %> <%= if can?(@conn, :hide, @comment) and not is_nil(@comment.deleted_by) do %> ( <%= @comment.deleted_by.name %> ) <% end %> <%= if can?(@conn, :hide, @comment) do %> <%= if @comment.destroyed_content do %>
This comment's contents have been destroyed. <% else %>
<%= @body %> <% end %> <% end %> <% else %> <%= @body %> <% end %>
<%= render(PhilomenaWeb.CommentView, "_comment_options.html", comment: @comment, conn: @conn) %>
<%= if can?(@conn, :hide, @comment) do %>
<%= cond do %> <% @comment.hidden_from_users and not @comment.destroyed_content -> %> <%= link(to: ~p"/images/#{@comment.image_id}/comments/#{@comment}/hide", data: [confirm: "Are you sure?"], method: "delete", class: "communication__interaction") do %> Restore <% end %> <%= if can?(@conn, :delete, @comment) do %> <%= link(to: ~p"/images/#{@comment.image_id}/comments/#{@comment}/delete", data: [confirm: "Are you sure?"], method: "post", class: "communication__interaction") do %> Delete Contents <% end %> <% end %> <% not @comment.hidden_from_users and not @comment.destroyed_content -> %> Delete <% true -> %> <% end %> <%= if can?(@conn, :show, :ip_address) do %>
<%= link_to_ip(@conn, @comment.ip) %>
<%= link_to_fingerprint(@conn, @comment.fingerprint) %>
<% end %> <%= form_for :comment, ~p"/images/#{@comment.image_id}/comments/#{@comment}/hide", [class: "togglable-delete-form hidden flex", id: "inline-del-form-comment-#{@comment.id}"], fn f -> %> <%= text_input(f, :deletion_reason, class: "input input--wide", placeholder: "Deletion Reason", id: "inline-del-reason-comment-#{@comment.id}", required: true) %> <%= submit("Delete", class: "button") %> <% end %>
<% end %>