<%= link_to [:edit, document], class: 'itemicon itemedit' do %> Edit <%= document.human_readable_type %>
<% end %>
<% if @collection # We're on the view page for @collection. -%>
<%= button_for_remove_from_collection(document) %>
<% else %>
<%= link_to document, class: 'itemicon itemtrash', title: 'Delete Collection', method: :delete, data: {
confirm: "Deleting a collection from #{application_name} is permanent. Click OK to delete this collection from #{application_name}, or Cancel to cancel this operation" } do %>
Delete <%= document.human_readable_type %>
<% end %>
<% end %>
<% end %>
<% if can? :collect, document %>
<%= link_to_select_collection document %>
<% end %>
<%= render 'collections/add_to_collection_modal', collectible: document if can? :collect, document %>