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