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