Fixes #4083: Book text settings toggles on side bar.
[wolnelektury.git] / src / catalogue / templates / catalogue / book_text.html
1 {% extends "catalogue/viewer_base.html" %}
2 {% load i18n %}
3 {% load catalogue_tags %}
4 {% load chunks %}
5 {% load thumbnail %}
6 {% load annoy_banners from annoy %}
7
8
9 {% block title %}{{ book.pretty_title }}{% endblock %}
10
11
12 {% block menu %}
13   <li>
14     <a href="{{ book.get_absolute_url }}" id="menu-book" data-box="book-short">
15       <img src="{% if book.cover_thumb %}{% thumbnail book.cover_thumb '240x332' as thumb %}{{ thumb.url }}{% empty %}{{ book.cover_thumb.url }}{% endthumbnail %}{% endif %}"
16            width="120" height="166"
17            alt="{{ book.pretty_title }}"
18            title="{{ book.pretty_title }}">
19     </a>
20   </li>
21
22   {% if book.other_versions.exists %}
23     <li id="menu-other">
24       <a href="#" data-box="other">
25         <span class="label">{% trans "Other versions" %}</span>
26       </a>
27     </li>
28   {% endif %}
29
30   <li id="menu-toc">
31     <a href="#" data-box="wltoc">
32       <span class="label">{% trans "Table of contents" %}</span>
33     </a>
34   </li>
35
36   <li id="menu-themes">
37     <a href="#" data-box="themes">
38       <span class="label">{% trans "Themes" %}</span>
39     </a>
40   </li>
41
42   <li id="menu-nota_red">
43     <a href="#" data-box="nota_red">
44       <span class="label">{% trans "Edit. note" %}</span>
45     </a>
46   </li>
47
48   <li id="menu-info">
49     <a href="#info" data-box="info">
50       <span class="label">{% trans "Infobox" %}</span>
51     </a>
52   </li>
53
54   <a href="#" class="settings-switch" id="settings-line-numbers"
55      data-setting="always-hide-line-numbers"><span>{% trans "Numbering" %}</span></a>
56   <a href="#" class="settings-switch" id="settings-themes"
57      data-setting="always-hide-themes"><span>{% trans "Themes" %}</span></a>
58     <a href="#" class="settings-switch" id="settings-annotations"
59        data-setting="no-annotations"><span>{% trans "Footnotes" %}</span></a>
60
61 {% endblock menu %}
62
63
64 {% block big-pane %}
65
66   <article id="main-text">
67     {% with next=book.get_next_text prev=book.get_prev_text %}
68       {% if next %}
69         <a style="float:right; padding: 1em;" href="{% url 'book_text' next.slug %}">{{ next.title }}&nbsp;&rarr;</a>
70       {% endif %}
71       {% if prev %}
72         <a style="display:inline-block;padding: 1em;" href="{% url 'book_text' prev.slug %}">&larr;&nbsp;{{ prev.title }}</a>
73       {% endif %}
74       <div style="clear:both;"></div>
75       {{ book_text|safe }}
76     {% endwith %}
77   </article>
78
79
80
81   <article id="other-text">
82     <a class="other-text-close" href="#">{% trans "Close" %}</a>
83     <div id="other-text-waiter">{% trans "Please wait..." %}</div>
84     <div id="other-text-body" style="display: none;"></div>
85   </article>
86 {% endblock big-pane %}
87
88 {% block footer %}
89   <div id="wltoc" class="box">
90     {% if book.parent %}
91       {% for b in book.ancestor.all %}
92         {% if forloop.counter > 1 %}
93           <li>
94         {% endif %}
95         <a href="{{ b.get_absolute_url }}">{{ b.title }}</a>
96         <ol>
97       {% endfor %}
98         {% for b in book.get_siblings %}
99           <li>
100             {% if b == book %}
101               <strong>{{ b.title }}</strong>
102               <div id="heretoc"></div>
103             {% else %}
104               <a href="{% url 'book_text' b.get_first_text.slug %}">{{ b.title }}</a>
105             {% endif %}
106           </li>
107         {% endfor %}
108
109         {% for b in book.ancestor.all %}
110         </ol>
111         {% if not forloop.counter.last %}
112           </li>
113         {% endif %}
114         {% endfor %}
115     {% else %}
116       <strong>{{ book.title }}</strong>
117       <div id="heretoc"></div>
118     {% endif %}
119   </div>
120
121   <div id="info" class="box">
122       {% book_info book %}
123   </div>
124
125   {% if book.other_versions.exists %}
126     <div class="box" id="other">
127       <h2>{% trans "Other versions of the book" %}</h2>
128       <a class="other-text-close" href="#">{% trans "Close the other version" %}</a>
129       <ul>
130         {% spaceless %}
131           {% for other_version in book.other_versions %}
132             <li>
133               <a class="display-other"
134                  data-other="{{ other_version.html_url }}"
135                  href="{% url 'book_text' other_version.slug %}">
136                 {{ other_version.mini_box_nolink }}
137               </a>
138             </li>
139           {% endfor %}
140         {% endspaceless %}
141       </ul>
142     </div>
143   {% endif %}
144
145   <div class="box" id="book-short">
146     {% include 'catalogue/book_short.html' %}
147   </div>
148
149   <div id="annoy-stubs">
150     {% annoy_banners 'book-text-intermission' %}
151
152     {% for insert in inserts %}
153       {% include 'annoy/dynamic_insert.html' %}
154     {% endfor %}
155   </div>
156 {% endblock footer %}