Dynamic object lists.
[wolnelektury.git] / src / catalogue / templates / catalogue / 2022 / book_list.html
1 {% extends '2022/base.html' %}
2 {% load catalogue_tags %}
3 {% load thumbnail %}
4 {% load pagination_tags %}
5
6 {% load choose_cites from social_tags %}
7
8
9 {% block breadcrumbs %}
10   <a href="/katalog/"><span>Katalog</span></a>
11   {% if main_tag %}
12     <a href="{{ main_tag.get_absolute_catalogue_url }}"><span>{{ main_tag.get_category_display|title }}</span></a>
13   {% endif %}
14 {% endblock %}
15
16 {% block main %}
17   <div class="l-section">
18     <div class="l-author__header">
19       {% if main_tag.photo %}
20         {% thumbnail main_tag.photo '40x40' crop='center' as th %}
21         <figure>
22           <img src="{{ th.url }}" alt="{{ main_tag.name }}">
23         </figure>
24         {% endthumbnail %}
25       {% endif %}
26       <h1>
27         {% if main_tag %}
28           {{ main_tag.name }}
29         {% else %}
30           {{ view.title }}
31         {% endif %}
32       </h1>
33     </div>
34   </div>
35
36   <div class="l-section">
37     <div class="l-books__header">
38       <div class="l-books__input">
39         <i class="icon icon-filter"></i>
40         <input type="text" placeholder="filtry, tytuł" class="quick-filter" data-for="book-list" data-filters="with-filter" value="{{ request.GET.search }}">
41         <div class="filter-container">
42           {% for tag in tags %}
43             {% if tag is not main_tag %}
44               <span class="filter filter-category-{{ tag.category }}">
45                 <a href="{% catalogue_url view.list_type tag %}">{{ tag }}</a>
46                 <a href="{% catalogue_url view.list_type tags -tag %}">✖</a>
47               </span>
48             {% endif %}
49           {% endfor %}
50         </div>
51
52       </div>
53       {% if view.get_orderings %}
54       <div class="l-books__sorting">
55         <span>Sortuj:</span>
56         <div>
57           {% for ordering in view.get_orderings %}
58             <button
59                 {% if not ordering.default %}
60                 data-order="{{ ordering.slug }}"
61                 {% endif %}
62                 {% if ordering.active %}
63                 class="is-active"
64                 {% endif %}
65             >{{ ordering.name }}</button>
66           {% endfor %}
67         </div>
68       </div>
69       {% endif %}
70     </div>
71   </div>
72   <div class="l-author with-filter">
73     <div class="row">
74       <h2>{% nice_title_from_tags tags suggested_tags_by_category %}</h2>
75       {% if suggested_tags %}
76         <div class="filter-container">
77           {% for tag in suggested_tags %}
78             <span class="filter filter-category-{{ tag.category }}">
79               <a href="{% catalogue_url view.list_type tags tag %}">{{ tag }}</a>
80             </span>
81           {% endfor %}
82         </div>
83       {% endif %}
84     </div>
85   </div>
86
87   {% autopaginate object_list view.page_size %}
88
89   <div class="l-section l-section--col">
90     <div class="l-books__grid" id="book-list">
91       {% for book in object_list %}
92         {% include "catalogue/2022/book_box.html" %}
93       {% endfor %}
94     </div>
95   </div>
96
97   <div id="paginator">
98     {% paginate using '2022/paginate.html' %}
99   </div>
100
101   {% if main_tag %}
102     <section class="l-section">
103       <div class="l-author">
104         {% with tag=main_tag %}
105           {% include 'catalogue/2022/author_box.html' %}
106         {% endwith %}
107         {% choose_cites 3 author=main_tag as cites %}
108         {% if cites %}
109           <div class="row">
110             <div class="l-author__quotes">
111               <div class="l-author__quotes__slider">
112
113                 {% for fragment in cites %}
114                   <div class="l-author__quotes__slider__item">
115                     {% include "catalogue/2022/fragment_slider_box.html" %}
116                   </div>
117                 {% endfor %}
118
119               </div>
120             </div>
121           </div>
122         {% endif %}
123       </div>
124     </section>
125     {% endif %}
126 {% endblock %}