Add a cleardiv.
[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       <div style="clear:both;"></div>
73       {{ book_text|safe }}
74     {% endwith %}
75   </article>
76
77
78
79   <article id="other-text">
80     <a class="other-text-close" href="#">{% trans "Close" %}</a>
81     <div id="other-text-waiter">{% trans "Please wait..." %}</div>
82     <div id="other-text-body" style="display: none;"></div>
83   </article>
84 {% endblock big-pane %}
85
86 {% block footer %}
87   <div id="wltoc" class="box">
88     {% if book.parent %}
89       {% for b in book.ancestor.all %}
90         {% if forloop.counter > 1 %}
91           <li>
92         {% endif %}
93         <a href="{{ b.get_absolute_url }}">{{ b.title }}</a>
94         <ol>
95       {% endfor %}
96         {% for b in book.get_siblings %}
97           <li>
98             {% if b == book %}
99               <strong>{{ b.title }}</strong>
100               <div id="heretoc"></div>
101             {% else %}
102               <a href="{% url 'book_text' b.get_first_text.slug %}">{{ b.title }}</a>
103             {% endif %}
104           </li>
105         {% endfor %}
106
107         {% for b in book.ancestor.all %}
108         </ol>
109         {% if not forloop.counter.last %}
110           </li>
111         {% endif %}
112         {% endfor %}
113     {% else %}
114       <strong>{{ book.title }}</strong>
115       <div id="heretoc"></div>
116     {% endif %}
117   </div>
118
119   <div id="info" class="box">
120       {% book_info book %}
121   </div>
122
123   {% if book.other_versions.exists %}
124     <div class="box" id="other">
125       <h2>{% trans "Other versions of the book" %}</h2>
126       <a class="other-text-close" href="#">{% trans "Close the other version" %}</a>
127       <ul>
128         {% spaceless %}
129           {% for other_version in book.other_versions %}
130             <li>
131               <a class="display-other"
132                  data-other="{{ other_version.html_url }}"
133                  href="{% url 'book_text' other_version.slug %}">
134                 {{ other_version.mini_box_nolink }}
135               </a>
136             </li>
137           {% endfor %}
138         {% endspaceless %}
139       </ul>
140     </div>
141   {% endif %}
142
143   <div class="box" id="settings">
144     <h2>{% trans "Settings" %}</h2>
145     <a href="#" class="settings-switch" id="settings-line-numbers"
146        data-setting="always-hide-line-numbers">{% trans "Display line numbers" %}</a><br/>
147     <a href="#" class="settings-switch" id="settings-themes"
148        data-setting="always-hide-themes">{% trans "Display themes" %}</a><br/>
149     <a href="#" class="settings-switch" id="settings-annotations"
150        data-setting="no-annotations">{% trans "Display footnotes" %}</a><br/>
151   </div>
152
153   <div class="box" id="book-short">
154     {% include 'catalogue/book_short.html' %}
155   </div>
156
157   <div id="annoy-stubs">
158     {% annoy_banners 'book-text-intermission' %}
159
160     {% for insert in inserts %}
161       {% include 'annoy/dynamic_insert.html' %}
162     {% endfor %}
163   </div>
164 {% endblock footer %}