0b33f23a7590404fc8cfe8ac70c42162e48483c8
[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   <div class="{% block box-class %}book-box{% if audiobooks %} audiobook-box{% endif %}{% endblock %}">
8     <div class="book-box-inner">
9
10     {% block book-box-pre %}
11       {% include "catalogue/snippets/like_button.html" %}
12     {% endblock %}
13
14     <div class="book-left-column">
15       <div class="book-box-body">
16         {% block book-box-body-pre %}
17         {% endblock %}
18
19         <div class="book-box-head">
20           <div class="author">
21             {% for tag in tags.author %}
22               <a href="{{ tag.get_absolute_url }}">{{ tag.name }}</a>{% if not forloop.last %},
23             {% endif %}{% endfor %}{% for parent in parents %},
24               <a href="{{ parent.get_absolute_url }}">{{ parent.title }}</a>{% endfor %}
25           </div>
26           <div class="title">
27             {% if main_link %}<a href="{{ main_link }}">{% endif %}{{ book.title }}{% if main_link %}</a>{% endif %}
28           </div>
29           {% if book.translator %}
30               <div class="author">
31                   tłum. {{ book.translator }}
32               </div>
33           {% endif %}
34         </div>
35
36         <div class="cover-area">
37           {% if book.cover_thumb %}
38             {% if main_link %}<a href="{{ main_link }}">{% endif %}
39               <img src="{{ book.cover_thumb.url }}" alt="Cover" class="cover" />
40             {% if main_link %}</a>{% endif %}
41           {% endif %}
42           {% block cover-area-extra %}{% endblock %}
43         </div>
44
45         <div class="tags">
46           <span class="category">
47           <span class="mono"> {% trans "Epoch" %}:</span>&nbsp;<span class="book-box-tag">
48             {% for tag in tags.epoch %}
49               <a href="{{ tag.get_absolute_url }}">{{ tag.name }}</a>
50               {% if not forloop.last %}<span>, </span>{% endif %}
51             {% endfor %}
52           </span></span>
53
54           <span class="category">
55           <span class="mono"> {% trans "Kind" %}:</span>&nbsp;<span class="book-box-tag">
56             {% for tag in tags.kind %}
57               <a href="{{ tag.get_absolute_url }}">{{ tag.name }}</a>
58               {% if not forloop.last %}<span>, </span>{% endif %}
59             {% endfor %}
60           </span></span>
61
62           <span class="category">
63           <span class="mono"> {% trans "Genre" %}:</span>&nbsp;<span class="book-box-tag">
64             {% for tag in tags.genre %}
65               <a href="{{ tag.get_absolute_url }}">{{ tag.name }}</a>
66               {% if not forloop.last %}<span>, </span>{% endif %}
67             {% endfor %}
68           </span></span>
69
70           {% if show_lang %}
71             <span class="category">
72               <span class="mono"> {% trans "Language" %}:</span>&nbsp;<span class="book-box-tag">
73                 <a>{{ book.language_name }}</a>
74               </span>
75             </span>
76           {% endif %}
77
78           {% if stage_note %}
79             <br>
80             <span class="category">
81               <a{% if stage_note_url %} href="{{ stage_note_url }}"{% endif %}>{{ stage_note }}</a>
82             </span>
83           {% endif %}
84         </div>
85       </div>
86       {% book_shelf_tags book.pk %}
87
88       <ul class="book-box-tools">
89         <li class="book-box-read">
90           {% if book.html_file %}
91             <a href="{% url 'book_text' book.slug %}" class="downarrow">{% trans "Read online" %}</a>
92           {% endif %}
93           {% if book.print_on_demand %}
94             <a href="{{ book.ridero_link }}" class="downarrow print">{% trans "Print on demand –" %}
95                 <img src="{% static 'img/ridero.png' %}" style="height: 0.8em;"/></a>
96           {% endif %}
97         </li>
98         <li class="book-box-download">
99           <a class="downarrow">{% trans "Download" %}:</a>
100           <div class="book-box-formats">
101             {% if book.pdf_file %}
102               <span><a href="{{ book.pdf_file.url}}">PDF</a></span>
103             {% endif %}
104             {% custom_pdf_link_li book %}
105             {% if book.epub_file %}
106               <span><a href="{{ book.epub_file.url}}">EPUB</a></span>
107             {% endif %}
108             {% if book.mobi_file %}
109               <span><a href="{{ book.mobi_file.url}}">MOBI</a></span>
110             {% endif %}
111             {% if  book.fb2_file %}
112               <span><a href="{{ book.fb2_file.url}}">FB2</a></span>
113             {% endif %}
114             {% if  book.txt_file %}
115               <span><a href="{{ book.txt_file.url}}">TXT</a></span>
116             {% endif %}
117             {% download_audio book %}
118           </div>
119         </li>
120       </ul>
121       {% block book-box-extra-info %}{% endblock %}
122       {% block box-append %}
123       {% endblock %}
124     </div>
125
126     {% block right-column %}
127       {% if audiobooks %}
128         <div class="audiobook-right-column">
129           {% include 'catalogue/snippets/jplayer.html' %}
130         </div>
131       {% endif %}
132     {% endblock %}
133
134     <div class="clearboth"></div>
135     </div>
136   </div>
137 {% endspaceless %}