{% extends 'base.html' %}
{% load i18n %}
{% load catalogue_tags %}
{% load pagination_tags %}

{% block global-content %}
  <div class="l-container">
    <div class="l-breadcrumb">
      <a href="/"><span>{% trans "Strona główna" %}</span></a>
      <a href="/katalog/"><span>{% trans "Katalog" %}</span></a>
      <a href="/katalog/motyw/"><span>{% trans "Motyw" %}</span></a>
      <span>{{ main_tag.name }}</span>
    </div>
  </div>

  <main class="l-main">

    <div class="l-section">
      <div class="l-author__header">
        <span data-edit="catalogue/tag/{{ main_tag.id }}"></span>
        <h1><span>{% trans "Motyw" %}:</span> {{ main_tag.name }}</h1>
      </div>
    </div>


    <div class="l-section">
      <div class="l-books__header">
        <div class="l-books__input">
          <i class="icon icon-filter"></i>
          <input type="text" placeholder="{% trans 'filtry, tytuł' %}" class="quick-filter" data-for="book-list" data-filters="with-filter" value="{{ request.GET.search }}">
          <div class="filter-container">
            {% for tag in tags %}
              {% if tag is not main_tag %}
                <span class="filter filter-category-{{ tag.category }}">
                  <a href="{% catalogue_url view.list_type tag %}">{{ tag }}</a>
                  <a href="{% catalogue_url view.list_type tags -tag %}">✖</a>
                </span>
              {% endif %}
            {% endfor %}
          </div>

        </div>
      </div>
    </div>
    <div class="with-filter">
      <div class="row">
        <h2 class="header">{% nice_title_from_tags tags categories %}</h2>
        {% if suggested_tags %}
          <div class="filter-container">
            {% for tag in suggested_tags %}
              <span class="filter filter-category-{{ tag.category }}">
                <a href="{% catalogue_url view.list_type tags tag %}">{{ tag }}</a>
              </span>
            {% endfor %}
          </div>
        {% endif %}
      </div>
    </div>

    {% autopaginate object_list view.themed_page_size %}

    <div class="l-section l-section--col">
      <div class="l-theme">
        <div class="l-theme__col">
          <div class="l-books__col" id="book-list">
            {% for fragment in object_list %}
              {% include 'catalogue/fragment_box.html' %}
            {% endfor %}
          </div>
        </div>
        <div class="l-theme__col">
          <div class="l-theme__info">
            <h3>{% trans "Motyw" %}: {{ main_tag.name }}</h3>
            {{ main_tag.description|safe }}
            <!--
                 <h3>Motyw w sztuce <i class="icon icon-arrow-left"></i> <i class="icon icon-arrow-right"></i></h3>
                 <div class="l-theme__info__slider">
                 <img src="images/motyw.jpg" alt="">
                 <img src="images/motyw.jpg" alt="">
                 <img src="images/motyw.jpg" alt="">
                 </div>
            -->
          </div>
        </div>
      </div>
      <div id="paginator">
        {% paginate %}
      </div>
    </div>
  </main>

{% endblock %}
