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