{% load i18n %}
{% if view_type == 'table' %}
{% endif %}
{% if total_table %} {% if view_type == "table" %}
{% for item in total_table.values %} {# Top level row #} {% include "insights/fragments/overview/_row.html" with node=item is_root=True row_class="font-semibold" empty_label=level_1.empty search_path=item.search_path %} {# Second level rows #} {% if show_level_2 %} {% for child in item.children.values %} {% if child.name or item.children.values|length > 1 %} {% include "insights/fragments/overview/_row.html" with node=child row_class="bg-base-200" indent="ps-6" icon=level_2.icon empty_label=level_2.empty search_path=child.search_path %} {# Third level rows #} {% if show_level_3 %} {% for grandchild in child.children.values %} {% if grandchild.name or child.children.values|length > 1 %} {% include "insights/fragments/overview/_row.html" with node=grandchild row_class="bg-base-300" indent="ps-10" icon=level_3.icon empty_label=level_3.empty search_path=grandchild.search_path %} {% endif %} {% endfor %} {% endif %} {% endif %} {% endfor %} {% endif %} {% endfor %}
{{ level_1.singular }} {% trans 'Income' %} {% trans 'Expense' %} {% trans 'Total' %}
{% elif view_type == "bars" %}
{{ total_table|json_script:"overviewData" }} {% endif %} {% else %} {% endif %}