b2a912f1a47995e31a4a42e1e6de2d0fdbd381e6
[wolnelektury.git] / src / catalogue / templates / catalogue / book_short.html
1 {% spaceless %}
2   {% load i18n %}
3   {% load catalogue_tags %}
4   {% load book_shelf_tags from social_tags %}
5   {% load static %}
6
7   {% with ga=book.get_audiobooks %}
8   {% with audiobooks=ga.0 %}
9   <div class="{% block box-class %}book-box{% if audiobooks %} audiobook-box{% endif %}{% endblock %}">
10     <div class="book-box-inner">
11
12     {% block book-box-pre %}
13       {% include "catalogue/snippets/like_button.html" %}
14     {% endblock %}
15
16     {% with book.tags_by_category as tags %}
17     <div class="book-left-column">
18       <div class="book-box-body">
19         {% block book-box-body-pre %}
20         {% endblock %}
21
22         <div class="book-box-head">
23           <div class="author">
24             {% for tag in tags.author %}
25               <a href="{{ tag.get_absolute_url }}">{{ tag.name }}</a>{% if not forloop.last %},
26             {% endif %}{% endfor %}{% for parent in book.parents %},
27               <a href="{{ parent.get_absolute_url }}">{{ parent.title }}</a>{% endfor %}
28           </div>
29           <div class="title">
30             <a href="{{ book.get_absolute_url }}">{{ book.title }}</a>
31           </div>
32           {% if book.translator %}
33               <div class="author">
34                   tłum. {{ book.translator }}
35               </div>
36           {% endif %}
37         </div>
38
39         <div class="cover-area">
40           {% if book.cover_thumb %}
41             <a href="{{ book.get_absolute_url }}">
42               <img src="{{ book.cover_thumb.url }}" alt="Cover" class="cover" />
43             </a>
44           {% endif %}
45           {% block cover-area-extra %}{% endblock %}
46         </div>
47
48         <div class="tags">
49           <span class="category">
50           <span class="mono"> {% trans "Epoch" %}:</span>&nbsp;<span class="book-box-tag">
51             {% for tag in tags.epoch %}
52               <a href="{{ tag.get_absolute_url }}">{{ tag.name }}</a>
53               {% if not forloop.last %}<span>, </span>{% endif %}
54             {% endfor %}
55           </span></span>
56
57           <span class="category">
58           <span class="mono"> {% trans "Kind" %}:</span>&nbsp;<span class="book-box-tag">
59             {% for tag in tags.kind %}
60               <a href="{{ tag.get_absolute_url }}">{{ tag.name }}</a>
61               {% if not forloop.last %}<span>, </span>{% endif %}
62             {% endfor %}
63           </span></span>
64
65           <span class="category">
66           <span class="mono"> {% trans "Genre" %}:</span>&nbsp;<span class="book-box-tag">
67             {% for tag in tags.genre %}
68               <a href="{{ tag.get_absolute_url }}">{{ tag.name }}</a>
69               {% if not forloop.last %}<span>, </span>{% endif %}
70             {% endfor %}
71           </span></span>
72
73           {% if book.extra_info.location %}
74             <span class="category">
75             <span class="mono"> {% trans "Region" %}:</span>&nbsp;<span class="book-box-tag">
76                 {{ book.extra_info.location }}
77             </span></span>
78           {% endif %}
79
80           {% if book.is_foreign %}
81             <span class="category">
82               <span class="mono"> {% trans "Language" %}:</span>&nbsp;<span class="book-box-tag">
83                 <a>{{ book.language_name }}</a>
84               </span>
85             </span>
86           {% endif %}
87
88           {% with stage_note=book.stage_note %}
89           {% if stage_note.0 %}
90             <br>
91             <span class="category">
92               <a{% if stage_note.1 %} href="{{ stage_note.1 }}"{% endif %}>{{ stage_note.0 }}</a>
93             </span>
94           {% endif %}
95           {% endwith %}
96         </div>
97       </div>
98       {% book_shelf_tags book.pk %}
99
100       <ul class="book-box-tools">
101         <li class="book-box-read">
102           {% if book.html_file %}
103             <a href="{% url 'book_text' book.slug %}" class="downarrow">{% trans "Read online" %}</a>
104           {% endif %}
105           {% if book.print_on_demand %}
106             <a href="{{ book.ridero_link }}" class="downarrow print tlite-tooltip" title="{% trans "Cena książki w druku cyfrowym jest zależna od liczby stron.<br>Przed zakupem upewnij się, że cena druku na żądanie jest dla Ciebie odpowiednia.<br>Wszystkie nasze zasoby w wersji elektronicznej są zawsze dostępne bezpłatnie." %}">{% trans "Print on demand –" %}
107                 <img src="{% static 'img/ridero.png' %}" style="height: 0.8em;"/></a>
108           {% endif %}
109         </li>
110         <li class="book-box-download">
111           <a class="downarrow">{% trans "Download" %}:</a>
112           <div class="book-box-formats">
113             {% if book.pdf_file %}
114               <span><a href="{{ book.pdf_file.url}}">PDF</a></span>
115             {% endif %}
116             {% if book.epub_file %}
117               <span><a href="{{ book.epub_file.url}}">EPUB</a></span>
118             {% endif %}
119             {% if book.mobi_file %}
120               <span><a href="{{ book.mobi_file.url}}">MOBI</a></span>
121             {% endif %}
122             {% if book.has_audio %}
123               <span><a href="{% url 'download_zip_mp3' book.slug %}">MP3</a></span>
124             {% endif %}
125             <a class="read-more-show hide" href="#">{% trans "more" %}</a>
126             <span class="read-more-content">
127               {% if  book.fb2_file %}
128                 <span><a href="{{ book.fb2_file.url}}">FB2</a></span>
129               {% endif %}
130               {% if  book.txt_file %}
131                 <span><a href="{{ book.txt_file.url}}">TXT</a></span>
132               {% endif %}
133               {% download_audio book mp3=False %}
134               <br>
135               {% custom_pdf_link_li book %}
136               <a class="read-more-hide hide" href="#">{% trans "less" %}</a>
137             </span>
138           </div>
139         </li>
140       </ul>
141       <div class="clearboth"></div>
142       {% if book.abstract %}
143         <div class="abstract more">
144           {{ book.abstract|safe }}
145         </div>
146       {% endif %}
147       {% block book-box-extra-info %}{% endblock %}
148       {% block box-append %}
149       {% endblock %}
150     </div>
151     {% endwith %}
152
153     {% block right-column %}
154       {% if audiobooks %}
155         <div class="book-right-column">
156           {% include 'catalogue/snippets/jplayer.html' %}
157         </div>
158       {% endif %}
159     {% endblock %}
160
161     <div class="clearboth"></div>
162     </div>
163   </div>
164   {% endwith %}
165   {% endwith %}
166 {% endspaceless %}