67372b3ddefe60a2581931fdb88b26012286e4d8
[wolnelektury.git] / src / catalogue / templates / catalogue / book_text.html
1 {% extends "catalogue/viewer_base.html" %}
2 {% load i18n l10n %}
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 extrahead %}
13   <link rel="stylesheet" href="https://unpkg.com/leaflet@1.7.1/dist/leaflet.css"
14         integrity="sha512-xodZBNTC5n17Xt2atTPuE1HxjVMSvLVW9ocqUKLsCC5CXdbqCmblAshOMAS6/keqq/sMZMZ19scR4PsZChSR7A=="
15         crossorigin=""/>
16   <script src="https://unpkg.com/leaflet@1.7.1/dist/leaflet.js"
17           integrity="sha512-XQoYMqMTK8LvdxXYG3nZ448hOEQiglfqkJs1NOQV44cWnUrBc8PkAOcXy20w0vlaXaVUearIOBhiXZ5V3ynxwA=="
18           crossorigin=""></script>
19 {% endblock %}
20
21 {% block menu %}
22   <li>
23     <a href="{{ book.get_absolute_url }}" id="menu-book" data-box="book-short">
24       <span class="label">{% trans "Kliknij, by pobrać" %}:</span>
25       <img src="{% if book.cover_clean %}{% thumbnail book.cover_clean '240x332' as thumb %}{{ thumb.url }}{% empty %}{{ book.cover_clean.url }}{% endthumbnail %}{% endif %}"
26            width="120" height="166"
27            alt="{{ book.pretty_title }}"
28            title="{{ book.pretty_title }}">
29     </a>
30   </li>
31
32   {% if book.other_versions.exists %}
33     <li id="menu-other">
34       <a href="#" data-box="other">
35         <span class="label">{% trans "Inne wersje" %}</span>
36       </a>
37     </li>
38   {% endif %}
39
40   <li id="menu-toc">
41     <a href="#" data-box="wltoc">
42       <span class="label">{% trans "Spis treści" %}</span>
43     </a>
44   </li>
45
46   <li id="menu-themes">
47     <a href="#" data-box="themes">
48       <span class="label">{% trans "Motywy" %}</span>
49     </a>
50   </li>
51
52   <li id="menu-nota_red">
53     <a href="#" data-box="nota_red">
54       <span class="label">{% trans "Nota red." %}</span>
55     </a>
56   </li>
57
58   <li id="menu-info">
59     <a href="#info" data-box="info">
60       <span class="label">{% trans "Informacje" %}</span>
61     </a>
62   </li>
63
64   {% if extra_info.logo_mono %}
65     {% thumbnail extra_info.logo_mono '200x200' as th %}
66     <img src="{{ th.url }}" style="width: 100px; padding: 10px;"
67          alt="{{ extra_info.logo_alt|default:'Sponsor' }}"
68     >
69   {% endthumbnail %}
70   {% endif %}
71
72   <a href="#" class="settings-switch" id="settings-line-numbers"
73      data-setting="always-hide-line-numbers"><span>{% trans "Numeracja" %}</span></a>
74   <a href="#" class="settings-switch" id="settings-themes"
75      data-setting="always-hide-themes"><span>{% trans "Motywy" %}</span></a>
76   <a href="#" class="settings-switch" id="settings-annotations"
77      data-setting="no-annotations"><span>{% trans "Przypisy" %}</span></a>
78   <a href="#" class="settings-switch" id="settings-references"
79      data-setting="no-references"><span>{% trans "Pinezki" %}</span></a>
80
81 {% endblock menu %}
82
83
84 {% block big-pane %}
85
86   <article id="main-text">
87     {% with next=book.get_next_text prev=book.get_prev_text %}
88       {% if next %}
89         <a style="float:right; padding: 1em;" href="{% url 'book_text' next.slug %}">{{ next.title }}&nbsp;&rarr;</a>
90       {% endif %}
91       {% if prev %}
92         <a style="display:inline-block;padding: 1em;" href="{% url 'book_text' prev.slug %}">&larr;&nbsp;{{ prev.title }}</a>
93       {% endif %}
94       <div style="text-align:center; margin-top:1em;">
95         {% content_warning book %}
96       </div>
97       <div style="clear:both;"></div>
98       {{ book_text|safe }}
99     {% endwith %}
100   </article>
101
102
103
104   <article id="other-text">
105     <a class="other-text-close" href="#">{% trans "Zamknij" %}</a>
106     <div id="other-text-waiter">{% trans "Proszę czekać..." %}</div>
107     <div id="other-text-body" style="display: none;"></div>
108   </article>
109
110   <div id="reference-box">
111     <div id="reference-map"></div>
112     <a id="reference-close" href="#">x</a>
113     <div id="reference-images">
114     </div>
115     <a id="reference-link" target="_blank"></a>
116   </div>
117
118
119
120
121 {% endblock big-pane %}
122
123 {% block footer %}
124   {% if book.has_sync_file %}
125     <div id="player-bar">
126       {% include 'catalogue/snippets/jplayer_reader.html' %}
127     </div>
128     <script type="application/json" id="smil">
129      {{ book.get_sync|safe }}
130     </script>
131   {% endif %}
132   <div id="wltoc" class="box">
133     {% if book.parent %}
134       {% for b in book.ancestors %}
135         {% if forloop.counter > 1 %}
136           <li>
137         {% endif %}
138         <a href="{% if b.html_file %}{% url 'book_text' b.slug %}{% else %}{{ b.get_absolute_url }}{% endif %}">{{ b.title }}</a>
139         <ol>
140       {% endfor %}
141       {% for b in book.get_siblings %}
142         <li>
143           {% if b == book %}
144             <strong>{{ b.title }}</strong>
145             <div id="heretoc"></div>
146           {% else %}
147             <a href="{% url 'book_text' b.get_first_text.slug %}">{{ b.title }}</a>
148           {% endif %}
149         </li>
150       {% endfor %}
151
152       {% for b in book.ancestor.all %}
153         </ol>
154         {% if not forloop.counter.last %}
155           </li>
156         {% endif %}
157       {% endfor %}
158     {% else %}
159       <strong>{{ book.title }}</strong>
160       <div id="heretoc"></div>
161       <ol>
162         {% for c in book.get_children %}
163           <li><a href="{% url 'book_text' c.get_first_text.slug %}">{{ c.title }}</a></li>
164         {% endfor %}
165       </ol>
166     {% endif %}
167   </div>
168
169   <div id="info" class="box">
170     {% book_info book %}
171   </div>
172
173   {% if book.other_versions.exists %}
174     <div class="box" id="other">
175       <h2>{% trans "Inne wersje utworu" %}</h2>
176       <a class="other-text-close" href="#">{% trans "Zamknij drugą wersję" %}</a>
177       <ul>
178         {% spaceless %}
179           {% for other_version in book.other_versions %}
180             <li>
181               <a class="display-other"
182                  data-other="{{ other_version.html_url }}"
183                  href="{% url 'book_text' other_version.slug %}">
184                 {{ other_version.mini_box_nolink }}
185               </a>
186             </li>
187           {% endfor %}
188         {% endspaceless %}
189       </ul>
190     </div>
191   {% endif %}
192
193   <div class="box" id="book-short">
194     {% include 'catalogue/book_short.html' %}
195   </div>
196
197   <div id="annoy-stubs">
198     {% annoy_banners 'book-text-intermission' %}
199
200     {% for insert in inserts %}
201       {% include 'annoy/dynamic_insert.html' %}
202     {% endfor %}
203   </div>
204
205
206   <div id="marker">
207
208   </div>
209
210   {% localize off %}
211   <script type="application/json" id="interesting-references">
212    {
213        {% for ref in book.references %}
214        {% if ref.entity.is_interesting %}
215        "{{ ref.entity.uri }}": {
216            {% if ref.entity.lat and ref.entity.lon %}
217            "location": [{{ ref.entity.lat }}, {{ ref.entity.lon }}],
218            {% endif %}
219            "images": {{ ref.entity.images|safe }},
220            "label": "{{ ref.entity.label }}",
221            "description": "{{ ref.entity.description }}",
222            "wikipedia_link": "{{ ref.entity.wikipedia_link }}"
223        },
224        {% endif %}
225        {% endfor %}
226        "": null
227    }
228   </script>
229
230   {% endlocalize %}
231 {% endblock footer %}