TOC link fix.
[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-settings">
43     <a href="#" data-box="settings">
44       <span class="label">{% trans "Settings" %}</span>
45     </a>
46   </li>
47
48   <li id="menu-nota_red">
49     <a href="#" data-box="nota_red">
50       <span class="label">{% trans "Edit. note" %}</span>
51     </a>
52   </li>
53
54   <li id="menu-info">
55     <a href="#info" data-box="info">
56       <span class="label">{% trans "Infobox" %}</span>
57     </a>
58   </li>
59 {% endblock menu %}
60
61
62 {% block big-pane %}
63
64   <article id="main-text">
65     {% with next=book.get_next_text prev=book.get_prev_text %}
66       {% if next %}
67         <a style="float:right; padding: 1em;" href="{% url 'book_text' next.slug %}">{{ next.title }}&nbsp;&rarr;</a>
68       {% endif %}
69       {% if prev %}
70         <a style="display:inline-block;padding: 1em;" href="{% url 'book_text' prev.slug %}">&larr;&nbsp;{{ prev.title }}</a>
71       {% endif %}
72       {{ book_text|safe }}
73     {% endwith %}
74   </article>
75
76
77
78   <article id="other-text">
79     <a class="other-text-close" href="#">{% trans "Close" %}</a>
80     <div id="other-text-waiter">{% trans "Please wait..." %}</div>
81     <div id="other-text-body" style="display: none;"></div>
82   </article>
83 {% endblock big-pane %}
84
85 {% block footer %}
86   <div id="wltoc" class="box">
87     {% if book.parent %}
88       {% for b in book.ancestor.all %}
89         {% if forloop.counter > 1 %}
90           <li>
91         {% endif %}
92         <a href="{{ b.get_absolute_url }}">{{ b.title }}</a>
93         <ol>
94       {% endfor %}
95         {% for b in book.get_siblings %}
96           <li>
97             {% if b == book %}
98               <strong>{{ b.title }}</strong>
99               <div id="heretoc"></div>
100             {% else %}
101               <a href="{% url 'book_text' b.get_first_text.slug %}">{{ b.title }}</a>
102             {% endif %}
103           </li>
104         {% endfor %}
105
106         {% for b in book.ancestor.all %}
107         </ol>
108         {% if not forloop.counter.last %}
109           </li>
110         {% endif %}
111         {% endfor %}
112     {% else %}
113       <strong>{{ book.title }}</strong>
114       <div id="heretoc"></div>
115     {% endif %}
116   </div>
117
118   <div id="info" class="box">
119       {% book_info book %}
120   </div>
121
122   {% if book.other_versions.exists %}
123     <div class="box" id="other">
124       <h2>{% trans "Other versions of the book" %}</h2>
125       <a class="other-text-close" href="#">{% trans "Close the other version" %}</a>
126       <ul>
127         {% spaceless %}
128           {% for other_version in book.other_versions %}
129             <li>
130               <a class="display-other"
131                  data-other="{{ other_version.html_url }}"
132                  href="{% url 'book_text' other_version.slug %}">
133                 {{ other_version.mini_box_nolink }}
134               </a>
135             </li>
136           {% endfor %}
137         {% endspaceless %}
138       </ul>
139     </div>
140   {% endif %}
141
142   <div class="box" id="settings">
143     <h2>{% trans "Settings" %}</h2>
144     <a href="#" class="settings-switch" id="settings-line-numbers"
145        data-setting="always-hide-line-numbers">{% trans "Display line numbers" %}</a><br/>
146     <a href="#" class="settings-switch" id="settings-themes"
147        data-setting="always-hide-themes">{% trans "Display themes" %}</a><br/>
148     <a href="#" class="settings-switch" id="settings-annotations"
149        data-setting="no-annotations">{% trans "Display footnotes" %}</a><br/>
150   </div>
151
152   <div class="box" id="book-short">
153     {% include 'catalogue/book_short.html' %}
154   </div>
155
156   <div id="annoy-stubs">
157     {% annoy_banners 'book-text-intermission' %}
158
159     {% for insert in inserts %}
160       {% include 'annoy/dynamic_insert.html' %}
161     {% endfor %}
162   </div>
163 {% endblock footer %}