{% load i18n %}
{% block form_container %}
    <form
        id="{{ form_name }}"
        class="form-default {% if not validation_disabled %}validate-form{% endif %} {% if not ajax_disabled %}ajax-form{% endif %} {{ class }} {% block form_additional_classes %}{% endblock form_additional_classes %}"
        method="{{ method|default:"POST" }}"
        {% if not validation_disabled %}novalidate="novalidate"{% endif %}
        data-success-data-layer-event="{% if data_layer_event %}{{data_layer_event}}{% else %}form.sent{% endif %}"
        data-success-data-layer-event-identifier="{% if action %}{{action}}{% else %}{{ request.get_full_path }}{% endif %}"
        {% if success_url %}data-success-url="{{success_url}}"{% endif %}
        {% if ajax_response_container_id %}data-ajax-response-container-id="{{ ajax_response_container_id }}"{% endif %}
        {% if action %}action="{{ action }}"{% endif %}
        {% if includes_files %}enctype="multipart/form-data"{% endif %}
        {% block form_additional_attributes %}{% endblock form_additional_attributes %}
        >

        {# utility block #}
        {% block form_inner_before %}{% endblock form_inner_before %}

        {% block csrf_token_container %}
            {% if csrf_token_value %}
                <input type='hidden' name='csrfmiddlewaretoken' value='{{ csrf_token_value }}'/>
            {% else %}
                {% if not method == "get" %}{% csrf_token %}{% endif %}
            {% endif %}
        {% endblock csrf_token_container %}

        {% block form_heading_container %}
            {% if form_title %}
                <div class="form-heading-container">
                    <h2 class="heading">{{form_title}}</h2>
                </div>
            {% endif %}
        {% endblock form_heading_container %}

        {% block form_fields_main_container %}
            <div class="form-fields-container">
                {% block form_fields_container %}
                    {% include 'partials/forms/form_fields.html' with nolabel=nolabel|default:False %}
                {% endblock form_fields_container %}

                {% block form_btn_container %}
                    <div class="form-group btn-container">
                        {# utility block #}
                        {% block form_btn_container_before %}{% endblock form_btn_container_before %}
                        <button class="{% block form_submit_btn_classes_container %}btn btn-{% block form_submit_btn_variation %}default{% endblock form_submit_btn_variation %}{% endblock form_submit_btn_classes_container %}" name="submit" type="submit">
                            {% include 'partials/buttons/link_text.html' with link_label=cta|default:'Submit' %}
                        </button>
                        {% if close_btn_enabled %}
                            <button class="{% block form_close_btn_classes_container %}btn btn-{% block form_close_btn_variation %}default{% endblock form_close_btn_variation %}{% endblock form_close_btn_classes_container %}" name="submit" type="submit" data-close-form-modal>
                                {% trans "Close" as close_label %}
                                {% include 'partials/buttons/link_text.html' with link_label=close_label %}
                            </button>
                        {% endif %}
                        {# utility block #}
                        {% block form_btn_container_after %}{% endblock form_btn_container_after %}
                    </div>
                {% endblock form_btn_container %}
            </div>
        {% endblock form_fields_main_container %}

        {# utility block #}
        {% block form_inner_after %}{% endblock form_inner_after %}

    </form>
{% endblock form_container %}
