{% set groups = namespace(dynamic_header = False, static_header = False, import_header = False) %} {% set static_datasources = [] %} {% set dynamic_datasources = [] %} {% set imported_datasources = [] %} {% for datasource in datasources %} {% if datasources[datasource]["importable"] %} {{ imported_datasources.append(datasource) }} {% else %} {% if datasources[datasource].is_static %} {# is_static attribute not available; this needs to be reworked though we have few static datasources #} {{ static_datasources.append(datasource) }} {% else %} {{ dynamic_datasources.append(datasource) }} {% endif %} {% endif %} {% endfor %} {% for datasource in dynamic_datasources %} {% if not groups.dynamic_header %} {% set groups.dynamic_header = True %}{% endif %} {% endfor %} {% if groups.dynamic_header %}{% endif %} {% for datasource in imported_datasources %} {% if not groups.import_header %} {% set groups.import_header = True %}{% endif %} {% endfor %} {% if groups.import_header %}{% endif %} {% for datasource in static_datasources %} {% if not groups.static_header %} {% set groups.static_header = True %}{% endif %} {% endfor %} {% if groups.static_header %}{% endif %}