<% mode = params[:show] == "to-read" ? "marked_for_later" : "history" %>

<!--Descriptive page name, messages and instructions-->
<h2 class="heading">
  <%= t(".#{mode}.page_heading") %>
</h2>
<!--/descriptions-->

<!--subnav-->
<% if logged_in? && !current_user.readings.empty? %>
<ul class="navigation actions" role="navigation">
  <li>
    <%= span_if_current ts('Full History'), user_readings_path(@user), params[:show].blank? %>
  </li>
  <li>
    <%= span_if_current ts('Marked for Later'), user_readings_path(@user, :show => 'to-read'), params[:show] == "to-read" %>
  </li>
  <li>
    <%= link_to ts('Clear History'), clear_user_readings_path(current_user), data: {confirm: ts('Are you sure you want to clear your History and Marked for Later lists? This cannot be undone!')}, :method => :post %>
  </li>
</ul>
<% end %>
<!--/subnav-->

<!--main content-->
<h3 class="landmark heading">
  <%= t(".#{mode}.landmark") %>
</h3>
<% if logged_in? && @readings.present? %>
  <ol class="reading work index group">
    <% @readings.each do |reading| %>
      <%= render 'reading_blurb', :work => reading.work, :reading => reading %>
    <% end %>
  </ol>
<% end %>
<!--/content-->

<!--subnav-->
<%== pagy_nav @pagy %>
<!--/subnav-->
