Uncrazy the caching, part 1.
[wolnelektury.git] / src / catalogue / templates / catalogue / book_detail.html
1 {% extends "base/base.html" %}
2 {% load i18n %}
3 {% load common_tags catalogue_tags %}
4 {% load build_absolute_uri from fnp_common %}
5 {% load cache %}
6
7 {% block titleextra %}{{ book.pretty_title }}{% endblock %}
8 {% block ogimage %}{% if book.cover %}{{ book.cover.url|build_absolute_uri:request }}{% endif %}{% endblock %}
9
10 {% block metadescription %}{% book_title book %}. {{ block.super }}{% endblock %}
11
12 {% block bodyid %}book-detail{% endblock %}
13
14 {% block extrahead %}
15 {{ block.super }}
16 {% if request.path == '/katalog/lektura/pan-tadeusz/' %}
17 {% include "hotjar.html" %}
18 {% endif %}
19 {% endblock %}
20
21
22 {% block body %}
23   {% include 'catalogue/book_wide.html' %}
24
25   {% work_list book_children %}
26
27   {% spaceless %}
28     {% if book.other_versions %}
29       <section class="see-also">
30         <h1>{% trans "Other versions" %}:</h1>
31         {% for rel in book.other_versions %}
32           {% cache 86400 book_mini_box rel.pk %}
33             {% include 'catalogue/book_mini_box.html' with book=rel %}
34           {% endcache %}
35         {% endfor %}
36       </section>
37     {% endif %}
38
39     <section class="see-also">
40       <h2>{% trans "See also" %}:</h2>
41       {% related_books book taken=book.other_versions|length %}
42     </section>
43   {% endspaceless %}
44
45   {% with book.related_themes as themes %}
46     {% if themes %}
47       <h2>{% trans "Themes" %}</h2>
48       {% plain_list themes book=book %}
49     {% endif %}
50   {% endwith %}
51
52
53   <h2>{% trans "Information about the work" %}</h2>
54   {% for author in book.authors %}
55     <div class="white-box">
56       <a style="display:block" href="{{ author.get_absolute_url }}">
57         {% cache 86400 catalogue_tag_box rel.pk %}
58           {% include 'catalogue/tag_box.html' with tag=author %}
59         {% endcache %}
60       </a>
61     </div>
62   {% endfor %}
63
64
65   {% if extra_info.source_url %}
66     <div class="white-box">
67       <a href="{{ extra_info.source_url }}">{% trans "Source" %}</a> {% trans "of the book" %}
68       {% trans "in" %} {% source_name extra_info.source_url %}
69     </div>
70   {% endif %}
71   {% if book|status:user != 'closed' %}
72     <div class="white-box"><a href="{{ book.xml_url }}">{% trans "Source XML file" %}</a></div>
73   {% endif %}
74   {% if extra_info.about and not hide_about %}
75     <div class="white-box">
76       {% trans "Book on" %} <a href="{{ extra_info.about }}">{% trans "Editor's Platform" %}</a>
77     </div>
78   {% endif %}
79   {% if book.wiki_link %}
80     <div class="white-box">
81       <a href="{{ book.wiki_link }}">{% trans "Book description on Wikipedia" %}</a>
82     </div>
83   {% endif %}
84   <div class="white-box">
85     <a href="{% url 'poem_from_book' book.slug %}">{% trans "Mix this book" %}</a>
86   </div>
87
88 {% endblock %}