Update picture viewer.
[wolnelektury.git] / apps / catalogue / templates / catalogue / book_short.html
1 {% load i18n %}
2 {% load catalogue_tags social_tags %}
3 {% load thumbnail %}
4 <div class="{% block box-class %}book-box{% endblock %}">
5 <div class="book-box-inner">
6 <div class="book-left-column">
7
8
9
10
11 <div class="book-box-body">
12
13
14 <div class="star {% if not request.user|likes:book %}un{% endif %}like">
15     <div class="if-like" >
16         <a id="social-book-sets-{{ book.slug }}" data-callback='social-book-sets' class='ajaxable' href='{% url "social_book_sets" book.slug %}'>
17             ★
18         </a>
19     </div>
20     <div class="if-unlike">
21         <form id="social-like-book-{{ book.slug }}" data-callback='social-like-book' method='post' class='ajax-form' action='{% url "social_like_book" book.slug %}'>
22             {% csrf_token %}
23             <button type='submit'>☆</button>
24         </form>
25     </div>
26 </div>
27
28
29         <div class="book-box-head">
30             <div class="author">
31                 {% for tag in related.tags.author %}
32                     <a href="{% tag_url 'author' tag.slug %}">{% related_tag_name tag %}</a>{% if not forloop.last %},
33                 {% endif %}{% endfor %}{% for title, slug in related.parents %},
34                     <a href="{% url 'book_detail' slug %}">{{ title }}</a>{% endfor %}
35             </div>
36             <div class="title">
37                                 {% if main_link %}<a href="{{ main_link }}">{% endif %}
38                                         {{ book.title }}
39                             {% if main_link %}</a>{% endif %}
40                         </div>
41         </div>
42
43 <div class="cover-area">
44     {% if book.cover %}
45         {% if main_link %}<a href="{{ main_link }}">{% endif %}
46             <img src="
47                 {% thumbnail book.cover "139x193" as thumb %}
48                     {{ thumb.url }}
49                 {% empty %}
50                     {{ book.cover.url }}
51                 {% endthumbnail %}
52             " alt="Cover" class="cover" />
53         {% if main_link %}</a>{% endif %}
54     {% endif %}
55     {% block cover-area-extra %}{% endblock %}
56 </div>
57         <div class="tags">
58                 {% spaceless %}
59
60             <span class="category">
61             <span class="mono"> {% trans "Epoch" %}:</span>&nbsp;<span class="book-box-tag">
62                 {% for tag in related.tags.epoch %}
63                         <a href="{% tag_url 'epoch' tag.slug %}">{% related_tag_name tag %}</a>
64                         {% if not forloop.last %}<span>, </span>{% endif %}
65                 {% endfor %}
66             </span></span>
67
68             <span class="category">
69             <span class="mono"> {% trans "Kind" %}:</span>&nbsp;<span class="book-box-tag">
70                 {% for tag in related.tags.kind %}
71                         <a href="{% tag_url 'kind' tag.slug %}">{% related_tag_name tag %}</a>
72                         {% if not forloop.last %}<span>, </span>{% endif %}
73                 {% endfor %}
74             </span></span>
75
76             <span class="category">
77             <span class="mono"> {% trans "Genre" %}:</span>&nbsp;<span class="book-box-tag">
78                 {% for tag in related.tags.genre %}
79                         <a href="{% tag_url 'genre' tag.slug %}">{% related_tag_name tag %}</a>
80                         {% if not forloop.last %}<span>, </span>{% endif %}
81                 {% endfor %}
82             </span></span>
83
84             {% if show_lang %}
85             <span class="category">
86             <span class="mono"> {% trans "Language" %}:</span>&nbsp;<span class="book-box-tag">
87                 <a>{{ book.language_name }}</a>
88             </span></span>
89             {% endif %}
90
91            {% endspaceless %}
92         </div>
93     </div>
94     {% shelf_tags book %}
95
96     <ul class="book-box-tools">
97         <li class="book-box-read">
98         {% if book.html_file %}
99             <a href="{% url 'book_text' book.slug %}" class="downarrow">{% trans "Read online" %}</a>
100         {% endif %}
101         </li>
102         <li class="book-box-download hoverget">
103             <a class="downarrow hoverclick">{% trans "Download" %}</a>
104             <div class="book-box-formats">
105               {% if book.pdf_file %}
106               <span><a href="{{ book.pdf_file.url}}">PDF</a> {% trans "to print" %}</span>
107               {% endif %}
108               {% if  book.epub_file %}
109               <span><a href="{{ book.epub_file.url}}">EPUB</a> {% trans "for an e-book reader" %}</span>
110               {% endif %}
111               {% if  book.mobi_file %}
112               <span><a href="{{ book.mobi_file.url}}">MOBI</a> {% trans "for Kindle" %}</span>
113               {% endif %}
114               {% if  book.fb2_file %}
115               <span><a href="{{ book.fb2_file.url}}">FB2</a> {% trans "FictionBook" %}</span>
116               {% endif %}
117               {% if  book.txt_file %}
118               <span><a href="{{ book.txt_file.url}}">TXT</a> {% trans "for advanced usage" %}</span>
119               {% endif %}
120             </div>
121         </li>
122         <li class="book-box-audiobook">
123         {% if related.media.mp3 or related.media.ogg %}
124             <a href="{% url 'book_player' book.slug %}" class="open-player downarrow">{% trans "Listen" %}</a>
125         {% endif %}
126         </li>
127     </ul>
128     {% block book-box-extra-info %}{% endblock %}
129     {% block box-append %}
130     {% endblock %}
131     </div>
132     {% block right-column %}
133     {% endblock %}
134     <div class="clearboth"></div>
135 </div>
136 </div>