{% extends 'layout.twig' %}

{% block body %}
    <div class="contenu clearfix">
        <H1>{{ 'Profils d\'import' | trad }}</H1>
        {{ ariane() }}
        <form method="post" name="da_model" id="importUniverselForm" action="{{ path('Stock.ImportUniversel.nouveau') }}">
            <h2 class="mb-base">
                {{ 'Création d\'un profil d\'import' | trad }}
                <button type="submit" class="principal button last button_right">
                    {{ 'Créer' | trad }}
                </button>
                <a href="{{ path('Stock.ImportUniversel.gestion') }}" class="secondaire button button_right">
                    {{  'Annuler' | trad }}
                </a>
            </h2>
            <div class="tab-content">
                <div class="tab-pane active in clearfix padding_form bg_form border_form">
                    <div class="colonne2">
                        <div class="row mb-0">
                            {{ inputAdvance('TEXT', { 'titre': 'Code modèle' | trad, 'name': 'DA_MODEL[COD_MDLE]', 'obligatoire': true }) }}
                        </div>
                    </div>
                    <div class="colonne2 last">
                        <div class="row mb-0">
                            {{ inputAdvance('TEXT', { 'titre': 'Libellé' | trad, 'name': 'DA_MODEL[LIBELLE]', 'obligatoire': true }) }}
                        </div>
                    </div>
                </div>
            </div>
        </form>
    </div>

    <script type="application/javascript" src="{{ baseUrl('js/Modules/Stock/postAjaxForm.js') }}"></script>
    <script type="application/javascript">
        $('#importUniverselForm').on('submit', (event) => {
            event.preventDefault();

            activeLoader();
            const form = $('#importUniverselForm');
            submitForm(form, form.serializeArray());
        });
    </script>
{% endblock %}