8aabcd55eca96b33bab3d225f625def9c89514c5
[wolnelektury.git] / src / catalogue / templates / catalogue / 2022 / book_box.html
1 {% load sorl_thumbnail %}
2
3 <article class="l-books__item book-container-activator" data-pop="-{{ book.popularity.count }}" data-longpress="hover">
4   <figure class="l-books__item__img book-container book-container-{{ book.pk }}" data-book="{{ book.pk }}">
5     <a href="{{ book.get_absolute_url }}">
6       {% if book.is_picture %}
7         {% if book.image_file %}
8           {% thumbnail book.image_file "170x240" crop="center" as im %}
9           <img style="float: left; margin:{{ im|margin:"170x240" }}" src="{{ im.url }}" width="{{ im.x }}" height="{{ im.y }}" />
10           {% endthumbnail %}
11         {% endif %}
12       {% else %}
13         {% if book.cover_clean %}
14           <img src="{{ book.cover_clean.url }}" alt="{{ book.title }}">
15         {% endif %}
16       {% endif %}
17     </a>
18
19     <div class="set-tools">
20       <div class="sets"></div>
21       <form method="post" action="{% url 'social_add_set_tag' %}" class="add-set-tag">
22         {% csrf_token %} {# this needs to be copied in with JS #}
23         <input type="hidden" name="book" value="{{ book.id }}">
24         <input name="name" placeholder="nazwa półki" />
25         <button type="submit"></button>
26       </form>
27     </div>
28
29   </figure>
30   <div class="l-books__item__actions">
31     {% if book.is_book %}
32       <span class="icon icon-book-alt" title="książka"></span>
33     {% endif %}
34     {% if book.has_mp3_file %}
35       <span class="icon icon-audio" title="audiobook"></span>
36     {% endif %}
37     {% if book.is_picture %}
38       <span class="icon icon-picture" title="obraz"></span>
39     {% endif %}
40     <a href="{{ book.get_absolute_url }}" class="icon icon-like" data-book="{{ book.pk }}" data-book-slug="{{ book.slug }}"></a>
41   </div>
42   <h3 class="s">
43     {% for author in book.authors %}
44       <a href="{{ author.get_absolute_url }}">{{ author }}</a>{% if not forloop.last %}, {% endif %}
45     {% endfor %}
46   </h3>
47   <h2 class="s"><a href="{{ book.get_absolute_url }}">{{ book.title }}</a></h2>
48   <span class="other-info s">
49     {% for kind in book.kinds %}{{ kind }} {% endfor %}
50     {% for genre in book.genres %}{{ genre }} {% endfor %}
51     {% for epoch in book.epochs %}{{ epoch }} {% endfor %}
52   </span>
53 </article>