Categories
+-
+ {% set sorted = [] %}
+ {% for category in this.children.order_by('name') %}
+ {% set post_count = category.children.count() %}
+ {% if post_count > 0 %}
+ {% set _ = sorted.append((post_count, category)) %}
+ {% endif %}
+ {% endfor %}
+ {% for post_count, category in sorted|sort(attribute='0', reverse=True) %}
+ {% set last_post = category.children.order_by('-publication_date').first() %}
+
-
+
+
{{ category.name }}
+-
+
- Posts: +
- + {{ post_count }} + +
- Last post: +
- + + +
++ {% if last_post %} +++ {% endif %} +
+ {% endfor %}
+