Merge branch 'pretty' of github.com:fnp/wolnelektury into pretty
[wolnelektury.git] / wolnelektury / templates / catalogue / book_short.html
1 {% load i18n %}
2 {% load social_tags %}
3 {% load thumbnail %}
4 <div class="{% block box-class %}book-box{% endblock %}">
5 <div class="book-box-inner" style="position: relative;">
6
7
8     <a href="{{ book.get_absolute_url }}">
9         {% if book.cover %}
10             <img src="
11                 {% thumbnail book.cover "216x288" as thumb %}
12                     {{ thumb.url }}
13                 {% empty %}
14                     {{ book.cover.url }}
15                 {% endthumbnail %}
16             " alt="Cover" />
17         {% endif %}
18     </a>
19     {% block right-column %}
20     {% endblock %}
21     <div class="book-box-body">
22
23
24 <div class="star {% if not request.user|likes:book %}un{% endif %}like">
25     <div class="if-like" >
26         <a id="social-book-sets-{{ book.slug }}" data-callback='social-book-sets' class='ajaxable' href='{% url social_book_sets book.slug %}'>
27             ★
28         </a>
29     </div>
30     <div class="if-unlike">
31         <form id="social-like-book-{{ book.slug }}" data-callback='social-like-book' method='post' class='ajax-form' action='{% url social_like_book book.slug %}'>
32             <button type='submit'>☆</button>
33         </form>
34     </div>
35 </div>
36
37
38         <div class="book-box-head">
39             <div class="mono author">
40                 {% for name, url in related.tags.author %}
41                     {{ name }}{% if not forloop.last %}, {% endif %}
42                 {% endfor %}
43             </div>
44             <div class="title">{{ book.title }}</div>
45         </div>
46         <div class="tags">
47             {% spaceless %}
48
49             <span class="mono">{% trans "Epoch" %}:</span>&nbsp;<span class="book-box-tag">
50                 {% for name, url in related.tags.epoch %}
51                     <a href="{{ url }}">{{ name }} </a>
52                 {% endfor %}
53             </span>
54
55             <span class="mono">{% trans "Kind" %}:</span>&nbsp;<span class="book-box-tag">
56                 {% for name, url in related.tags.kind %}
57                     <a href="{{ url }}">{{ name }} </a>
58                 {% endfor %}
59             </span>
60
61             <span class="mono">{% trans "Genre" %}:</span>&nbsp;<span class="book-box-tag">
62                 {% for name, url in related.tags.genre %}
63                     <a href="{{ url }}">{{ name }} </a>
64                 {% endfor %}
65             </span>
66
67             {% endspaceless %}
68         </div>
69     </div>
70     <ul class="book-box-tools">
71         <li class="book-box-read">
72         {% if book.html_file %}
73             <a href="{% url book_text book.slug %}" class="mono downarrow">{% trans "Read online" %}</a>
74         {% endif %}
75         </li>
76         <li class="book-box-download">
77             <a class="mono downarrow">{% trans "Download" %}</a>
78             <div class="book-box-formats mono">
79               {% if formats.pdf %}
80               <span><a href="{{formats.pdf.url}}">PDF</a> do wydruku</span>
81               {% endif %}
82               {% if formats.epub %}
83               <span><a href="{{formats.epub.url}}">EPUB</a> na czytnik</span>
84               {% endif %}
85               {% if formats.mobi %}
86               <span><a href="{{formats.mobi.url}}">MOBI</a> na Kindle</span>
87               {% endif %}
88               {% if formats.txt %}
89               <span><a href="{{formats.txt.url}}">TXT</a> do zadań specjalnych</span>
90               {% endif %}
91             </div>
92         </li>
93         <li class="book-box-audiobook">
94         {% if related.media.mp3 or related.media.ogg %}
95             <a href="{% url book_player book.slug %}" class="open-player mono downarrow">{% trans "Listen" %}</a>
96         {% endif %}
97         </li>
98     </ul>
99     {% block box-append %}
100     {% endblock %}
101 </div>
102 </div>