{% if active_shelf == 'diary' and grouped_films %} {% for group in grouped_films %}

{{ group.month }}

{% for film in group.films %} {% include "_film_card.html" %} {% endfor %}
{% endfor %} {% else %} {% for film in films %} {% include "_film_card.html" %} {% endfor %} {% endif %}