{% if block.illustration %}
{% set ns = namespace(period_links=[]) %} {% if block.primary_links %} {% for link in block.primary_links %} {% if link.period %} {% set ns.period_links = ns.period_links + [link] %} {% endif %} {% endfor %} {% endif %} {% if ns.period_links %} {% set active_period_link = ns.period_links | selectattr('active') | list | first %} {% if not active_period_link %} {% set active_period_link = ns.period_links[0] %} {% endif %} {% endif %}

{{ block.title }}

{% if block.subtitle %}

{% if block.subtitle_lines %} {% for line in block.subtitle_lines %} {{ line }} {% endfor %} {% else %} {{ block.subtitle }} {% endif %}

{% endif %}
{% if block["items"] %}
{% for item in block["items"] %}
{{ item.label }}
{% if item.metric %}
{{ item.value }}
{% if item.trend %} {% set progress_trend_tones = { 'bg-success': 'text-success', 'bg-danger': 'text-danger', 'bg-warning': 'text-warning', 'bg-info': 'text-info', 'bg-secondary': 'text-secondary', 'bg-primary': 'text-primary' } %} {% set trend_tone = progress_trend_tones.get( item.progress_tone, 'text-secondary' if item.trend.direction == 'neutral' else 'text-green' if item.trend.direction == 'up' else 'text-red' ) %} {{ '%g' | format(item.trend.percentage) }}% {% if item.trend.direction == 'up' %} {% elif item.trend.direction == 'down' %} {% else %} {% endif %} {% endif %}
{% else %} {{ item.value }} {% endif %}
{% if item.progress is defined %} {{ item.progress }}% {% endif %}
{% endfor %}
{% endif %} {% if block.primary_links %}
{% for link in block.primary_links %} {% if not link.period %} {{ link.label }} {% endif %} {% endfor %}
{% endif %}
{% if ns.period_links %}
{% endif %}
{{ block.illustration.alt }}
{% else %}

{{ block.title }}

{% if block.subtitle %}
{{ block.subtitle }}
{% endif %}
{% if block.primary_links %} {% set ns = namespace(period_links=[]) %} {% for link in block.primary_links %} {% if link.period %} {% set ns.period_links = ns.period_links + [link] %} {% endif %} {% endfor %} {% if ns.period_links %} {% set active_period_link = ns.period_links | selectattr('active') | list | first %} {% if not active_period_link %} {% set active_period_link = ns.period_links[0] %} {% endif %} {% endif %} {% endif %}
{% if block["items"] %}
{% for item in block["items"] %}
{{ item.label }}
{% if item.metric %}
{{ item.value }}
{% elif item.href %} {{ item.value }} {% else %} {{ item.value }} {% endif %}
{% if item.progress is defined %} {{ item.progress }}% {% endif %}
{% endfor %}
{% endif %} {% if block.primary_links %}
{% for link in block.primary_links %} {% if not link.period %} {{ link.label }} {% endif %} {% endfor %}
{% endif %}
{% endif %}