Add SRI to external JS.
[wolnelektury.git] / src / catalogue / templates / catalogue / book_text.html
index c08f76c..7d32a22 100644 (file)
@@ -28,7 +28,7 @@
   {% endif %}
 
   <li id="menu-toc">
-    <a href="#" data-box="toc">
+    <a href="#" data-box="wltoc">
       <span class="label">{% trans "Table of contents" %}</span>
     </a>
   </li>
     </a>
   </li>
 
-  <li id="menu-settings">
-    <a href="#" data-box="settings">
-      <span class="label">{% trans "Settings" %}</span>
-    </a>
-  </li>
-
   <li id="menu-nota_red">
     <a href="#" data-box="nota_red">
       <span class="label">{% trans "Edit. note" %}</span>
       <span class="label">{% trans "Infobox" %}</span>
     </a>
   </li>
+
+  <a href="#" class="settings-switch" id="settings-line-numbers"
+     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>
+
 {% endblock menu %}
 
 
 {% block big-pane %}
 
   <article id="main-text">
-    {{ book_text|safe }}
+    {% with next=book.get_next_text prev=book.get_prev_text %}
+      {% if next %}
+        <a style="float:right; padding: 1em;" href="{% url 'book_text' next.slug %}">{{ next.title }}&nbsp;&rarr;</a>
+      {% endif %}
+      {% if prev %}
+        <a style="display:inline-block;padding: 1em;" href="{% url 'book_text' prev.slug %}">&larr;&nbsp;{{ prev.title }}</a>
+      {% endif %}
+      <div style="clear:both;"></div>
+      {{ book_text|safe }}
+    {% endwith %}
   </article>
 
+
+
   <article id="other-text">
     <a class="other-text-close" href="#">{% trans "Close" %}</a>
     <div id="other-text-waiter">{% trans "Please wait..." %}</div>
   </article>
 {% endblock big-pane %}
 
-
 {% block footer %}
+  <div id="wltoc" class="box">
+    {% if book.parent %}
+      {% for b in book.ancestor.all %}
+        {% if forloop.counter > 1 %}
+          <li>
+        {% endif %}
+        <a href="{{ b.get_absolute_url }}">{{ b.title }}</a>
+        <ol>
+      {% endfor %}
+        {% for b in book.get_siblings %}
+          <li>
+            {% if b == book %}
+              <strong>{{ b.title }}</strong>
+              <div id="heretoc"></div>
+            {% else %}
+              <a href="{% url 'book_text' b.get_first_text.slug %}">{{ b.title }}</a>
+            {% endif %}
+          </li>
+        {% endfor %}
+
+        {% for b in book.ancestor.all %}
+        </ol>
+        {% if not forloop.counter.last %}
+          </li>
+        {% endif %}
+        {% endfor %}
+    {% else %}
+      <strong>{{ book.title }}</strong>
+      <div id="heretoc"></div>
+    {% endif %}
+  </div>
+
   <div id="info" class="box">
       {% book_info book %}
   </div>
     </div>
   {% endif %}
 
-  <div class="box" id="settings">
-    <h2>{% trans "Settings" %}</h2>
-    <a href="#" class="settings-switch" id="settings-line-numbers"
-       data-setting="always-hide-line-numbers">{% trans "Display line numbers" %}</a><br/>
-    <a href="#" class="settings-switch" id="settings-themes"
-       data-setting="always-hide-themes">{% trans "Display themes" %}</a><br/>
-    <a href="#" class="settings-switch" id="settings-annotations"
-       data-setting="no-annotations">{% trans "Display footnotes" %}</a><br/>
-  </div>
-
   <div class="box" id="book-short">
     {% include 'catalogue/book_short.html' %}
   </div>
     {% annoy_banners 'book-text-intermission' %}
 
     {% for insert in inserts %}
-      {% with text=insert.choose %}
-        <div class="dynamic-insert{% if text.image %} with-image{% endif %}" style="{% if text.text_color %}color: {{ text.text_color }};{% endif %}{% if text.background_color %}{{ text.background_color }}{% endif %}" data-paragraphs="{{ insert.paragraphs }}">
-          <a href="{% url 'club' %}">
-            <div class="text">
-              {{ text.text }}
-            </div>
-            {% if text.image %}
-              <img src="{% thumbnail text.image '120x120' as thumb %}{{ thumb.url }}{% empty %}{{ text.image.url }}{% endthumbnail %}">
-            {% endif %}
-          </a>
-        </div>
-      {% endwith %}
+      {% include 'annoy/dynamic_insert.html' %}
     {% endfor %}
   </div>
 {% endblock footer %}