%= render "muted/muted_items_notice" %>
<% if @bookmarkable_items %>
<%= search_header @bookmarkable_items, @search, "Bookmarked Item", @owner %>
<% else %>
<%= search_header @bookmarks, @search, "Bookmark", @owner %>
<% end %>
<% if current_user.is_a?(User) || @tag || @facets.present? %>
<% if logged_in? && (@user == current_user || (@owner.blank? && @bookmarkable.blank?) || @collection) %>
- <%= link_to ts("Bookmark External Work"), new_external_work_path %>
<% elsif params[:work_id] || params[:series_id] || params[:external_work_id] %>
<% bookmark_form_id = (@bookmarkable.blank? ? "#{@bookmark.id}" : "#{@bookmarkable.id}") %>
<% # let the user reading this bookmark save a copy for themselves %>
<% if logged_in? && !is_author_of?(@bookmark) %>
-
<% if (current_user_bookmark ||= bookmark_if_exists(@bookmarkable)) %>
<%= link_to ts("Edit Bookmark"), edit_bookmark_path(current_user_bookmark), :id => "bookmark_form_trigger_for_#{bookmark_form_id}", :remote => true %>
<% else %>
<%= link_to ts("Bookmark"), get_new_bookmark_path(@bookmarkable), :id => "bookmark_form_trigger_for_#{bookmark_form_id}", :remote => true %>
<% end %>
<% end %>
<% end %>
<% if @tag %>
- <%= span_if_current ts('Works'), tag_works_path(@tag) %>
- <%= span_if_current ts('Bookmarks'), tag_bookmarks_path(@tag) %>
<% end %>
<% if @facets.present? %>
<% # Filters button for narrow screens jumps to filters when JavaScript is disabled and opens filters when JavaScript is enabled %>
- <%= ts("Filters") %>
<% end %>
<% end %>
<% if params[:work_id] || params[:series_id] || params[:external_work_id] %>
<% # bookmark form loaded here if requested %>
<% end %>
<% unless @owner.present? || @bookmarkable.present? %>
<%= t(".recent_bookmarks_html", choose_fandom_link: link_to(t(".choose_fandom"), media_index_path), advanced_search_link: link_to(t(".advanced_search"), search_bookmarks_path)) %>
<% end %>
<%== pagy_nav @pagy %>
<%= ts("List of Bookmarks") %>
<%= render "bookmarks/bookmarks" %>
<% if @facets.present? %>
<%= render "filters" %>
<% end %>
<%== pagy_nav @pagy %>