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