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