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