<%
source_link =
if image_has_sources(@image) do
" - [url=#{image_first_source(@image)}]Original source[/url]"
else
" (Original source unknown at time of posting)"
end
%>
<%= if present?(@image.scratchpad) do %>
Mod notes:
<%= escape_nl2br(@image.scratchpad) %>
<% else %>
No mod notes present
<% end %>
<%= if not @image.hidden_from_users do %>
<%= form_for @changeset, ~p"/images/#{@image}/delete", [method: "post"], fn f -> %>
<%= label(f, :deletion_reason, "Deletion reason (cannot be empty)") %>
<%= if @image.commenting_allowed do %>
<%= button_to("Lock commenting", ~p"/images/#{@image}/comment_lock", method: "post", class: "button") %>
<% else %>
<%= button_to("Unlock commenting", ~p"/images/#{@image}/comment_lock", method: "delete", class: "button") %>
<% end %>
<%= if @image.description_editing_allowed do %>
<%= button_to("Lock description editing", ~p"/images/#{@image}/description_lock", method: "post", class: "button") %>
<% else %>
<%= button_to("Unlock description editing", ~p"/images/#{@image}/description_lock", method: "delete", class: "button") %>
<% end %>
<%= if @image.tag_editing_allowed do %>
<%= button_to("Lock tag editing", ~p"/images/#{@image}/tag_lock", method: "post", class: "button") %>
<% else %>
<%= button_to("Unlock tag editing", ~p"/images/#{@image}/tag_lock", method: "delete", class: "button") %>
<% end %>
<%= link("Lock specific tags", to: ~p"/images/#{@image}/tag_lock", class: "button") %>
<%= if not @image.approved and can?(@conn, :approve, @image) do %>
<%= button_to("Approve image", ~p"/images/#{@image}/approve", method: "post", class: "button button--state-success", data: [confirm: "Are you sure?"]) %>
<% end %>
<%= if @image.hidden_from_users and can?(@conn, :destroy, @image) do %>
<%= button_to("Destroy image", ~p"/images/#{@image}/destroy", method: "post", class: "button button--state-danger", data: [confirm: "This action is IRREVERSIBLE. Are you sure?"]) %>
<% end %>