{% extends app.request.xmlHttpRequest ? 'form.html.twig' : 'base.html.twig' %}
{% import "system-configuration/actions.html.twig" as actions %}

{% block page_title %}{{ 'menu.system_configuration'|trans }}{% endblock %}
{% block page_actions %}{{ actions.system_configuration('index') }}{% endblock %}

{% block main %}

    {% set formEditTemplate = app.request.xmlHttpRequest ? 'default/_form_modal.html.twig' : 'default/_form.html.twig' %}

    {% for section in sections %}
        {% set title = section.model.translation|trans({}, section.model.translationDomain) %}
        {% if title == section.model.translation %}
            {% set title = ('label.' ~ section.model.section)|trans %}
        {% endif %}
        {{ include(formEditTemplate, {
            'title': title,
            'form': section.form,
        }) }}
    {% endfor %}

{% endblock %}
