Add SRI to external JS.
[wolnelektury.git] / src / catalogue / templates / catalogue / book_text.html
index e958d70..7d32a22 100644 (file)
@@ -1,8 +1,9 @@
 {% extends "catalogue/viewer_base.html" %}
 {% load i18n %}
-{% load catalogue_tags ssify %}
+{% load catalogue_tags %}
+{% load chunks %}
 {% load thumbnail %}
-{% load cache %}
+{% load annoy_banners from annoy %}
 
 
 {% block title %}{{ book.pretty_title }}{% endblock %}
@@ -27,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">
-    <!--#include file='{{ book.html_url }}'-->
+    {% 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>
               <a class="display-other"
                  data-other="{{ other_version.html_url }}"
                  href="{% url 'book_text' other_version.slug %}">
-                {% cache 86400 book_mini_box other_version.pk %}
-                  {% include 'catalogue/book_mini_box.html' with book=other_version no_link=True %}
-                {% endcache %}
-                {#% ssi_include 'catalogue_book_mini_nolink' pk=other_version.pk %#}
+                {{ other_version.mini_box_nolink }}
               </a>
             </li>
           {% endfor %}
     </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>
+
+  <div id="annoy-stubs">
+    {% annoy_banners 'book-text-intermission' %}
+
+    {% for insert in inserts %}
+      {% include 'annoy/dynamic_insert.html' %}
+    {% endfor %}
+  </div>
 {% endblock footer %}