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