% # expects "bookmark" %>
<% bookmarkable = bookmark.bookmarkable %>
<% bookmark_form_id = (bookmarkable.blank? ? "#{bookmark.id}" : "#{bookmarkable.id}") %>
<% if bookmarkable.blank? %>
<%= ts("This has been deleted, sorry!") %>
<% # Bookmarks of deleted items need a div because they can still be edited. %>
<% else %>
<% bookmark_count = bookmarkable.public_bookmark_count %>
<%= get_symbol_for_bookmark(bookmark) %>
<%= get_count_for_bookmark_blurb(bookmarkable) %>
<%= render "bookmarks/bookmark_item_module", bookmarkable: bookmarkable %>
<% if (bookmark_count > 1 && params[:tag_id]) || (bookmark_count > 1 && (@owner.blank? && @bookmarkable.blank?)) || (logged_in? && !is_author_of?(bookmark)) %>
<% # If this bookmark does not belong to the current user, let them save a new copy or edit their existing copy %>
<% if logged_in? && !is_author_of?(bookmark) %>
-
<% if (current_user_bookmark ||= bookmark_if_exists(bookmarkable)) %>
<%= link_to ts("Saved"), edit_bookmark_path(current_user_bookmark), id: "bookmark_form_trigger_for_#{bookmark_form_id}", remote: true %>
<% else %>
<%= link_to ts("Save"), get_new_bookmark_path(bookmarkable), id: "bookmark_form_trigger_for_#{bookmark_form_id}", remote: true %>
<% end %>
<% end %>
<% end %>
<% # bookmark form loaded here if requested %>
<% end %>
<%= render "bookmarks/bookmark_user_module", bookmark: bookmark %>
<% if logged_in_as_admin? && bookmarkable.class == ExternalWork %>
<%= render "admin/admin_options", item: bookmarkable %>
<% end %>