rework book box caching
[wolnelektury.git] / src / catalogue / templates / catalogue / book_text.html
1 {% extends "catalogue/viewer_base.html" %}
2 {% load i18n %}
3 {% load catalogue_tags ssify %}
4 {% load thumbnail %}
5 {% load cache %}
6
7
8 {% block title %}{{ book.pretty_title }}{% endblock %}
9
10
11 {% block menu %}
12   <li>
13     <a href="{{ book.get_absolute_url }}" id="menu-book" data-box="book-short">
14       <img src="{% if book.cover_thumb %}{% thumbnail book.cover_thumb '240x332' as thumb %}{{ thumb.url }}{% empty %}{{ book.cover_thumb.url }}{% endthumbnail %}{% endif %}"
15            width="120" height="166"
16            alt="{{ book.pretty_title }}"
17            title="{{ book.pretty_title }}">
18     </a>
19   </li>
20
21   {% if book.other_versions.exists %}
22     <li id="menu-other">
23       <a href="#" data-box="other">
24         <span class="label">{% trans "Other versions" %}</span>
25       </a>
26     </li>
27   {% endif %}
28
29   <li id="menu-toc">
30     <a href="#" data-box="toc">
31       <span class="label">{% trans "Table of contents" %}</span>
32     </a>
33   </li>
34
35   <li id="menu-themes">
36     <a href="#" data-box="themes">
37       <span class="label">{% trans "Themes" %}</span>
38     </a>
39   </li>
40
41   <li id="menu-settings">
42     <a href="#" data-box="settings">
43       <span class="label">{% trans "Settings" %}</span>
44     </a>
45   </li>
46
47   <li id="menu-nota_red">
48     <a href="#" data-box="nota_red">
49       <span class="label">{% trans "Edit. note" %}</span>
50     </a>
51   </li>
52
53   <li id="menu-info">
54     <a href="#info" data-box="info">
55       <span class="label">{% trans "Infobox" %}</span>
56     </a>
57   </li>
58 {% endblock menu %}
59
60
61 {% block big-pane %}
62   <article id="main-text">
63     <!--#include file='{{ book.html_url }}'-->
64   </article>
65
66   <article id="other-text">
67     <a class="other-text-close" href="#">{% trans "Close" %}</a>
68     <div id="other-text-waiter">{% trans "Please wait..." %}</div>
69     <div id="other-text-body" style="display: none;"></div>
70   </article>
71 {% endblock big-pane %}
72
73
74 {% block footer %}
75   <div id="info" class="box">
76       {% book_info book %}
77   </div>
78
79   {% if book.other_versions.exists %}
80     <div class="box" id="other">
81       <h2>{% trans "Other versions of the book" %}</h2>
82       <a class="other-text-close" href="#">{% trans "Close the other version" %}</a>
83       <ul>
84         {% spaceless %}
85           {% for other_version in book.other_versions %}
86             <li>
87               <a class="display-other"
88                  data-other="{{ other_version.html_url }}"
89                  href="{% url 'book_text' other_version.slug %}">
90                 {% cache 86400 book_mini_box other_version.pk %}
91                   {% include 'catalogue/book_mini_box.html' with book=other_version no_link=True %}
92                 {% endcache %}
93                 {#% ssi_include 'catalogue_book_mini_nolink' pk=other_version.pk %#}
94               </a>
95             </li>
96           {% endfor %}
97         {% endspaceless %}
98       </ul>
99     </div>
100   {% endif %}
101
102   <div class="box" id="settings">
103     <h2>{% trans "Settings" %}</h2>
104     <a href="#" class="settings-switch" id="settings-line-numbers"
105        data-setting="always-hide-line-numbers">{% trans "Display line numbers" %}</a><br/>
106     <a href="#" class="settings-switch" id="settings-themes"
107        data-setting="always-hide-themes">{% trans "Display themes" %}</a><br/>
108     <a href="#" class="settings-switch" id="settings-annotations"
109        data-setting="no-annotations">{% trans "Display footnotes" %}</a><br/>
110   </div>
111
112   <div class="box" id="book-short">
113     {% include 'catalogue/book_short.html' %}
114   </div>
115 {% endblock footer %}