{% set sections = {} %}
{% for field in fields %}
{% set parts = field.path.split('.') %}
{% set section = parts[0] if parts|length > 1 else 'general' %}
{% if section not in sections %}
{% set _ = sections.update({section: []}) %}
{% endif %}
{% set _ = sections[section].append(field) %}
{% endfor %}
{% for section, section_fields in sections.items() %}
{{ section }}
{% for field in section_fields %}
{% set current = values.get(field.path, field.default) %}
{% if field.type == 'bool' %}
{% elif field.type == 'int' %}
{% elif field.type == 'enum' and field.options %}
{% else %}
{% endif %}
{{ field.description }}