{% extends 'base.html.twig' %} {% block title %}Paramètres - Bubul{% endblock %} {% block meta_description %}Configurez vos paramètres Bubul : gérez votre compte, connectez votre plateforme Moodle et personnalisez votre expérience.{% endblock %} {% block body %}
{# ================================================================ LAYOUT : sidebar gauche + contenu ================================================================ #}
{# ================================================================ SIDEBAR NAVIGATION ================================================================ #} {% include '_molecules/settings-nav/settings-nav.html.twig' with { user: user, activePage: 'settings' } only %} {# ================================================================ CONTENU PRINCIPAL ================================================================ #}
{# Titre de page #}
{% include '_molecules/page-header/page-header.html.twig' with { title: 'Paramètres', subtitle: 'Gérez votre compte et vos préférences', icon: 'settings', variant: 'default', class: 'pt-0' } only %}
{# ================================================================ CONTENU ================================================================ #}
{# Header #}
{% include '_atoms/icon/icon.html.twig' with { name: 'user', size: 'md', color: 'primary' } only %}

Informations du compte

Modifiez vos informations personnelles et votre mot de passe

{# Body #}
{# Section 1 : Informations personnelles #} {{ form_start(identityForm, {'attr': {'class': 'space-y-6', 'data-turbo': 'false'}}) }} {% do identityForm.firstName.setRendered() %} {% do identityForm.lastName.setRendered() %} {% do identityForm.email.setRendered() %}

Informations personnelles

{% include '_atoms/form/input.html.twig' with { type: 'text', name: identityForm.firstName.vars.full_name, id: identityForm.firstName.vars.id, label: 'Prénom', placeholder: 'Votre prénom', value: identityForm.firstName.vars.value, required: true } only %} {% include '_atoms/form/input.html.twig' with { type: 'text', name: identityForm.lastName.vars.full_name, id: identityForm.lastName.vars.id, label: 'Nom', placeholder: 'Votre nom', value: identityForm.lastName.vars.value, required: true } only %} {# Email éditable avec badge intégré #}
{% include '_atoms/form/input.html.twig' with { type: 'email', name: identityForm.email.vars.full_name, id: identityForm.email.vars.id, placeholder: 'votre@email.fr', value: identityForm.email.vars.value, required: true, icon: 'mail', iconPosition: 'left', class: 'pr-28' } only %}
{% if user.isEmailVerified %} {% include '_atoms/badge/badge.html.twig' with { label: 'Vérifié', variant: 'success', size: 'sm', icon: 'check' } only %} {% else %} {% include '_atoms/badge/badge.html.twig' with { label: 'Non vérifié', variant: 'warning', size: 'sm' } only %} {% endif %}
{% if user.hasPendingEmailChange %} {% include '_molecules/alert/alert.html.twig' with { title: 'Confirmation en attente', message: 'L\'adresse ' ~ user.pendingEmail ~ ' attend votre validation. Cliquez sur le lien reçu par email pour confirmer le changement.', variant: 'warning', size: 'sm' } only %} {% else %} {% include '_molecules/alert/alert.html.twig' with { message: 'Modifiez votre email et sauvegardez — un lien de confirmation vous sera envoyé.', variant: 'info', size: 'sm' } only %} {% endif %}
{% include '_atoms/button/button.html.twig' with { label: 'Sauvegarder', variant: 'primary', type: 'submit' } only %}
{{ form_end(identityForm) }} {# Section 2 : Changement de mot de passe #} {{ form_start(passwordForm, {'attr': {'class': 'space-y-6 pt-2', 'data-turbo': 'false'}}) }} {% do passwordForm.currentPassword.setRendered() %} {% do passwordForm.newPassword.setRendered() %} {% do passwordForm.newPasswordConfirm.setRendered() %}

Changer le mot de passe

Renseignez les champs ci-dessous pour modifier votre mot de passe

{% include '_atoms/form/input.html.twig' with { type: 'password', name: passwordForm.currentPassword.vars.full_name, id: passwordForm.currentPassword.vars.id, label: 'Mot de passe actuel', placeholder: 'Votre mot de passe actuel', required: true, icon: 'lock', iconPosition: 'left' } only %} {% include '_atoms/form/input.html.twig' with { type: 'password', name: passwordForm.newPassword.vars.full_name, id: passwordForm.newPassword.vars.id, label: 'Nouveau mot de passe', placeholder: 'Minimum ' ~ constant('App\\Config\\AppLimits::PASSWORD_MIN_LENGTH') ~ ' caractères', required: true, icon: 'lock', iconPosition: 'left' } only %} {% include '_atoms/form/input.html.twig' with { type: 'password', name: passwordForm.newPasswordConfirm.vars.full_name, id: passwordForm.newPasswordConfirm.vars.id, label: 'Confirmer le nouveau mot de passe', placeholder: 'Confirmez votre nouveau mot de passe', required: true, icon: 'key', iconPosition: 'left' } only %}
{% include '_atoms/button/button.html.twig' with { label: 'Changer le mot de passe', variant: 'primary', type: 'submit' } only %}
{{ form_end(passwordForm) }}
{# ================================================================ ZONE DANGEREUSE — dev uniquement ================================================================ #} {% if app.environment == 'dev' %}
{% include '_atoms/icon/icon.html.twig' with { name: 'trash', size: 'md', color: 'error' } only %}

Zone dangereuse

Ces actions sont irréversibles. Procédez avec précaution.

Supprimer mon compte

Supprime définitivement votre compte, vos cours, et toutes vos données.

{% include '_atoms/button/button.html.twig' with { label: 'Supprimer mon compte', variant: 'error', icon: 'trash', attr: { onclick: "openDeleteAccountModal()" } } only %}
{% endif %}{# /dev uniquement #}
{# /flex-1 contenu principal #}
{# /flex layout #}
{# ================================================================ MODAL: SUPPRESSION DE COMPTE — dev uniquement ================================================================ #} {% if app.environment == 'dev' %} {% embed '_molecules/modal/modal.html.twig' with { id: 'modal-delete-account', title: 'Supprimer mon compte', subtitle: 'Cette action est irréversible et ne peut pas être annulée.', variant: 'danger', size: 'lg' } %} {% block body %}

Tous vos cours, activités et données seront supprimés définitivement. Cette action ne peut pas être annulée.

{% endblock %} {% block footer %}
{% include '_atoms/button/button.html.twig' with { label: 'Annuler', variant: 'ghost', size: 'lg', type: 'button', attr: { onclick: "closeModal('modal-delete-account')" } } only %}
{% endblock %} {% endembed %} {% endif %}{# /dev uniquement #} {% endblock %}