58859af3854db496411900b2ae888654c9e6923d
[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 tags.author %}
31                     <a href="{{ tag.get_absolute_url }}">{{ tag.name }}</a>{% if not forloop.last %},
32                 {% endif %}{% endfor %}{% for parent in parents %},
33                     <a href="{{ parent.get_absolute_url }}">{{ parent.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_thumb %}
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 tags.epoch %}
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 "Kind" %}:</span>&nbsp;<span class="book-box-tag">
64                 {% for tag in tags.kind %}
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             <span class="category">
71             <span class="mono"> {% trans "Genre" %}:</span>&nbsp;<span class="book-box-tag">
72                 {% for tag in tags.genre %}
73                     <a href="{{ tag.get_absolute_url }}">{{ tag.name }}</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             {% if stage_note %}
86             <br><span class="category">
87                 <a{% if stage_note_url %} href="{{ stage_note_url }}"{% endif %}>{{ stage_note }}</a>
88             </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 has_audio %}
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>