{% from "macros.html" import render_field %}

{% block content_title %}{{ title }}{% endblock %}
{% block content_description %}{{ description }}{% endblock %}

{% block content %}
    {% set disabled_fields = [] %}
    {% set exclude_fields = [] %}
    {% for field in form.get_static_fields() %}
        {{ render_field(field, disabled_fields, exclude_fields) }}
    {% endfor %}
    {% if form.get_dynamic_fields is defined %}
        {% for collection_name, fields in form.get_dynamic_fields().items() %}
            {% if fields|length > 0 %}
                <h4 class="mt-4">{{ collection_name }}</h4>
            {% endif %}
            {% for field in fields %}
                {{ render_field(field, disabled_fields, exclude_fields) }}
            {% endfor %}
        {% endfor %}
    {% endif %}
    <div class="btn-group mt-3">
        <button type="submit" class="btn btn-primary component-submit">{{ submit_text }}</button>
        <button type="button" class="btn btn-secondary ms-2" id="cancelEdit">Cancel</button>
    </div>
{% endblock %}

{% block content_footer %}
{% endblock %}