Don't generate HTML files for books with no text.
[wolnelektury.git] / wolnelektury / templates / catalogue / book_detail.html
index e6b5eb0..3174007 100644 (file)
@@ -1,5 +1,5 @@
 {% extends "base.html" %}
-{% load catalogue_tags %}
+{% load catalogue_tags pagination_tags %}
 
 {% block title %}Lektura {{ book.title }} w WolneLektury.pl{% endblock %}
 
             </ul>
         </div>
     
-        {% if book.children.all %}
+        {% if book_children %}
+        {% autopaginate book_children 10 %}
         <div id="book-children">
             <h2>Utwory składające się na ten utwór:</h2>
-            {% for book in book.children.all %}
-                <li><a href="{{ book.get_absolute_url }}">{{ book.title }}</a></li>
+            <ol>
+            {% for book in book_children %}
+                <li>{{ book.short_html }}</li>
             {% endfor %}
+            </ol>
         </div>
+        {% paginate %}
         {% endif %}
     
     </div>