Phone not required.
[wolnelektury.git] / src / catalogue / templates / catalogue / book_text.html
1 {% extends "base.html" %}
2
3
4 {% load i18n l10n %}
5 {% load catalogue_tags %}
6 {% load chunks %}
7 {% load thumbnail %}
8 {% load static %}
9 {% load annoy %}
10
11
12 {% block title %}{{ book.pretty_title }}{% endblock %}
13
14
15 {% block extrahead %}
16   <link rel="stylesheet" href="https://unpkg.com/leaflet@1.7.1/dist/leaflet.css"
17         integrity="sha512-xodZBNTC5n17Xt2atTPuE1HxjVMSvLVW9ocqUKLsCC5CXdbqCmblAshOMAS6/keqq/sMZMZ19scR4PsZChSR7A=="
18         crossorigin=""/>
19   <script src="https://unpkg.com/leaflet@1.7.1/dist/leaflet.js"
20           integrity="sha512-XQoYMqMTK8LvdxXYG3nZ448hOEQiglfqkJs1NOQV44cWnUrBc8PkAOcXy20w0vlaXaVUearIOBhiXZ5V3ynxwA=="
21           crossorigin=""></script>
22 {% endblock %}
23
24
25 {% block menu %}
26   <li>
27     <a href="{{ book.get_absolute_url }}" id="menu-book" data-box="book-short">
28       <span class="label">{% trans "Kliknij, by pobrać" %}:</span>
29       <img src="{% if book.cover_clean %}{% thumbnail book.cover_clean '240x332' as thumb %}{{ thumb.url }}{% empty %}{{ book.cover_clean.url }}{% endthumbnail %}{% endif %}"
30            width="120" height="166"
31            alt="{{ book.pretty_title }}"
32            title="{{ book.pretty_title }}">
33     </a>
34   </li>
35
36   {% if book.other_versions.exists %}
37     <li id="menu-other">
38       <a href="#" data-box="other">
39         <span class="label">{% trans "Inne wersje" %}</span>
40       </a>
41     </li>
42   {% endif %}
43
44   {% if extra_info.logo_mono %}
45     {% thumbnail extra_info.logo_mono '200x200' as th %}
46     <img src="{{ th.url }}" style="width: 100px; padding: 10px;"
47          alt="{{ extra_info.logo_alt|default:'Sponsor' }}"
48     >
49   {% endthumbnail %}
50   {% endif %}
51
52
53
54 {% endblock menu %}
55
56
57
58 {% block breadcrumb-right %}
59   <div class="l-text_toolbar" id="menu">
60     <a href="#info" data-box="info">
61       <img src="{% static '2022/images/about.svg' %}" alt="{% trans "Informacje" %}">
62     </a>
63
64     <a href="#" data-box="settings" style="display: none;">
65       <img src="{% static '2022/images/settings.svg' %}" alt="{% trans "Ustawienia" %}">
66     </a>
67
68     <a href="#wltoc" data-box="wltoc" style="display: none;">
69       <img src="{% static '2022/images/toc.svg' %}" alt="{% trans "Spis treści" %}">
70     </a>
71
72
73
74
75     <div id="info" class="box">
76       {% book_info book %}
77     </div>
78
79
80     <div id="settings" class="box">
81       <a href="#" class="settings-switch" id="settings-line-numbers"
82          data-setting="always-hide-line-numbers"><span>{% trans "Numeracja" %}</span></a>
83       <a href="#" class="settings-switch" id="settings-themes"
84          data-setting="always-hide-themes"><span>{% trans "Motywy" %}</span></a>
85       <a href="#" class="settings-switch" id="settings-annotations"
86          data-setting="no-annotations"><span>{% trans "Przypisy" %}</span></a>
87       <a href="#" class="settings-switch" id="settings-references"
88          data-setting="no-references"><span>{% trans "Pinezki" %}</span></a>
89     </div>
90
91
92     <div id="wltoc" class="box">
93       {% if book.parent %}
94         {% for b in book.ancestors %}
95           {% if forloop.counter > 1 %}
96             <li>
97           {% endif %}
98           <a href="{% if b.html_file %}{% url 'book_text' b.slug %}{% else %}{{ b.get_absolute_url }}{% endif %}">{{ b.title }}</a>
99           <ol>
100         {% endfor %}
101         {% for b in book.get_siblings %}
102           <li>
103             {% if b == book %}
104               <strong>{{ b.title }}</strong>
105               <div id="heretoc"></div>
106             {% else %}
107               <a href="{% url 'book_text' b.get_first_text.slug %}">{{ b.title }}</a>
108             {% endif %}
109           </li>
110         {% endfor %}
111
112         {% for b in book.ancestor.all %}
113           </ol>
114           {% if not forloop.counter.last %}
115             </li>
116           {% endif %}
117         {% endfor %}
118       {% else %}
119         <strong>{{ book.title }}</strong>
120         <div id="heretoc"></div>
121         <ol>
122           {% for c in book.get_children %}
123             <li><a href="{% url 'book_text' c.get_first_text.slug %}">{{ c.title }}</a></li>
124           {% endfor %}
125         </ol>
126       {% endif %}
127     </div>
128
129   </div>
130 {% endblock %}
131
132
133
134
135 {% block main %}
136   <div id="global-progress" class="l-container" data-t="{{ book.get_time }}">
137     <div class="bar">
138       <span class="piece" style="flex-grow: 100;">
139         <span class="filled"></span>
140       </span>
141     </div>
142     <div class="progress-text">
143       Szacowany czas do końca: <span class="progress-text-value">-</span>
144     </div>
145   </div>
146
147   <header class="l-text_header">
148     <img class="l-text_header_cover" src="{% if book.cover_clean %}{{ book.cover_clean.url }}{% endif %}" alt="{{ book.pretty_title }}">
149
150     <div class="l-text_header__content">
151       <p class="l-text_header_author">{% for author in book.authors %}<a href="{{ author.get_absolute_url }}">{{ author.name }}</a>{% if not forloop.last %}, {% endif %}{% endfor %}
152       </p>
153       <h1 class="l-text_header_title"><a href="{{ book.get_absolute_url }}">{{ book.title }}</a></h1>
154       {% if book.translators.exists %}
155         <p class="l-header__translators">
156           {% for translator in book.translators.all %}
157             {% if forloop.first and translator.name != 'tłumacz nieznany' %}
158               {% trans "tłum." %}
159             {% endif %}
160             <a href="{{ translator.get_absolute_url }}">
161               {{ translator }}</a>{% if not forloop.last %}, {% endif %}
162           {% endfor %}
163         </p>
164       {% endif %}
165       <div style="margin-top:1em;">
166         {% content_warning book %}
167       </div>
168
169       {#% annoy_banner 'book-start' %#}
170
171       <div id="book-text-buttons">
172       </div>
173
174     </div>
175   </header>
176
177
178   <article id="main-text" {% if book.has_sync_file %}class="has-sync"{% endif %}>
179     {% with next=book.get_next_text prev=book.get_prev_text %}
180       {% if next %}
181         <a class="text_next-book" href="{% url 'book_text' next.slug %}">{{ next.title }}&nbsp;&rarr;</a>
182       {% endif %}
183       {% if prev %}
184         <a class="text_prev-book" href="{% url 'book_text' prev.slug %}">&larr;&nbsp;{{ prev.title }}</a>
185       {% endif %}
186       <div class="main-text-body">
187         {{ book_text|safe }}
188       </div>
189
190       <div class="l-checkout__box" style="margin: 2em 0;">
191         {% include 'club/donation_step1_form.html' with form=donation_form %}
192       </div>
193     {% endwith %}
194
195
196
197
198
199
200     <article id="other-text">
201       <a class="other-text-close" href="#">{% trans "Zamknij" %}</a>
202       <div id="other-text-waiter">{% trans "Proszę czekać..." %}</div>
203       <div id="other-text-body" style="display: none;"></div>
204     </article>
205
206     <div id="reference-box">
207       <div id="reference-map"></div>
208       <a id="reference-close" href="#">x</a>
209       <div id="reference-images">
210       </div>
211       <a id="reference-link" target="_blank"></a>
212     </div>
213
214     <div id="annotation-box"
215          data-default-leftoffset="40"
216     >
217       <div id="annotation">
218         <div id="annotation-content"></div>
219         <a id="footnote-link">Czytaj w przypisie dolnym</a>
220       </div>
221       <div class="pointer pointer-bottom"></div>
222       <div class="pointer pointer-top"></div>
223     </div>
224
225     <div id="qbox" class="qbox"
226          data-attach-bottom="true"
227     >
228       <div class="content">
229         <a class="qbox-t-link" href="" title="Skopiuj link"><img src="{% static '2022/images/tool-link.svg' %}" alt="Skopiuj link"></a>
230         <a class="qbox-t-copy" href="" title="Skopiuj cytat"><img src="{% static '2022/images/tool-copy.svg' %}" alt="Skopiuj cytat"></a>
231         {% if request.user.is_authenticated %}
232           <a class="qbox-t-quote" href="" title="Zapisz cytat"><img src="{% static '2022/images/tool-quote.svg' %}" alt="Zapisz cytat"></a>
233         {% endif %}
234       </div>
235       <div class="pointer pointer-bottom"></div>
236       <div class="pointer pointer-top"></div>
237     </div>
238
239     <div id="zakladka" class="zakladka">
240       <div class="icon">
241         <img style="height: 30px;" class="icon-empty" src="{% static '2022/images/zakladka.svg' %}" alt="Zakładka">
242         <img class="icon-exists" src="{% static '2022/images/zakladka-full.svg' %}" alt="Istniejąca zakładka">
243         <img class="icon-note" src="{% static '2022/images/zakladka-note.svg' %}" alt="Notka">
244       </div>
245       <div id="zakladka-box">
246         <div class="content">
247           {% if request.user.is_authenticated %}
248             <div class="zakladka-tool zakladka-tool_zakladka_delete">
249               Usuń zakładkę
250             </div>
251             <div class="zakladka-tool zakladka-tool_zakladka">
252               Dodaj zakładkę
253             </div>
254             <div class="zakladka-tool zakladka-tool_sluchaj">
255               Słuchaj od tego miejsca
256             </div>
257             <div class="zakladka-tool_notka_text">
258               <textarea placeholder="Notatka"></textarea>
259               <svg height="16" width="16" xmlns="http://www.w3.org/2000/svg" id="notka-save">
260                 <circle r="7" cx="8" cy="8" fill="none" stroke="black" stroke-width="2px" stroke-dasharray="1,1" />
261               </svg>
262               <img src="{% static '2022/images/notka-saved.svg' %}" id="notka-saved">
263             </div>
264
265           {% else %}
266             <div class="zakladka-tool zakladka-tool_login">
267               <a href="{% url 'login' %}?next={{ request.path }}">
268                 Zaloguj się </a>
269               /
270               <a href="{% url 'register' %}?next={{ request.path }}"> Załóż konto
271               </a>
272             </div>
273             <div class="zakladka-tool zakladka-tool_sluchaj">
274               Słuchaj od tego miejsca
275             </div>
276         </div>
277           {% endif %}
278
279
280             <div class="pointer pointer-bottom"></div>
281             <div class="pointer pointer-top"></div>
282         </div>
283       </div>
284
285
286       {% if book.other_versions.exists %}
287         <div class="box" id="other">
288           <h2>{% trans "Inne wersje utworu" %}</h2>
289           <a class="other-text-close" href="#">{% trans "Zamknij drugą wersję" %}</a>
290           <ul>
291             {% spaceless %}
292               {% for other_version in book.other_versions %}
293                 <li>
294                   <a class="display-other"
295                      data-other="{{ other_version.html_url }}"
296                      href="{% url 'book_text' other_version.slug %}">
297                     {{ other_version.mini_box_nolink }}
298                   </a>
299                 </li>
300               {% endfor %}
301             {% endspaceless %}
302           </ul>
303         </div>
304       {% endif %}
305
306       <div id="annoy-stubs">
307         {% annoy_banners 'book-text-intermission' %}
308
309         {% for insert in inserts %}
310           {% include 'annoy/dynamic_insert.html' %}
311         {% endfor %}
312       </div>
313
314   </article>
315
316
317
318   {% if book.has_sync_file %}
319     <div id="player-bar">
320       {% include 'catalogue/snippets/jplayer_reader.html' %}
321     </div>
322     <script type="application/json" id="smil">
323      {{ book.get_sync|safe }}
324     </script>
325   {% endif %}
326
327
328   <div id="marker">
329
330   </div>
331
332   {% localize off %}
333   <script type="application/json" id="interesting-references">
334    {
335        {% for ref in book.references %}
336        {% if ref.entity.is_interesting %}
337        "{{ ref.entity.uri }}": {
338            {% if ref.entity.lat and ref.entity.lon %}
339            "location": [{{ ref.entity.lat }}, {{ ref.entity.lon }}],
340            {% endif %}
341            "images": {{ ref.entity.images|safe }},
342            "label": "{{ ref.entity.label }}",
343            "description": "{{ ref.entity.description }}",
344            "wikipedia_link": "{{ ref.entity.wikipedia_link }}"
345        },
346        {% endif %}
347        {% endfor %}
348        "": null
349    }
350   </script>
351
352   {% endlocalize %}
353
354 {% endblock main %}