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