{% set ns = namespace(current_group='') %}
{% for gi in gantt_items %}
{% set item = run.items[loop.index0] %}
{% set group = item.task.id.rsplit('.', 1)[0] if '.' in item.task.id else '' %}
{# Group header #}
{% if group != ns.current_group and group != '' %}
{% set ns.current_group = group %}
{{ group }}
{% elif group == '' and ns.current_group != '' %}
{% set ns.current_group = '' %}
{% endif %}
{# Task bar row #}
{# Label #}
{% if '.' in item.task.id %}{{ item.task.id.rsplit('.', 1)[1] }}{% else %}{{ item.task.id }}{% endif %}
{# Bar area #}
{# Vertical grid lines #}
{% for m in markers %}
{% if m.pct > 0 %}
{% endif %}
{% endfor %}
{% if gi.has_bar %}
{# Wait segment (submitted -> started) #}
{% if gi.wait_width > 0.1 %}
{% endif %}
{# Run segment #}
{% if gi.run_width > 0 %}
{% endif %}
{% else %}
{# Pending -- show a small marker at 0 #}
{% if gi.status == 'pending' %}
{% elif gi.status == 'dep_failed' %}
{% endif %}
{% endif %}