{% extends 'config/base.html.j2' %}

{% block config_base %}
{% if is_xhr is not defined %}
<div id="page-config" class="config-page">
{% endif %}
    <form id="main-form" class="config-form" action="{{ request.fullpath }}" method="post" autocomplete="off" novalidate>
        {% include '_messages.html.j2' %}
        <input type="hidden" name="csrf_token" value="{{ get_csrf_token() }}">
        {% for section in form.sections %}
            {% if section.description %}
            <h4>{{ section.title|safe }}</h4>
            <p>{{ section.description|safe }}</p>
            {% endif %}
            {% for field in section.active_fields %}
                {% include '_field.html.j2' %}
            {% endfor %}
            <br />
        {% endfor %}
        <div id="{{ 'form-%s-buttons' % form.name }}" class="form-buttons">
            <a href="{{ request.fullpath }}" class="button grayed">{% trans %}Discard changes{% endtrans %}</a>
            <button type="submit" name="send" class="button">{% trans %}Save{% endtrans %}</button>
        </div>
    </form>
{% if is_xhr is not defined %}
</div>
{% endif %}
{% endblock %}
