csrf and honeypots
[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     {% if main_link %}<a href="{{ main_link }}">{% endif %}
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     {% if main_link %}</a>{% endif %}
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             {% csrf_token %}
31             <button type='submit'>☆</button>
32         </form>
33     </div>
34 </div>
35
36
37         <div class="book-box-head">
38             <div class="mono author">
39                 {% for name, slug in related.tags.author %}
40                     <a href="{% tag_url 'author' slug %}">{{ name }}</a>{% if not forloop.last %},
41                 {% endif %}{% endfor %}{% for title, slug in related.parents %},
42                     <a href="{% url book_detail slug %}">{{ title }}</a>{% endfor %}
43             </div>
44             <div class="title">
45                                 {% if main_link %}<a href="{{ main_link }}">{% endif %}
46                                         {{ book.title }}
47                             {% if main_link %}</a>{% endif %}
48                         </div>
49         </div>
50
51         <div class="tags">
52                 {% spaceless %}
53
54             <span class="mono"> {% trans "Epoch" %}:</span>&nbsp;<span class="book-box-tag">
55                 {% for name, slug in related.tags.epoch %}
56                         <a href="{% tag_url 'epoch' slug %}">{{ name }}</a>
57                         {% if not forloop.last %}<span>,&nbsp;</span>{% endif %}
58                 {% endfor %}
59             </span>
60
61             <span class="mono"> {% trans "Kind" %}:</span>&nbsp;<span class="book-box-tag">
62                 {% for name, slug in related.tags.kind %}
63                         <a href="{% tag_url 'kind' slug %}">{{ name }}</a>
64                         {% if not forloop.last %}<span>,&nbsp;</span>{% endif %}
65                 {% endfor %}
66             </span>
67
68             <span class="mono"> {% trans "Genre" %}:</span>&nbsp;<span class="book-box-tag">
69                 {% for name, slug in related.tags.genre %}
70                         <a href="{% tag_url 'genre' slug %}">{{ name }}</a>
71                         {% if not forloop.last %}<span>,&nbsp;</span>{% endif %}
72                 {% endfor %}
73             </span>
74
75            {% endspaceless %}
76         </div>
77     </div>
78     {% shelf_tags book %}
79
80     <ul class="book-box-tools">
81         <li class="book-box-read">
82         {% if book.html_file %}
83             <a href="{% url book_text book.slug %}" class="mono downarrow">{% trans "Read online" %}</a>
84         {% endif %}
85         </li>
86         <li class="book-box-download hoverget">
87             <a class="mono downarrow hoverclick">{% trans "Download" %}</a>
88             <div class="book-box-formats mono">
89               {% if book.pdf_file %}
90               <span><a href="{{ book.pdf_file.url}}">PDF</a> {% trans "to print" %}</span>
91               {% endif %}
92               {% if  book.epub_file %}
93               <span><a href="{{ book.epub_file.url}}">EPUB</a> {% trans "for an e-book reader" %}</span>
94               {% endif %}
95               {% if  book.mobi_file %}
96               <span><a href="{{ book.mobi_file.url}}">MOBI</a> {% trans "for Kindle" %}</span>
97               {% endif %}
98               {% if  book.txt_file %}
99               <span><a href="{{ book.txt_file.url}}">TXT</a> {% trans "for advanced usage" %}</span>
100               {% endif %}
101             </div>
102         </li>
103         <li class="book-box-audiobook">
104         {% if related.media.mp3 or related.media.ogg %}
105             <a href="{% url book_player book.slug %}" class="open-player mono downarrow">{% trans "Listen" %}</a>
106         {% endif %}
107         </li>
108     </ul>
109     {% block book-box-extra-info %}{% endblock %}
110     {% block box-append %}
111     {% endblock %}
112     {% block right-column %}
113     {% endblock %}
114     <div class="clearboth"></div>
115 </div>
116 </div>