book previews - draft (no payments yet)
[wolnelektury.git] / src / catalogue / templates / catalogue / book_detail.html
index 4baec4b..26fe167 100644 (file)
@@ -13,7 +13,7 @@
 {% block bodyid %}book-detail{% endblock %}
 
 {% block body %}
-  {% cache 86400 book_wide book.pk %} {# book|status:user #}
+  {% cache 86400 book_wide book.pk book|status:user %}
     {% include 'catalogue/book_wide.html' %}
   {% endcache %}
 
@@ -62,7 +62,9 @@
       {% 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 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>