<!--Descriptive page name, messages and instructions-->
<h2 class="heading"><%= link_to t(".page_heading"), archive_faqs_path %> > <%= @archive_faq.title %></h2>
<!--/descriptions-->

<!--subnav-->
<!--/subnav-->

<!--main content-->
<% if @archive_faq.slug == "search-and-browse" %>
  <p class="notice">
    <%= t(".elasticsearch_update_notice_html", elasticsearch_news_link: link_to(t(".elasticsearch_news"), admin_post_path(10_575))) %>
  </p>
<% end %>

<div class="admin" role="article">
  <% if policy(ArchiveFaq).translation_access? %>
    <div class="header">
      <h3 class="heading">
        <% if Globalize.locale.to_s != "en" || policy(ArchiveFaq).full_access? -%>
          <%= link_to t(".edit"), edit_archive_faq_path(@archive_faq) %>
        <% end %>
      </h3>
    </div>
  <% end %>

  <% if @archive_faq.questions.blank? %>
    <p class="notice"><%= t(".no_category_entries") %></p>
  <% else %>
    <div <% if rtl? %>dir="rtl"<% end %> class="userstuff">
      <nav id="toc" aria-labelledby="toc-nav-heading" class="toc">
        <h3 class="heading" id="toc-nav-heading">
          <%# TODO: The heading should be "Questions in the NAME Category" once interface translation is in place. If we do it now, everything except NAME will be in English/the interface default. %>
          <%= @archive_faq.title %>
        </h3>
        <ul class="toc">
          <% for q in @questions %>
            <li><%= link_to q.question, archive_faq_path(@archive_faq, anchor: q.anchor) %></li>
          <% end %>
        </ul>
      </nav>

      <div id="faq">
        <% for q in @questions %>
          <h3 id="<%= q.anchor %>">
            <%= q.question %>
          </h3>
          <% unless q.screencast.to_s == "" %>
            <p class="screencast">
              <span class="label"><%= t(".screencast") %></span> <%= link_to q.question, q.screencast.to_s %>
            </p>
          <% end %>
          <%= raw sanitize_field(q, :content) %>
        <% end %>
      </div>
    </div>
  <% end %>
</div>
<!--/content-->
