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