{% extends "misago/base.html" %}
{% load i18n %}


{% block meta-extra %}
<link rel="canonical" href="{{ request_path }}" />
{% if list_page.next %}
<link rel="next" href="{{ request_path }}?start={{ list_page.next }}" />
{% endif %}
{% endblock meta-extra %}


{% block content %}
<div class="page page-threads page-threads-{{ list_type|default:'all' }} {% spaceless %}
  {% block extra-css %}{% endblock extra-css %}
{% endspaceless %}">

  {% block page-header %}{% endblock page-header %}

  <div class="container page-container">
    {% block list-container %}
      {% if subcategories %}
        <noscript>
          <section class="toolbar" itemscope itemtype="http://schema.org/SiteNavigationElement">
            <ul class="list-inline subcategories-list">
              {% for subcategory in subcategories %}
                <li>
                  <a href="{{ subcategory.get_absolute_url }}{% if list_type != 'all' %}{{ list_type }}/{% endif %}" class="subcategory {% if subcategory.css_class %}subcategory-{{ subcategory.css_class }}{% endif %}">
                    {{ subcategory.name }}
                  </a>
                </li>
              {% endfor %}
            </ul>
          </section>
        </noscript>
      {% endif %}

      <section>
        <div class="threads-list">
          {% block threads-list %}
            <ul class="list-group" itemscope itemtype="http://schema.org/ItemList">
              <meta itemprop="itemListOrder" content="http://schema.org/ItemListOrderDescending">
              {% for thread in threads %}
                {% block thread %}
                  {% include "misago/threadslist/thread.html" %}
                {% endblock thread %}
              {% empty %}
                <li class="list-group-item empty-message">
                  {% block list-empty-message %}
                    {% if list_type == 'all' %}
                      <p class="lead">
                        {% if category.level %}
                          {% trans "There are no threads in this category." context "threads list empty" %}
                        {% else %}
                          {% trans "There are no threads on this site yet." context "threads list empty" %}
                        {% endif %}
                      </p>
                    {% else %}
                      <p class="lead">
                        {% trans "No threads matching specified criteria were found." context "threads list empty" %}
                      </p>
                    {% endif %}
                  {% endblock list-empty-message %}
                </li>
              {% endfor %}
            </ul>
          {% endblock threads-list %}
        </div>

        <noscript>
          {% if list_page.next %}
            <nav role="navigation" itemscope itemtype="http://schema.org/SiteNavigationElement">
              <ul class="pager">
                <li class="next">
                  <a href="{{ request_path }}?page={{ list_page.next }}" rel="next" title="{% trans 'Next page' context 'threads list paginator' %}">
                    <span aria-hidden="true" class="material-icon">
                      arrow_forward
                    </span>
                  </a>
                </li>
              </ul>
            </nav>
          {% endif %}
        </noscript>
      </section>
    {% endblock list-container %}
  </div>
</div>
{% endblock content %}