From a6ef2a4d7b3fce5a1afa2b7ef3cfec3c625ccca4 Mon Sep 17 00:00:00 2001 From: afornerot Date: Sun, 29 Dec 2024 20:28:42 +0100 Subject: [PATCH] add member role --- src/Form/UserType.php | 1 + templates/Home/home.html.twig | 2 ++ templates/User/list.html.twig | 4 ++-- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Form/UserType.php b/src/Form/UserType.php index 04f5237..2157942 100644 --- a/src/Form/UserType.php +++ b/src/Form/UserType.php @@ -52,6 +52,7 @@ class UserType extends AbstractType if($options["mode"]!="profil") { $choices=[]; $choices['Administrateur']='ROLE_ADMIN'; + $choices['Membre']='ROLE_MEMBER'; $choices['Utilisateur']='ROLE_USER'; $builder->add('roles', diff --git a/templates/Home/home.html.twig b/templates/Home/home.html.twig index 3ed8643..0640015 100644 --- a/templates/Home/home.html.twig +++ b/templates/Home/home.html.twig @@ -273,12 +273,14 @@

Membres

{% for user in users %} + {% if user.hasRole('ROLE_MEMBER') %}
{{user.pseudo}}
+ {% endif %} {% endfor %} {% endif %} diff --git a/templates/User/list.html.twig b/templates/User/list.html.twig index 765aa1e..c87f8a9 100644 --- a/templates/User/list.html.twig +++ b/templates/User/list.html.twig @@ -49,8 +49,8 @@ UTILISATEURS Administrateur
{%elseif role=="ROLE_MODO" %} Modérateur
- {%elseif role=="ROLE_MASTER" %} - Master
+ {%elseif role=="ROLE_MEMBER" %} + Membre
{%elseif role=="ROLE_USER" %} Utilisateur
{%endif%}