convert some more ssi to template fragment cache
[wolnelektury.git] / src / catalogue / templates / catalogue / collection_box.html
1 {% spaceless %}
2   {% load i18n %}
3   {% load ssi_include from ssify %}
4   {% load cache %}
5   <div class="collection-box white-box">
6     <h2><a href="{{ collection.get_absolute_url }}">{% trans "Collection" %}: {{ collection }}</a></h2>
7     {% if collection.description %}
8       {{ collection.description|safe|truncatewords_html:40 }}
9     {% endif %}
10     {% for book in collection.get_books|slice:":5" %}
11       {% cache 86400 book_mini_box book.pk %}
12         {% include 'catalogue/book_mini_box.html' %}
13       {% endcache %}
14     {% endfor %}
15     {% with collection.get_books.count|add:-5 as more %}
16       {% if more > 0 %}
17         <a href="{{ collection.get_absolute_url }}">
18           {% blocktrans count c=more %}and one more{% plural %}and {{ c }} more{% endblocktrans %}
19         </a>
20       {% endif %}
21     {% endwith %}
22   </div>
23 {% endspaceless %}