{% endif %}
{% if widget.attrs.is_tabbed %}
{# Phase whose direct children are all labeled groups → render as inner tabs #}
{% set tablist_id = "phase-" ~ widget.path | replace('.','_') | replace('(','_') | replace(')','_') | replace(':','_') %}
{% set tab_children = widget.children | selectattr('type', 'equalto', 'group') | list %}
{% for child in tab_children %}
{% set tab_id = tablist_id ~ "-tab-" ~ loop.index0 %}
{% set panel_id = widget.path ~ "-tab-" ~ loop.index0 %}
{% endfor %}
{% for child in tab_children %}
{% set tab_id = tablist_id ~ "-tab-" ~ loop.index0 %}
{% set panel_id = widget.path ~ "-tab-" ~ loop.index0 %}
{% for subchild in child.children %}
{% set widget = subchild %}
{% include "widgets/" + subchild.type + ".html" ignore missing %}
{% endfor %}
{% endfor %}
{% else %}
{% for child in widget.children %}
{% set widget = child %}
{% include "widgets/" + child.type + ".html" ignore missing %}
{% endfor %}