{% extends 'base.html.twig' %} {# @var userData \App\Entity\User #} {# @var form \Symfony\Component\Form\FormView #} {# @var isEditMode bool #} {% block title %}Ma page de profil | {{ parent() }}{% endblock %} {% block body %}
{# Affichage du formulaire (seulement en mode édition) #}
{% if isEditMode %} {{ form_start(form, {'attr': {'class': 'contents'}}) }} {% endif %} {# Colonne Photo #}
{% if userData.image %} {# Design avec photo #} Photo de profil {% else %} {# Design sans photo #}
{% endif %}

Ma photo

{# Gestion du dépôt d'un fichier image (Uniquement en mode édition) #} {% if isEditMode %}
{{ form_label(form.image, 'Choisir un fichier', { 'label_attr': {'class': 'block mb-2.5 text-sm font-medium text-gris-fonce'} }) }} {{ form_widget(form.image, { 'attr': { 'class': 'cursor-pointer bg-white border border-gris-clair text-text text-sm rounded-lg focus:outline-none focus:ring-1 focus:ring-bouton focus:border-bouton block w-full shadow-sm placeholder-gris-moyen file:mr-4 file:py-2.5 file:px-4 file:border-0 file:border-r file:border-gris-clair file:bg-gris-clair file:text-gris-fonce hover:file:bg-gris-moyen transition-colors', 'aria-describedby': 'file_input_help' } }) }}

JPG, JPEG, GIF ou PNG (Taille max : 8Mo).

{{ form_errors(form.image) }}
{% endif %}
{# Colonne Infos Persos #}
{# Gestion des boutons d'action (Modifier / Annuler) et des titres #}

Mon profil

{% if isEditMode %} ❌ Annuler {% else %} ✏️ Modifier {% endif %}

Mes informations personnelles

{# --- Gestion de l'affichage des informations personnelles --- #}
{# Identifiant #}
{% if isEditMode %} {{ form_widget(form.identifiantKaz, {'attr': {'class': 'w-full px-4 py-3 text-base bg-gray-100 border border-gris-clair rounded-lg text-gray-500 cursor-not-allowed'}}) }} {% else %}
{{ userData.identifiantKaz ?? 'Non défini' }}
{% endif %}
{# --- NOM et Prénom --- #}
{# NOM #}
{% if isEditMode %} {{ form_widget(form.lastName, {'attr': {'class': 'w-full px-4 py-3 text-base bg-gray-100 border border-gris-clair rounded-lg text-gray-500 cursor-not-allowed'}}) }}
{{ form_errors(form.lastName) }}
{% else %}
{{ userData.lastName }}
{% endif %}
{# Prénom #}
{% if isEditMode %} {{ form_widget(form.firstName, {'attr': {'class': 'w-full px-4 py-3 text-base bg-gray-100 border border-gris-clair rounded-lg text-gray-500 cursor-not-allowed'}}) }}
{{ form_errors(form.firstName) }}
{% else %}
{{ userData.firstName }}
{% endif %}
{# Téléphone #}
{% if isEditMode %} {{ form_widget(form.telephone, {'attr': {'class': 'w-full px-4 py-3 text-base bg-white border border-gris-clair rounded-lg focus:outline-none focus:border-bouton focus:ring-1 focus:ring-bouton placeholder-gris-moyen transition-shadow'}}) }}
{{ form_errors(form.telephone) }}
{% else %}
{{ userData.telephone ?? 'Non renseigné' }}
{% endif %}
{# E-mail #}
{% if isEditMode %} {{ form_widget(form.email, {'attr': {'class': 'w-full px-4 py-3 text-base bg-gray-100 border border-gris-clair rounded-lg text-gray-500 cursor-not-allowed'}}) }}
{{ form_errors(form.email) }}
{% else %}
{{ userData.email }}
{% endif %}
{# E-mail de secours #}
{% if isEditMode %} {{ form_widget(form.alternateEmail, {'attr': {'class': 'w-full px-4 py-3 text-base bg-white border border-gris-clair rounded-lg focus:outline-none focus:border-bouton focus:ring-1 focus:ring-bouton placeholder-gris-moyen transition-shadow'}}) }}
{{ form_errors(form.alternateEmail) }}
{% else %}
{{ userData.alternateEmail ?? 'Non renseigné' }}
{% endif %}
{# Quota Email #}
{% if isEditMode %} {{ form_widget(form.emailQuota, {'attr': {'class': 'w-full px-4 py-3 text-base bg-gray-100 border border-gris-clair rounded-lg text-gray-500 cursor-not-allowed'}}) }} {% else %}
{{ userData.emailQuota ?? 'Non défini' }}
{% endif %}
{# Quota Nextcloud #}
{% if isEditMode %} {{ form_widget(form.nextcloudQuota, {'attr': {'class': 'w-full px-4 py-3 text-base bg-gray-100 border border-gris-clair rounded-lg text-gray-500 cursor-not-allowed'}}) }} {% else %}
{{ userData.nextcloudQuota ?? 'Non défini' }}
{% endif %}
{# --- Gestion de l'affichage des checkbox des différents accès --- #}
{# Accès Nextcloud #}
{% if isEditMode %} {{ form_widget(form.hasNextcloudAccess, {'attr': {'class': 'w-5 h-5 text-bouton border-gris-clair rounded focus:ring-bouton cursor-not-allowed opacity-60'}}) }} {{ form_label(form.hasNextcloudAccess, null, {'label_attr': {'class': 'text-base font-medium text-text'}}) }} {% else %} {% if userData.hasNextcloudAccess %}✅{% else %}❌{% endif %} Accès Nextcloud {% endif %}
{# Accès Mobilizon #}
{% if isEditMode %} {{ form_widget(form.hasMobilizon, {'attr': {'class': 'w-5 h-5 text-bouton border-gris-clair rounded focus:ring-bouton cursor-not-allowed opacity-60'}}) }} {{ form_label(form.hasMobilizon, null, {'label_attr': {'class': 'text-base font-medium text-text'}}) }} {% else %} {% if userData.hasMobilizon %}✅{% else %}❌{% endif %} Accès Mobilizon {% endif %}
{# Accès Agora #}
{% if isEditMode %} {{ form_widget(form.hasAgoraAccess, {'attr': {'class': 'w-5 h-5 text-bouton border-gris-clair rounded focus:ring-bouton cursor-not-allowed opacity-60'}}) }} {{ form_label(form.hasAgoraAccess, null, {'label_attr': {'class': 'text-base font-medium text-text'}}) }} {% else %} {% if userData.hasAgoraAccess %}✅{% else %}❌{% endif %} Accès Agora {% endif %}
{# Affichage du bouton "Valider" (seulement en mode édition) #} {% if isEditMode %}
{% endif %}
{# Fermuture du formulaire (seulement en mode édition) #} {% if isEditMode %} {{ form_end(form) }} {% endif %}
{% endblock %}