Minor visuals.
[wolnelektury.git] / src / catalogue / templates / catalogue / book_text.html
index 7d32a22..17c4896 100644 (file)
@@ -1,5 +1,5 @@
 {% extends "catalogue/viewer_base.html" %}
-{% load i18n %}
+{% load i18n l10n %}
 {% load catalogue_tags %}
 {% load chunks %}
 {% load thumbnail %}
@@ -9,9 +9,19 @@
 {% block title %}{{ book.pretty_title }}{% endblock %}
 
 
+{% block extrahead %}
+   <link rel="stylesheet" href="https://unpkg.com/leaflet@1.7.1/dist/leaflet.css"
+   integrity="sha512-xodZBNTC5n17Xt2atTPuE1HxjVMSvLVW9ocqUKLsCC5CXdbqCmblAshOMAS6/keqq/sMZMZ19scR4PsZChSR7A=="
+         crossorigin=""/>
+    <script src="https://unpkg.com/leaflet@1.7.1/dist/leaflet.js"
+   integrity="sha512-XQoYMqMTK8LvdxXYG3nZ448hOEQiglfqkJs1NOQV44cWnUrBc8PkAOcXy20w0vlaXaVUearIOBhiXZ5V3ynxwA=="
+   crossorigin=""></script>
+{% endblock %}
+
 {% block menu %}
   <li>
     <a href="{{ book.get_absolute_url }}" id="menu-book" data-box="book-short">
+      <span class="label">{% trans "Click to download" %}:</span>
       <img src="{% if book.cover_thumb %}{% thumbnail book.cover_thumb '240x332' as thumb %}{{ thumb.url }}{% empty %}{{ book.cover_thumb.url }}{% endthumbnail %}{% endif %}"
            width="120" height="166"
            alt="{{ book.pretty_title }}"
      data-setting="always-hide-line-numbers"><span>{% trans "Numbering" %}</span></a>
   <a href="#" class="settings-switch" id="settings-themes"
      data-setting="always-hide-themes"><span>{% trans "Themes" %}</span></a>
-    <a href="#" class="settings-switch" id="settings-annotations"
-       data-setting="no-annotations"><span>{% trans "Footnotes" %}</span></a>
+  <a href="#" class="settings-switch" id="settings-annotations"
+     data-setting="no-annotations"><span>{% trans "Footnotes" %}</span></a>
+  <a href="#" class="settings-switch" id="settings-references"
+     data-setting="no-references"><span>{% trans "References" %}</span></a>
 
 {% endblock menu %}
 
@@ -71,6 +83,9 @@
       {% if prev %}
         <a style="display:inline-block;padding: 1em;" href="{% url 'book_text' prev.slug %}">&larr;&nbsp;{{ prev.title }}</a>
       {% endif %}
+      <div style="text-align:center; margin-top:1em;">
+      {% content_warning book %}
+      </div>
       <div style="clear:both;"></div>
       {{ book_text|safe }}
     {% endwith %}
     <div id="other-text-waiter">{% trans "Please wait..." %}</div>
     <div id="other-text-body" style="display: none;"></div>
   </article>
+
+  <div id="reference-box">
+    <div id="reference-map"></div>
+    <a id="reference-close" href="#">x</a>
+    <div id="reference-images">
+    </div>
+    <a id="reference-link" target="_blank"></a>
+  </div>
+
+
+
 {% endblock big-pane %}
 
 {% block footer %}
       {% include 'annoy/dynamic_insert.html' %}
     {% endfor %}
   </div>
+
+  {% localize off %}
+  <script type="application/json" id="interesting-references">
+   {
+       {% for ref in book.references %}
+       {% if ref.entity.is_interesting %}
+       "{{ ref.entity.uri }}": {
+           {% if ref.entity.lat and ref.entity.lon %}
+           "location": [{{ ref.entity.lat }}, {{ ref.entity.lon }}],
+           {% endif %}
+           "images": {{ ref.entity.images|safe }},
+           "label": "{{ ref.entity.label }}",
+           "description": "{{ ref.entity.description }}",
+           "wikipedia_link": "{{ ref.entity.wikipedia_link }}"
+       }{% if not forloop.last %},{% endif %}
+       {% endif %}
+       {% endfor %}
+  }
+  </script>
+  {% endlocalize %}
 {% endblock footer %}