diff --git a/src/Controller/UserController.php b/src/Controller/UserController.php
index 52e32c9..5d4b870 100644
--- a/src/Controller/UserController.php
+++ b/src/Controller/UserController.php
@@ -38,14 +38,6 @@ class UserController extends AbstractController
* @throws TransportExceptionInterface
*/
- #[Route('/user/{email}', name: 'app_user_by_mail', methods: ['GET'])]
- public function index(string $email, KazApiService $apiKazService): Response
- {
- $user = $apiKazService->getUserData($email);
- return $this->render('user/profil_infos.html.twig', [
- 'user' => $user,
- ]);
- }
#[Route('/mon-profil', name: 'app_user', methods: ['GET', 'POST'])]
#[IsGranted('ROLE_USER')]
public function showProfile(
diff --git a/src/Form/UserProfileType.php b/src/Form/UserProfileType.php
index 89eb761..ea9d01e 100644
--- a/src/Form/UserProfileType.php
+++ b/src/Form/UserProfileType.php
@@ -88,9 +88,9 @@ class UserProfileType extends AbstractType
'required' => false,
'constraints' => [
new Image(
- maxSize: '2M',
- extensions: ['jpg', 'jpeg', 'png'],
- extensionsMessage: 'Veuillez déposer une image JPG, JPEG ou PNG valide',)
+ maxSize: '8M',
+ extensions: ['jpg', 'jpeg', 'png', 'gif'],
+ extensionsMessage: 'Veuillez déposer une image JPG, JPEG, GIF ou PNG valide',)
],
])
;
diff --git a/templates/user/edit_password.html.twig b/templates/user/edit_password.html.twig
index 7f91286..4deec57 100644
--- a/templates/user/edit_password.html.twig
+++ b/templates/user/edit_password.html.twig
@@ -62,10 +62,12 @@
{# Bouton de validation #}
+
+ class="px-8 py-2.5 bg-bouton hover:bg-bouton-hover text-text text-sm font-bold rounded-lg shadow transition-colors">
Mettre à jour mon mot de passe
+
{{ form_end(form) }}
diff --git a/templates/user/index.html.twig b/templates/user/index.html.twig
index f2f6632..7b7dadf 100644
--- a/templates/user/index.html.twig
+++ b/templates/user/index.html.twig
@@ -1,41 +1,61 @@
{% 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': 'max-w-6xl mx-auto px-4 sm:px-6 lg:px-8 grid md:grid-cols-3 gap-8'}}) }}
- {% else %}
+ {% if isEditMode %}
+ {{ form_start(form, {'attr': {'class': 'contents'}}) }}
{% endif %}
{# Colonne Photo #}
-
-
- {% if userData.image %}
-
- {% else %}
-
👤
-
- {% endif %}
-
+
+
+ {% if userData.image %}
+ {# Design avec photo #}
+
+ {% else %}
+ {# Design sans photo #}
+
+ {% endif %}
-
Ma photo
+
Ma photo
- {# Affichage du champs "choisir en fichier" (seulement en mode édition) #}
+ {# 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'}
+
+ {{ form_label(form.image, 'Choisir un fichier', {
+ 'label_attr': {'class': 'block mb-2.5 text-sm font-medium text-gris-fonce'}
}) }}
-
JPG, JPEG ou PNG (Taille max : 2Mo).
-
{{ form_errors(form.image) }}
+ {{ 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 %}
@@ -64,16 +84,20 @@
Mes informations personnelles
+ {# --- Gestion de l'affichage des informations personnelles --- #}
{# Identifiant #}
-
Identifiant KAZ:
+
+ Identifiant Kaz :
+
{% if isEditMode %}
- {{ form_widget(form.identifiantKaz, {'attr': {'class': 'w-full px-4 py-3 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.identifiantKaz) }}
+ {{ 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 renseigné' }}
+ class="w-full px-4 py-3 text-base bg-gray-50 border border-gris-clair rounded-lg text-text">
+ {{ userData.identifiantKaz ?? 'Non défini' }}
+
{% endif %}
@@ -81,73 +105,167 @@
{# NOM #}
-
NOM :
+
+ NOM :
+
{% if isEditMode %}
- {{ form_widget(form.lastName, {'attr': {'class': 'w-full px-4 py-3 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.lastName) }}
+ {{ 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 }}
+ class="w-full px-4 py-3 text-base bg-gray-50 border border-gris-clair rounded-lg text-text">
+ {{ userData.lastName }}
+
{% endif %}
{# Prénom #}
-
Prénom :
+
+ Prénom :
+
{% if isEditMode %}
- {{ form_widget(form.firstName, {'attr': {'class': 'w-full px-4 py-3 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.firstName) }}
+ {{ 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 }}
+ class="w-full px-4 py-3 text-base bg-gray-50 border border-gris-clair rounded-lg text-text">
+ {{ userData.firstName }}
+
{% endif %}
{# Téléphone #}
-
Numéro de téléphone :
+
+ Numéro de téléphone :
+
{% if isEditMode %}
- {{ form_widget(form.telephone, {'attr': {'class': 'w-full px-4 py-3 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) }}
+ {{ 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é' }}
+ class="w-full px-4 py-3 text-base bg-gray-50 border border-gris-clair rounded-lg text-text">
+ {{ userData.telephone ?? 'Non renseigné' }}
+
{% endif %}
{# E-mail #}
-
E-mail :
+
+ E-mail :
+
{% if isEditMode %}
- {{ form_widget(form.email, {'attr': {'class': 'w-full px-4 py-3 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.email) }}
+ {{ 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 }}
+ class="w-full px-4 py-3 text-base bg-gray-50 border border-gris-clair rounded-lg text-text">
+ {{ userData.email }}
+
{% endif %}
{# E-mail de secours #}
-
E-mail de secours :
+
+ E-mail de secours :
+
{% if isEditMode %}
- {{ form_widget(form.alternateEmail, {'attr': {'class': 'w-full px-4 py-3 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) }}
+ {{ 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é' }}
+ class="w-full px-4 py-3 text-base bg-gray-50 border border-gris-clair rounded-lg text-text">
+ {{ userData.alternateEmail ?? 'Non renseigné' }}
+
{% endif %}
+ {# Quota Email #}
+
+
+ Espace disponible dans votre boîte mail :
+
+ {% 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 #}
+
+
+ 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 %}
-
+
+ class="px-8 py-2.5 bg-bouton hover:bg-bouton-hover text-text text-sm font-bold rounded-lg shadow transition-colors">
Enregistrer les modifications
@@ -157,9 +275,9 @@
{# Fermuture du formulaire (seulement en mode édition) #}
{% if isEditMode %}
- {{ form_end(form) }}
- {% else %}
+ {{ form_end(form) }}
+ {% endif %}
+
- {% endif %}
{% endblock %}
diff --git a/templates/user/profil_infos.html.twig b/templates/user/profil_infos.html.twig
deleted file mode 100644
index 509b430..0000000
--- a/templates/user/profil_infos.html.twig
+++ /dev/null
@@ -1,11 +0,0 @@
-{% extends 'base.html.twig' %}
-
-{% block title %}Ma page de profil | {{ parent() }}{% endblock %}
-
-{% block body %}
-
-
- Identifiant : {{ user.identifiantKaz }}
-
-
-{% endblock %}