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


{% block settings %}
  {% load title %}
  {% trans 'Półka' as title %}
  {% title title %}
{% endblock %}

{% block main %}
{% for list in favs %}
  <div class="l-section">
    <div class="l-author__header">
      <h1>{% trans "Ulubione" %}</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-l{{ list.id }}" data-filters="with-filter">
      </div>
    </div>
  </div>
  <div class="l-section l-section--col">
    <div class="l-books__grid" id="book-list-l{{ list.id }}">
      {% for item in list.userlistitem_set.all %}
      {% with book=item.book %}
      {% if book %}
      {% include "catalogue/book_box.html" %}
      {% endif %}
      {% endwith %}
      {% endfor %}
    </div>
  </div>
{% endfor %}


{% for list in others %}
  <div class="l-section" style="margin-top:60px;">
    <div class="l-author__header">
      <h1>{{ list.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-l{{ list.id }}" data-filters="with-filter">
      </div>
    </div>
  </div>
  <div class="l-section l-section--col">
    <div class="l-books__grid" id="book-list-l{{ list.id }}">
      {% for item in list.userlistitem_set.all %}
      {% with book=item.book %}
      {% if book %}
      {% include "catalogue/book_box.html" %}
      {% endif %}
      {% endwith %}
      {% endfor %}
    </div>
  </div>
{% endfor %}

{% endblock %}
