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


{% block title %}
  {% if list_name %}
    {% if paginator.page > 1 %}
      {{ list_name }} ({% blocktrans with page=paginator.page %}page: {{ page }}{% endblocktrans %}) | {{ category }} | {{ block.super }}
    {% else %}
      {{ list_name }} | {{ category }} | {{ block.super }}
    {% endif %}
  {% elif paginator.page > 1 %}
    {{ category }} ({% blocktrans with page=paginator.page %}page: {{ page }}{% endblocktrans %}) | {{ block.super }}
  {% else %}
    {{ category }} | {{ block.super }}
  {% endif %}
{% endblock title %}


{% block meta-description %}
  {% if category.description %}
    {{ category.description }}
  {% endif %}
{% endblock meta-description %}


{% block og-title %}
  {{ category }}
{% endblock og-title %}


{% block og-description %}
  {% if category.description %}
    {{ category.description }}
  {% endif %}
{% endblock og-description %}


{% block og-url %}{{ SITE_ADDRESS }}{{ REQUEST_PATH }}{% endblock %}


{% block extra-css %}
  {% if category.css_class %}
    page-threads-{{ category.css_class }}
  {% endif %}
{% endblock extra-css %}


{% block page-header %}
<div class="page-header">
  <div class="container">
    <div class="row">
      <div class="{{ user.is_authenticated|yesno:'col-md-8,col-xs-12' }}">
        <div class="row">
          <div class="hidden-xs col-sm-2 col-lg-1">
            <a href="{{ category.parent.get_absolute_url }}{% if list_type != 'all' %}{{ list_type }}/{% endif %}" class="btn btn-default btn-icon btn-aligned btn-go-back btn-block btn-outline">
              <span class="material-icon">
                keyboard_arrow_left
              </span>
            </a>
          </div>
          <div class="col-xs-12 col-sm-10 col-lg-11 sm-align-row-buttons">
            <a href="{{ category.parent.get_absolute_url }}{% if list_type != 'all' %}{{ list_type }}/{% endif %}" class="go-back-sm visible-xs-block btn-outline">
              <span class="material-icon">
                chevron_left
              </span>
              {% if parent.parent %}{{ parent.name }}{% else %}{% trans "Threads" %}{% endif %}
            </a>
            <h1>{{ category }}</h1>
          </div>
        </div>
      </div>
    </div>
  </div>
  {% if user.is_authenticated %}
    {% include "misago/threadslist/tabs.html" %}
  {% endif %}
</div>
{% endblock page-header %}


{% block list-container %}
  {% if category.description %}
    <div class="category-description">
      <div class="page-lead {{ category.description|force_escape|linebreaks|isdescriptionshort|iftrue:"lead" }}">
        {{ category.description|force_escape|urlize|linebreaks|safe }}
      </div>
    </div>
  {% endif %}

  {{ block.super }}
{% endblock list-container%}