<% if policy(post).visible? %>
-
<%= link_to "Resize to window", "#", class: "image-resize-to-window-link", "data-shortcut": "z" %>
<% end %>
<% if policy(post).visible? && post.has_large? && !post.is_ugoira? %>
-
<%= link_to "View smaller", post.tagged_large_file_url, class: "image-view-large-link" %>
-
<%= link_to "View original", post.tagged_file_url, class: "image-view-original-link" %>
<% end %>
-
<%= link_to "Find similar", iqdb_queries_path(post_id: post.id) %>
<% if policy(post).visible? %>
-
<%= link_to "Download", post.tagged_file_url + "?download=1", download: post.presenter.filename_for_download %>
<% end %>
<% if policy(Favorite).create? %>
-
<%= link_to "Favorite", favorites_path(post_id: post.id), remote: true, method: :post, id: "add-to-favorites", "data-shortcut": "f", style: ("display: none;" if @post.is_favorited?) %>
-
<%= link_to "Unfavorite", favorite_path(post), remote: true, method: :delete, id: "remove-from-favorites", "data-shortcut": "shift+f", style: ("display: none;" if !@post.is_favorited?) %>
<% end %>
<% if policy(post).update? %>
- <%= link_to "Edit", "#edit", id: "side-edit-link" %>
- <%= link_to "Add to pool", "#", id: "pool" %>
-
<% if post.is_note_locked? %>
Note locked
<% else %>
<%= link_to "Add note", "#", id: "translate", "data-shortcut": "n" %>
<% end %>
<% if post.has_notes? %>
- <%= link_to "Copy notes", "#", id: "copy-notes" %>
<% end %>
<% end %>
<% if policy(FavoriteGroup).create? %>
- <%= link_to "Add to fav group", "#", id: "open-favgroup-dialog-link", "data-shortcut": "g" %>
<% end %>
<% if post.is_status_locked? %>
- Status locked
<% else %>
<% if (!post.is_deleted? && !post.is_pending? && !post.is_flagged?) && policy(PostFlag).create? %>
- <%= link_to "Flag", new_post_flag_path(post_flag: { post_id: post.id }), remote: true %>
<% elsif (post.is_flagged? || post.is_deleted?) && policy(PostAppeal).create? %>
- <%= link_to "Appeal", new_post_appeal_path(post_appeal: { post_id: post.id }), remote: true %>
<% end %>
<% if policy(PostApproval).create? %>
<% if post.is_deleted? %>
- <%= link_to "Undelete", post_approvals_path(post_id: post.id), remote: true, method: :post, "data-confirm": "Are you sure you want to undelete this post?" %>
<% if policy(post).move_favorites? %>
- <%= link_to "Move favorites", confirm_move_favorites_moderator_post_post_path(post_id: post.id) %>
<% end %>
<% elsif policy(post).delete? %>
- <%= link_to "Delete", confirm_delete_moderator_post_post_path(post_id: post.id) %>
<% end %>
<% if post.is_approvable? && !post.is_deleted? %>
- <%= link_to "Approve", post_approvals_path(post_id: post.id), remote: true, method: :post, id: "approve", "data-shortcut": "shift+o", "data-confirm": "Are you sure you want to approve this post?" %>
- <%= link_to "Hide from queue", post_disapprovals_path(post_disapproval: { post_id: post.id, reason: "disinterest" }), remote: true, method: :post, id: "disapprove" %>
<% end %>
<% if policy(post).unban? %>
- <%= link_to "Unban", unban_moderator_post_post_path(post), method: :post, "data-confirm": "Are you sure you want to unban this post?" %>
<% elsif policy(post).ban? %>
- <%= link_to "Ban", ban_moderator_post_post_path(post), method: :post, "data-confirm": "Are you sure you want to ban this post?" %>
<% end %>
<% if policy(post).expunge? %>
- <%= link_to "Expunge", expunge_moderator_post_post_path(post_id: post.id), remote: true, method: :post, "data-confirm": "This will permanently delete this post (meaning the file will be deleted). Are you sure you want to delete this post?" %>
<% end %>
<% end %>
<% if policy(PostReplacement).create? %>
- <%= link_to "Replace image", new_post_replacement_path(post_id: post.id), remote: true %>
<% end %>
<% end %>