Uncrazy the caching, more.
[wolnelektury.git] / src / catalogue / templates / catalogue / book_text.html
1 {% extends "catalogue/viewer_base.html" %}
2 {% load i18n %}
3 {% load catalogue_tags %}
4 {% load thumbnail %}
5
6
7 {% block title %}{{ book.pretty_title }}{% endblock %}
8
9
10 {% block menu %}
11   <li>
12     <a href="{{ book.get_absolute_url }}" id="menu-book" data-box="book-short">
13       <img src="{% if book.cover_thumb %}{% thumbnail book.cover_thumb '240x332' as thumb %}{{ thumb.url }}{% empty %}{{ book.cover_thumb.url }}{% endthumbnail %}{% endif %}"
14            width="120" height="166"
15            alt="{{ book.pretty_title }}"
16            title="{{ book.pretty_title }}">
17     </a>
18   </li>
19
20   {% if book.other_versions.exists %}
21     <li id="menu-other">
22       <a href="#" data-box="other">
23         <span class="label">{% trans "Other versions" %}</span>
24       </a>
25     </li>
26   {% endif %}
27
28   <li id="menu-toc">
29     <a href="#" data-box="toc">
30       <span class="label">{% trans "Table of contents" %}</span>
31     </a>
32   </li>
33
34   <li id="menu-themes">
35     <a href="#" data-box="themes">
36       <span class="label">{% trans "Themes" %}</span>
37     </a>
38   </li>
39
40   <li id="menu-settings">
41     <a href="#" data-box="settings">
42       <span class="label">{% trans "Settings" %}</span>
43     </a>
44   </li>
45
46   <li id="menu-nota_red">
47     <a href="#" data-box="nota_red">
48       <span class="label">{% trans "Edit. note" %}</span>
49     </a>
50   </li>
51
52   <li id="menu-info">
53     <a href="#info" data-box="info">
54       <span class="label">{% trans "Infobox" %}</span>
55     </a>
56   </li>
57 {% endblock menu %}
58
59
60 {% block big-pane %}
61
62   <article id="main-text">
63     {{ book.html_file.read|safe }}
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                 {{ other_version.mini_box_nolink }}
91               </a>
92             </li>
93           {% endfor %}
94         {% endspaceless %}
95       </ul>
96     </div>
97   {% endif %}
98
99   <div class="box" id="settings">
100     <h2>{% trans "Settings" %}</h2>
101     <a href="#" class="settings-switch" id="settings-line-numbers"
102        data-setting="always-hide-line-numbers">{% trans "Display line numbers" %}</a><br/>
103     <a href="#" class="settings-switch" id="settings-themes"
104        data-setting="always-hide-themes">{% trans "Display themes" %}</a><br/>
105     <a href="#" class="settings-switch" id="settings-annotations"
106        data-setting="no-annotations">{% trans "Display footnotes" %}</a><br/>
107   </div>
108
109   <div class="box" id="book-short">
110     {% include 'catalogue/book_short.html' %}
111   </div>
112 {% endblock footer %}