<% if @user %>
<%= t(".page_heading.users_collections", user: @user.login) %>
<% elsif @collection %>
<%= t(".page_heading.challenges_subcollections_in", collection: @collection.title) %>
<% elsif @work %>
<%= t(".page_heading.collections_including", work: @work.title) %>
<% else %>
<%= t(".page_heading.collections_in_the", archive: ArchiveConfig.APP_NAME) %>
<% end %>
<% if @collections.empty? %>
<%= ts("Sorry, there were no collections found.") %>
<% else %>
<%= search_header @collections, @query, ts("Collection") %>
<% end %>
<%= ts("Navigation") %>
<% # Collections and Open Challenges links unless a logged in user viewing own collections page %>
<% unless logged_in? && @user && @user == current_user %>
- <%= span_if_current ts("Collections"), collections_path %>
- <%= link_to ts("Open Challenges"), list_challenges_collections_path %>
<% end %>
<% if logged_in? %>
<% # Logged in user on own collections index gets links for user Collections and Manage Collection Items %>
<% if @user && @user == current_user %>
- <%= span_if_current ts("Collections"), user_collections_path(@user) %>
- <%= link_to ts("Manage Collection Items"), user_collection_items_path(@user) %>
<% end %>
<% # Logged in collection maintainer on own collection gets link for New Subcollection and all other logged in users get New Collection link %>
<% if @collection && !@collection.parent && @collection.user_is_maintainer?(current_user) %>
- <%= link_to ts("New Subcollection"), new_collection_collection_path(@collection) %>
<% else %>
- <%= link_to ts("New Collection"), new_collection_path %>
<% end %>
<% end %>
<% if @sort_and_filter %>
<% # Filters button for narrow screens jumps to filters when JavaScript is disabled and opens filters when JavaScript is enabled %>
- <%= ts("Filters") %>
<% end %>
<% unless @collections.blank? %>
<%= will_paginate @collections %>
<%= ts("List of Collections") %>
<% @collections.each do |collection| %>
<%= render :partial => "collection_blurb", :locals => {:collection => collection} %>
<% end %>
<% end %>
<% if @sort_and_filter %>
<%= render 'collections/filters' %>
<% end %>
<% unless @collections.blank? %>
<%= will_paginate @collections %>
<% end %>