4acefe285adbb3a2ca4cf9bb4dc54ae61965bef0
[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            {% endspaceless %}
85         </div>
86     </div>
87     {% shelf_tags book %}
88
89     <ul class="book-box-tools">
90         <li class="book-box-read">
91         {% if book.html_file %}
92             <a href="{% url 'book_text' book.slug %}" class="downarrow">{% trans "Read online" %}</a>
93         {% endif %}
94         </li>
95         <li class="book-box-download hoverget">
96             <a class="downarrow hoverclick">{% trans "Download" %}</a>
97             <div class="book-box-formats">
98               {% if book.pdf_file %}
99               <span><a href="{{ book.pdf_file.url}}">PDF</a> {% trans "to print" %}</span>
100               {% endif %}
101               {% if  book.epub_file %}
102               <span><a href="{{ book.epub_file.url}}">EPUB</a> {% trans "for an e-book reader" %}</span>
103               {% endif %}
104               {% if  book.mobi_file %}
105               <span><a href="{{ book.mobi_file.url}}">MOBI</a> {% trans "for Kindle" %}</span>
106               {% endif %}
107               {% if  book.fb2_file %}
108               <span><a href="{{ book.fb2_file.url}}">FB2</a> {% trans "FictionBook" %}</span>
109               {% endif %}
110               {% if  book.txt_file %}
111               <span><a href="{{ book.txt_file.url}}">TXT</a> {% trans "for advanced usage" %}</span>
112               {% endif %}
113             </div>
114         </li>
115         <li class="book-box-audiobook">
116         {% if related.media.mp3 or related.media.ogg %}
117             <a href="{% url 'book_player' book.slug %}" class="open-player downarrow">{% trans "Listen" %}</a>
118         {% endif %}
119         </li>
120     </ul>
121     {% block book-box-extra-info %}{% endblock %}
122     {% block box-append %}
123     {% endblock %}
124     </div>
125     {% block right-column %}
126     {% endblock %}
127     <div class="clearboth"></div>
128 </div>
129 </div>