fixes
[wolnelektury.git] / src / catalogue / templates / catalogue / book_detail.html
index a5be89b..d2bfda7 100644 (file)
@@ -1,7 +1,8 @@
 {% extends "base/base.html" %}
 {% load i18n %}
-{% load common_tags catalogue_tags %}
+{% load catalogue_tags %}
 {% load build_absolute_uri from fnp_common %}
+{% load annoy_banner from annoy %}
 {% load cache %}
 
 {% block titleextra %}{{ book.pretty_title }}{% endblock %}
 
 {% block bodyid %}book-detail{% endblock %}
 
-{% block extrahead %}
-{{ block.super }}
-{% if request.path == '/katalog/lektura/pan-tadeusz/' %}
-{% include "hotjar.html" %}
-{% endif %}
-{% endblock %}
-
 
 {% block body %}
   {% include 'catalogue/book_wide.html' %}
       <section class="see-also">
         <h1>{% trans "Other versions" %}:</h1>
         {% for rel in book.other_versions %}
-          {% cache 86400 book_mini_box rel.pk %}
-            {% include 'catalogue/book_mini_box.html' with book=rel %}
-          {% endcache %}
+         {{ rel.mini_box }}
         {% endfor %}
       </section>
     {% endif %}
 
+    {% annoy_banner 'book-page' %}
+
     <section class="see-also">
       <h2>{% trans "See also" %}:</h2>
       {% related_books book taken=book.other_versions|length %}
@@ -54,7 +48,7 @@
   {% for author in book.authors %}
     <div class="white-box">
       <a style="display:block" href="{{ author.get_absolute_url }}">
-       {% cache 86400 catalogue_tag_box rel.pk %}
+       {% cache 86400 catalogue_tag_box author.pk %}
           {% include 'catalogue/tag_box.html' with tag=author %}
        {% endcache %}
       </a>
   {% endfor %}
 
 
-  {% if extra_info.source_url %}
-    <div class="white-box">
-      <a href="{{ extra_info.source_url }}">{% trans "Source" %}</a> {% trans "of the book" %}
-      {% trans "in" %} {% source_name extra_info.source_url %}
-    </div>
-  {% endif %}
+  {% with extra_info=book.get_extra_info_json %}
+    {% for source_url in extra_info.source_urls %}
+      <div class="white-box">
+        <a href="{{ source_url }}">{% trans "Source" %}</a> {% trans "of the book" %}
+        {% trans "in" %} {% source_name source_url %}
+      </div>
+    {% empty %}
+      {% if extra_info.source_url %}
+        <div class="white-box">
+          <a href="{{ extra_info.source_url }}">{% trans "Source" %}</a> {% trans "of the book" %}
+          {% trans "in" %} {% source_name extra_info.source_url %}
+        </div>
+      {% endif %}
+    {% endfor %}
   {% if book|status:user != 'closed' %}
     <div class="white-box"><a href="{{ book.xml_url }}">{% trans "Source XML file" %}</a></div>
   {% endif %}
@@ -84,5 +86,6 @@
   <div class="white-box">
     <a href="{% url 'poem_from_book' book.slug %}">{% trans "Mix this book" %}</a>
   </div>
+{% endwith %}
 
 {% endblock %}