{% extends "base.html" %} {% block title %}{{ title }} — {{ model.__class__.__name__ }}{% endblock %} {% block content %} {% if has_inputs %}
{% endif %} {% if empty_message %}
{{ empty_message }}
{% endif %} {% for row in rows %}
{% for comp in row %}
{% if comp.type == "stat" %}
{{ comp.value }}
{{ comp.label }}
{% elif comp.type == "input_group" and comp.orient == "vertical" %}
{% if comp.label %}

{{ comp.label }}

{% endif %}
{% for inp in comp.inputs %} {% if inp.is_scalar %}
{{ inp.formatted_value }}
{% else %}
{% for i in range(inp.periods | length) %}
{{ inp.periods[i] }} {% if inp.editable[i] %} {{ inp.formatted_values[i] }} {% else %} {{ inp.formatted_values[i] or "—" }} {% endif %}
{% endfor %}
{% endif %} {% endfor %}
{% elif comp.type == "input_group" and comp.orient == "horizontal" %}
{% if comp.label %}

{{ comp.label }}

{% endif %} {# Scalar inputs above the table if any #} {% set scalar_inputs = comp.inputs | selectattr("is_scalar") | list %} {% if scalar_inputs %}
{% for inp in scalar_inputs %}
{{ inp.formatted_value }}
{% endfor %}
{% endif %} {# Period inputs as a table — years across the top #} {% set period_inputs = comp.inputs | rejectattr("is_scalar") | list %} {% if period_inputs %}
{% for p in comp.periods %} {% endfor %} {% for inp in period_inputs %} {% for i in range(inp.periods | length) %} {% endfor %} {% for fv in inp.formatted_values %} {% endfor %} {% endfor %}
Input{{ p }}
{{ inp.label }} {% if inp.editable[i] %} {% else %} {{ inp.formatted_values[i] or "—" }} {% endif %}
Current{{ fv }}
{% endif %}
{% elif comp.type == "chart" %}

{{ comp.ref }}

{% elif comp.type == "table" %}

{{ comp.table_title }}

{% if comp.download_url %} {% endif %}
{{ comp.html | safe }}
{% endif %}
{% endfor %}
{% endfor %} {% if has_inputs %}
{% endif %} {% endblock %} {% block scripts %} {% endblock %}