fixes
[wolnelektury.git] / src / catalogue / templates / catalogue / book_detail.html
index b87e9eb..d2bfda7 100644 (file)
@@ -1,8 +1,9 @@
-{% extends "base.html" %}
+{% extends "base/base.html" %}
 {% load i18n %}
-{% load common_tags catalogue_tags %}
-{% load ssify %}
+{% load catalogue_tags %}
 {% load build_absolute_uri from fnp_common %}
+{% load annoy_banner from annoy %}
+{% load cache %}
 
 {% block titleextra %}{{ book.pretty_title }}{% endblock %}
 {% block ogimage %}{% if book.cover %}{{ book.cover.url|build_absolute_uri:request }}{% endif %}{% endblock %}
 
 {% block bodyid %}book-detail{% endblock %}
 
-{% block body %}
-
-{% ssi_include 'catalogue_book_wide' pk=book.pk %}
-
-{% work_list book_children %}
-
-{% spaceless %}
-{% if book.other_versions %}
-<section class="see-also" style="display: inline-block;">
-<h1>{% trans "Other versions" %}:</h1>
-{% for rel in book.other_versions %}
-    {% ssi_include 'catalogue_book_mini' pk=rel.pk %}
-{% endfor %}
-</section>
-{% endif %}
-
-<section class="see-also" style="display: inline-block;">
-<h2>{% trans "See also" %}:</h2>
-{% related_books book taken=book.other_versions|length %}
-</section>
-{% endspaceless %}
-
 
-
-{% with book.related_themes as themes %}
-{% if themes %}
-    <h2>{% trans "Themes" %}</h2>
-    {% plain_list themes book=book %}
-{% endif %}
-{% endwith %}
-
-
-
-<h2>{% trans "Information about the work" %}</h2>
-{% for tag in tags %}
+{% block body %}
+  {% include 'catalogue/book_wide.html' %}
+
+  {% work_list book_children %}
+
+  {% spaceless %}
+    {% if book.other_versions %}
+      <section class="see-also">
+        <h1>{% trans "Other versions" %}:</h1>
+        {% for rel in book.other_versions %}
+         {{ 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 %}
+    </section>
+  {% endspaceless %}
+
+  {% with book.related_themes as themes %}
+    {% if themes %}
+      <h2>{% trans "Themes" %}</h2>
+      {% plain_list themes book=book %}
+    {% endif %}
+  {% endwith %}
+
+
+  <h2>{% trans "Information about the work" %}</h2>
+  {% for author in book.authors %}
+    <div class="white-box">
+      <a style="display:block" href="{{ author.get_absolute_url }}">
+       {% cache 86400 catalogue_tag_box author.pk %}
+          {% include 'catalogue/tag_box.html' with tag=author %}
+       {% endcache %}
+      </a>
+    </div>
+  {% endfor %}
+
+
+  {% 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 style="display:block" href="{{ tag.get_absolute_url }}">
-        {% ssi_include 'catalogue_tag_box' pk=tag.pk %}
-        </a>
+          <a href="{{ extra_info.source_url }}">{% trans "Source" %}</a> {% trans "of the book" %}
+          {% trans "in" %} {% source_name extra_info.source_url %}
         </div>
-{% 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 %}
-      <div class="white-box"><a href="{{ book.xml_file.url }}">{% trans "Source XML file" %}</a></div>
-      {% if extra_info.about and not hide_about %}
-      <div class="white-box">{% trans "Book on" %} <a href="{{ extra_info.about }}">{% trans "Editor's Platform" %}</a></div>
-      {% endif %}
-      {% if book.gazeta_link %}
-      <div class="white-box"><a href="{{ book.gazeta_link }}">{% trans "Book description on Lektury.Gazeta.pl" %}</a></div>
       {% endif %}
-      {% if book.wiki_link %}
-      <div class="white-box"><a href="{{ book.wiki_link }}">{% trans "Book description on Wikipedia" %}</a></div>
-      {% endif %}
-      <div class="white-box"><a href="{% url 'poem_from_book' book.slug %}">{% trans "Mix this book" %}</a></div>
-
-
-
+    {% endfor %}
+  {% if book|status:user != 'closed' %}
+    <div class="white-box"><a href="{{ book.xml_url }}">{% trans "Source XML file" %}</a></div>
+  {% endif %}
+  {% if extra_info.about and not hide_about %}
+    <div class="white-box">
+      {% trans "Book on" %} <a href="{{ extra_info.about }}">{% trans "Editor's Platform" %}</a>
+    </div>
+  {% endif %}
+  {% if book.wiki_link %}
+    <div class="white-box">
+      <a href="{{ book.wiki_link }}">{% trans "Book description on Wikipedia" %}</a>
+    </div>
+  {% endif %}
+  <div class="white-box">
+    <a href="{% url 'poem_from_book' book.slug %}">{% trans "Mix this book" %}</a>
+  </div>
+{% endwith %}
 
 {% endblock %}