{% spaceless %} {% for task in tasks reversed %} {% if task|length > 1 %}
{% for sub_tree in task %}
{% include "automations/includes/history.html" with tasks=sub_tree %}
{% endfor %}
{% else %} {% include "automations/includes/history_item.html" with task=task %} {% endif %} {% endfor %} {% endspaceless %}