{% extends 'layout.twig' %}
{% block body %}
<section class="contenu">
    {% include '@Utilisateur/Common/Component/SubNavbar.twig' with {
        hasBackup: hasBackup,
        current_route: 'profile',
        onlyProfil : user.onlyProfil,
    } only %}

    
    <h2>{{ 'Mon profil' | trad }}</h2>
    {% include '@Utilisateur/Profile/_blockFormPassword.twig' with {
        user: user,
        formPassword: formPassword,
        isPasswordForSignActivated: isPasswordForSignActivated
    } only %}
    
    <div class="box-form my-base">
        {% include '@Administration/GestionUtilisateur/_formEditUser.twig' with {
            user: user,
            subject: user,
            form: formUser,
            modeModif:modeModif,
            form_attr: {
                action: path('Utilisateur.Profile.edit'),
                'data-onsuccess-goto': path('Utilisateur.Profile.formEdit')
            },
        } only %}
    </div>
</section>
<script>
const urlParams = new URLSearchParams(window.location.search);
const messageType = urlParams.get('message');
if (messageType == 'pwd_success') {
    window.history.replaceState(null, '', window.location.pathname);
    activePopup(
        {{ 'Information' | trad | json }},
        {{ 'Votre mot de passe a été changé avec succès' | trad | json }},
        'modal_small'
    );
}
</script>
{% endblock %}

