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