a lot of ui and flash message. Useless af
This commit is contained in:
@@ -11,6 +11,7 @@ framework:
|
|||||||
handler_id: null
|
handler_id: null
|
||||||
cookie_secure: auto
|
cookie_secure: auto
|
||||||
cookie_samesite: lax
|
cookie_samesite: lax
|
||||||
|
enabled: true
|
||||||
|
|
||||||
#esi: true
|
#esi: true
|
||||||
#fragments: true
|
#fragments: true
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ use App\Entity\Ville;
|
|||||||
use App\Repository\ParticipantRepository;
|
use App\Repository\ParticipantRepository;
|
||||||
use App\Repository\SiteRepository;
|
use App\Repository\SiteRepository;
|
||||||
use App\Repository\VilleRepository;
|
use App\Repository\VilleRepository;
|
||||||
|
use Doctrine\Common\Collections\Collection;
|
||||||
use Doctrine\ORM\EntityManagerInterface;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||||
use Symfony\Component\HttpFoundation\RedirectResponse;
|
use Symfony\Component\HttpFoundation\RedirectResponse;
|
||||||
@@ -245,13 +246,22 @@ class AdminController extends AbstractController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#[Route('/admin/user/export', name: 'participant_export')]
|
#[Route('/admin/user/export', name: 'participant_export')]
|
||||||
public function export(ParticipantRepository $participantRepository): Response
|
public function export(ParticipantRepository $participantRepository, Request $request): Response
|
||||||
{
|
{
|
||||||
$participants = $participantRepository->findAll();
|
// $participants = $participantRepository->findAll();
|
||||||
$csv = "Nom,Prénom,Pseudo,Téléphone,Email,Administrateur,Actif,Rôles,Password\n";
|
$userList = $request->request->all('userList');
|
||||||
|
if (empty($userList)) {
|
||||||
|
// Aucun utilisateur sélectionné
|
||||||
|
$this->addFlash('warning', 'Veuillez sélectionner au moins un utilisateur.');
|
||||||
|
return $this->redirectToRoute('app_adminUser');
|
||||||
|
}
|
||||||
|
$participants = $participantRepository->findBy([
|
||||||
|
'idParticipant' => $userList,
|
||||||
|
]);
|
||||||
|
$csv = "Nom,Prénom,Pseudo,Téléphone,Email,Administrateur,Actif,Rôles\n";
|
||||||
foreach ($participants as $participant) {
|
foreach ($participants as $participant) {
|
||||||
$csv .= sprintf(
|
$csv .= sprintf(
|
||||||
"%s,%s,%s,%s,%s,%s,%s,%s,%s\n",
|
"%s,%s,%s,%s,%s,%s,%s,%s\n",
|
||||||
$participant->getNom(),
|
$participant->getNom(),
|
||||||
$participant->getPrenom(),
|
$participant->getPrenom(),
|
||||||
$participant->getPseudo(),
|
$participant->getPseudo(),
|
||||||
@@ -260,7 +270,6 @@ class AdminController extends AbstractController
|
|||||||
$participant->isAdministrateur() ? '1' : '0',
|
$participant->isAdministrateur() ? '1' : '0',
|
||||||
$participant->isActif() ? '1' : '0',
|
$participant->isActif() ? '1' : '0',
|
||||||
implode('|', $participant->getRoles()),
|
implode('|', $participant->getRoles()),
|
||||||
$participant->getPassword()
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
$response = new Response($csv);
|
$response = new Response($csv);
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ class RegistrationController extends AbstractController
|
|||||||
$user->setRoles(['ROLE_USER']);
|
$user->setRoles(['ROLE_USER']);
|
||||||
$user->setActif(false);
|
$user->setActif(false);
|
||||||
$user->setPending(true);
|
$user->setPending(true);
|
||||||
|
$fullName = $form->get('nom')->getData() . " " . $form->get('prenom')->getData();
|
||||||
if ($user->getRoles() == 'ROLE_ADMIN') {
|
if ($user->getRoles() == 'ROLE_ADMIN') {
|
||||||
$user->setAdministrateur(true);
|
$user->setAdministrateur(true);
|
||||||
} else {
|
} else {
|
||||||
@@ -48,7 +49,7 @@ class RegistrationController extends AbstractController
|
|||||||
|
|
||||||
// do anything else you need here, like send an email
|
// do anything else you need here, like send an email
|
||||||
|
|
||||||
return $this->redirectToRoute('inscription');
|
return $this->render('main/inscription.html.twig', ['fullName' => $fullName]);
|
||||||
// return $security->login($user, 'form_login', 'main');
|
// return $security->login($user, 'form_login', 'main');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -17,16 +17,19 @@ use Symfony\Component\Security\Core\User\UserProviderInterface;
|
|||||||
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
|
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
|
||||||
use Symfony\Component\HttpFoundation\RedirectResponse;
|
use Symfony\Component\HttpFoundation\RedirectResponse;
|
||||||
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
|
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
|
||||||
|
use Symfony\Component\HttpFoundation\RequestStack;
|
||||||
|
|
||||||
class LoginFormAuthenticator extends AbstractAuthenticator
|
class LoginFormAuthenticator extends AbstractAuthenticator
|
||||||
{
|
{
|
||||||
private $entityManager;
|
private $entityManager;
|
||||||
private $urlGenerator;
|
private $urlGenerator;
|
||||||
|
private RequestStack $requestStack;
|
||||||
|
|
||||||
public function __construct(EntityManagerInterface $entityManager, UrlGeneratorInterface $urlGenerator)
|
public function __construct(EntityManagerInterface $entityManager, UrlGeneratorInterface $urlGenerator, RequestStack $requestStack)
|
||||||
{
|
{
|
||||||
$this->entityManager = $entityManager;
|
$this->entityManager = $entityManager;
|
||||||
$this->urlGenerator = $urlGenerator;
|
$this->urlGenerator = $urlGenerator;
|
||||||
|
$this->requestStack = $requestStack;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function supports(Request $request): ?bool
|
public function supports(Request $request): ?bool
|
||||||
@@ -46,12 +49,14 @@ class LoginFormAuthenticator extends AbstractAuthenticator
|
|||||||
'pseudo' => $identifier
|
'pseudo' => $identifier
|
||||||
]);
|
]);
|
||||||
|
|
||||||
if (!$user || $user->isActif() || $user->getPending()) {
|
if (!$user) {
|
||||||
throw new UserNotFoundException('Utilisateur non trouvé');
|
$this->addFlash('error', 'Utilisateur inexistant');
|
||||||
|
throw new AuthenticationException('Identifiant ou mot de passe incorrect.');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$user) {
|
if ($user->isActif() || $user->getPending()) {
|
||||||
throw new AuthenticationException('Identifiant ou mot de passe incorrect.');
|
$this->addFlash('error', "L'utilisateur à été désactivé par un administrateur ou est en attente.");
|
||||||
|
throw new UserNotFoundException('Utilisateur non trouvé');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Utilisation de UserBadge au lieu de Participant directement
|
// Utilisation de UserBadge au lieu de Participant directement
|
||||||
@@ -70,5 +75,13 @@ class LoginFormAuthenticator extends AbstractAuthenticator
|
|||||||
{
|
{
|
||||||
return new RedirectResponse($this->urlGenerator->generate('app_login'));
|
return new RedirectResponse($this->urlGenerator->generate('app_login'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private function addFlash(string $type, string $message): void
|
||||||
|
{
|
||||||
|
$session = $this->requestStack->getSession();
|
||||||
|
if ($session) {
|
||||||
|
$session->getFlashBag()->add($type, $message);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -11,8 +11,13 @@
|
|||||||
<h1 class="text-2xl font-semibold mb-4">Gestion des utilisateurs</h1>
|
<h1 class="text-2xl font-semibold mb-4">Gestion des utilisateurs</h1>
|
||||||
|
|
||||||
<!-- Actions: Import/Export -->
|
<!-- Actions: Import/Export -->
|
||||||
<div class="flex items-center justify-between mb-4">
|
<div class="flex flex-row items-center mb-4">
|
||||||
<form action="{{ path('participant_import') }}" method="post" enctype="multipart/form-data" class="flex items-center">
|
<form action="{{ path('participant_import') }}" method="post" enctype="multipart/form-data" class="flex items-center">
|
||||||
|
<button
|
||||||
|
type="submit"
|
||||||
|
class="bg-green-500 text-white mr-4 px-4 py-2 rounded hover:bg-green-600">
|
||||||
|
Importer CSV
|
||||||
|
</button>
|
||||||
<input
|
<input
|
||||||
type="file"
|
type="file"
|
||||||
name="csv_file"
|
name="csv_file"
|
||||||
@@ -23,78 +28,75 @@
|
|||||||
file:text-sm file:font-semibold
|
file:text-sm file:font-semibold
|
||||||
file:bg-gray-800 file:text-white
|
file:bg-gray-800 file:text-white
|
||||||
hover:file:bg-gray-700" />
|
hover:file:bg-gray-700" />
|
||||||
<button
|
|
||||||
type="submit"
|
|
||||||
class="bg-green-500 text-white px-4 py-2 rounded hover:bg-green-600">
|
|
||||||
Importer CSV
|
|
||||||
</button>
|
|
||||||
</form>
|
</form>
|
||||||
<button
|
<button
|
||||||
id="openModal"
|
id="openModal"
|
||||||
class="bg-green-600 text-white px-4 py-2 rounded hover:bg-green-700">
|
class="bg-green-600 text-white px-4 py-2 rounded hover:bg-green-700 items-end justify-end">
|
||||||
Ajouter un utilisateur
|
Ajouter un utilisateur
|
||||||
</button>
|
</button>
|
||||||
<button
|
|
||||||
type="submit"
|
|
||||||
class="bg-blue-500 text-white px-4 py-2 rounded hover:bg-blue-600">
|
|
||||||
<a href="{{ path('participant_export') }}">Exporter CSV</a>
|
|
||||||
</button>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Participants Table -->
|
<!-- Participants Table -->
|
||||||
<div class="overflow-x-auto bg-white rounded shadow">
|
<form method="POST" action="{{ path('participant_export') }}">
|
||||||
<table class="min-w-full bg-white divide-y divide-gray-200">
|
<button type="submit" class="bg-blue-500 text-white px-4 py-2 mb-4 rounded hover:bg-blue-600">
|
||||||
<thead class="bg-gray-50">
|
<a href="{{ path('participant_export') }}">Exporter CSV</a>
|
||||||
<tr>
|
</button>
|
||||||
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Nom</th>
|
<div class="overflow-x-auto bg-white rounded shadow">
|
||||||
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Prénom</th>
|
<table class="min-w-full bg-white divide-y divide-gray-200">
|
||||||
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Pseudo</th>
|
<thead class="bg-gray-50">
|
||||||
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Site</th>
|
|
||||||
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Téléphone</th>
|
|
||||||
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Email</th>
|
|
||||||
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Administrateur</th>
|
|
||||||
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Actif</th>
|
|
||||||
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Rôles</th>
|
|
||||||
<th class="px-6 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider">Actions</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody class="divide-y divide-gray-200">
|
|
||||||
{% for participant in participants %}
|
|
||||||
{% if not participant.pending %}
|
|
||||||
<tr>
|
<tr>
|
||||||
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">{{ participant.nom }}</td>
|
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"><input type="checkbox" id="selectAll" /></th>
|
||||||
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">{{ participant.prenom }}</td>
|
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Nom</th>
|
||||||
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">{{ participant.pseudo }}</td>
|
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Prénom</th>
|
||||||
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">{{ participant.site ? participant.site.nom : "N/A" }}</td>
|
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Pseudo</th>
|
||||||
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">{{ participant.telephone }}</td>
|
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Site</th>
|
||||||
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">{{ participant.email }}</td>
|
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Téléphone</th>
|
||||||
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">
|
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Email</th>
|
||||||
{{ participant.administrateur ? 'Oui' : 'Non' }}
|
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Administrateur</th>
|
||||||
</td>
|
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Actif</th>
|
||||||
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">
|
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Rôles</th>
|
||||||
{{ participant.actif ? 'Oui' : 'Non' }}
|
<th class="px-6 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider">Actions</th>
|
||||||
</td>
|
|
||||||
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">
|
|
||||||
{{ participant.roles|join(', ') }}
|
|
||||||
</td>
|
|
||||||
<td class="flex flex-row px-6 py-4 whitespace-nowrap items-center font-medium">
|
|
||||||
<a href="{{ path('app_adminUserDisable', {'id': participant.idParticipant}) }}" class="items-centerp pr-4">
|
|
||||||
<img src="{{ participant.actif ? asset('img/user-able.svg') : asset('img/user-disable.svg') }}" alt="Logo" height="32px" width="32px">
|
|
||||||
</a>
|
|
||||||
<a href="{{ path('app_adminUserDelete', {'id': participant.idParticipant}) }}" class="items-center">
|
|
||||||
<img src="{{ asset('img/user-delete.svg') }}" alt="Logo" height="32px" width="32px">
|
|
||||||
</a>
|
|
||||||
</td>
|
|
||||||
</tr>
|
</tr>
|
||||||
{% endif %}
|
</thead>
|
||||||
{% else %}
|
<tbody class="divide-y divide-gray-200">
|
||||||
<tr>
|
{% for participant in participants %}
|
||||||
<td colspan="8" class="px-6 py-4 text-center text-gray-500">Aucun participant trouvé</td>
|
{% if not participant.pending %}
|
||||||
</tr>
|
<tr>
|
||||||
{% endfor %}
|
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900"><span><input type="checkbox" value="{{ participant.idParticipant }}" name="userList[]"></span></td>
|
||||||
</tbody>
|
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">{{ participant.nom }}</td>
|
||||||
</table>
|
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">{{ participant.prenom }}</td>
|
||||||
</div>
|
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">{{ participant.pseudo }}</td>
|
||||||
|
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">{{ participant.site ? participant.site.nom : "N/A" }}</td>
|
||||||
|
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">{{ participant.telephone }}</td>
|
||||||
|
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">{{ participant.email }}</td>
|
||||||
|
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">
|
||||||
|
{{ participant.administrateur ? 'Oui' : 'Non' }}
|
||||||
|
</td>
|
||||||
|
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">
|
||||||
|
{{ participant.actif ? '❌' : '✔️' }}
|
||||||
|
</td>
|
||||||
|
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">
|
||||||
|
{{ participant.roles|join(', ') }}
|
||||||
|
</td>
|
||||||
|
<td class="flex flex-row px-6 py-4 whitespace-nowrap items-center font-medium">
|
||||||
|
<a href="{{ path('app_adminUserDisable', {'id': participant.idParticipant}) }}" class="items-centerp pr-4">
|
||||||
|
<img src="{{ participant.actif ? asset('img/user-able.svg') : asset('img/user-disable.svg') }}" alt="Logo" height="32px" width="32px">
|
||||||
|
</a>
|
||||||
|
<a href="{{ path('app_adminUserDelete', {'id': participant.idParticipant}) }}" class="items-center">
|
||||||
|
<img src="{{ asset('img/user-delete.svg') }}" alt="Logo" height="32px" width="32px">
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
{% endif %}
|
||||||
|
{% else %}
|
||||||
|
<tr>
|
||||||
|
<td colspan="8" class="px-6 py-4 text-center text-gray-500">Aucun participant trouvé</td>
|
||||||
|
</tr>
|
||||||
|
{% endfor %}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
|
||||||
{# Tableau user en attente #}
|
{# Tableau user en attente #}
|
||||||
<div class="overflow-x-auto bg-white rounded shadow mt-16">
|
<div class="overflow-x-auto bg-white rounded shadow mt-16">
|
||||||
@@ -157,52 +159,76 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Modale pour ajouter un user -->
|
<!-- Modale pour ajouter un user -->
|
||||||
<div id="userModal" class="fixed inset-0 z-50 hidden bg-gray-900 bg-opacity-50">
|
<div id="userModal" class="fixed inset-0 z-50 hidden bg-gray-900 bg-opacity-50">
|
||||||
<div class="flex justify-center items-center min-h-screen">
|
<div class="flex justify-center items-center min-h-screen">
|
||||||
<div class="bg-white p-6 rounded shadow-md w-1/3">
|
<div class="bg-white p-6 rounded shadow-md w-1/3">
|
||||||
<h2 class="text-xl font-semibold mb-4">Ajouter un utilisateur</h2>
|
<h2 class="text-xl font-semibold mb-4">Ajouter un utilisateur</h2>
|
||||||
<form id="addUserForm" method="POST" action="{{ path('app_adminUserAdd') }}">
|
<form id="addUserForm" method="POST" action="{{ path('app_adminUserAdd') }}">
|
||||||
<div class="mb-4">
|
<div class="mb-4">
|
||||||
<label for="nom" class="block text-sm font-medium text-gray-700">Nom</label>
|
<label for="nom" class="block text-sm font-medium text-gray-700">Nom</label>
|
||||||
<input id="nom" name="nom" type="text" class="mt-1 block w-full px-4 py-2 border rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500">
|
<input id="nom" name="nom" type="text" class="mt-1 block w-full px-4 py-2 border rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500">
|
||||||
</div>
|
</div>
|
||||||
<div class="mb-4">
|
<div class="mb-4">
|
||||||
<label for="prenom" class="block text-sm font-medium text-gray-700">Prénom</label>
|
<label for="prenom" class="block text-sm font-medium text-gray-700">Prénom</label>
|
||||||
<input id="prenom" name="prenom" type="text" class="mt-1 block w-full px-4 py-2 border rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500">
|
<input id="prenom" name="prenom" type="text" class="mt-1 block w-full px-4 py-2 border rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500">
|
||||||
</div>
|
</div>
|
||||||
<div class="mb-4">
|
<div class="mb-4">
|
||||||
<label for="pseudo" class="block text-sm font-medium text-gray-700">Pseudo *</label>
|
<label for="pseudo" class="block text-sm font-medium text-gray-700">Pseudo *</label>
|
||||||
<input id="pseudo" name="pseudo" type="text" class="mt-1 block w-full px-4 py-2 border rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500" required>
|
<input id="pseudo" name="pseudo" type="text" class="mt-1 block w-full px-4 py-2 border rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500" required>
|
||||||
</div>
|
</div>
|
||||||
<div class="mb-4">
|
<div class="mb-4">
|
||||||
<label for="phone" class="block text-sm font-medium text-gray-700">téléphone</label>
|
<label for="phone" class="block text-sm font-medium text-gray-700">téléphone</label>
|
||||||
<input id="phone" name="phone" type="text" class="mt-1 block w-full px-4 py-2 border rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500">
|
<input id="phone" name="phone" type="text" class="mt-1 block w-full px-4 py-2 border rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500">
|
||||||
</div>
|
</div>
|
||||||
<div class="mb-4">
|
<div class="mb-4">
|
||||||
<label for="mail" class="block text-sm font-medium text-gray-700">Email *</label>
|
<label for="mail" class="block text-sm font-medium text-gray-700">Email *</label>
|
||||||
<input id="mail" name="mail" type="text" class="mt-1 block w-full px-4 py-2 border rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500" required>
|
<input id="mail" name="mail" type="text" class="mt-1 block w-full px-4 py-2 border rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500" required>
|
||||||
</div>
|
</div>
|
||||||
<p>* Champ obligatoire</p>
|
<p>* Champ obligatoire</p>
|
||||||
<div class="flex justify-end">
|
<div class="flex justify-end">
|
||||||
<button type="submit" class="bg-blue-500 text-white px-4 py-2 rounded hover:bg-blue-700">Ajouter</button>
|
<button type="submit" class="bg-blue-500 text-white px-4 py-2 rounded hover:bg-blue-700">Ajouter</button>
|
||||||
<button type="button" id="closeModal" class="ml-2 bg-gray-500 text-white px-4 py-2 rounded hover:bg-gray-700">Annuler</button>
|
<button type="button" id="closeModal" class="ml-2 bg-gray-500 text-white px-4 py-2 rounded hover:bg-gray-700">Annuler</button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script>
|
|
||||||
// Ouvrir la modale manuellement
|
|
||||||
document.getElementById('openModal').addEventListener('click', function() {
|
|
||||||
document.getElementById('userModal').classList.remove('hidden');
|
|
||||||
});
|
|
||||||
|
|
||||||
// Fermer la modale
|
|
||||||
document.getElementById('closeModal').addEventListener('click', function() {
|
|
||||||
document.getElementById('userModal').classList.add('hidden');
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{# Modale import CSV#}
|
||||||
|
|
||||||
|
<script>
|
||||||
|
// Ouvrir la modale manuellement
|
||||||
|
document.getElementById('openModal').addEventListener('click', function() {
|
||||||
|
document.getElementById('userModal').classList.remove('hidden');
|
||||||
|
});
|
||||||
|
|
||||||
|
// Fermer la modale
|
||||||
|
document.getElementById('closeModal').addEventListener('click', function() {
|
||||||
|
document.getElementById('userModal').classList.add('hidden');
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
document.addEventListener('DOMContentLoaded', function () {
|
||||||
|
const selectAllCheckbox = document.getElementById('selectAll');
|
||||||
|
const checkboxes = document.querySelectorAll('input[type="checkbox"][name="userList[]"]');
|
||||||
|
|
||||||
|
// Ajouter un event listener à la checkbox globale
|
||||||
|
selectAllCheckbox.addEventListener('change', function () {
|
||||||
|
const isChecked = selectAllCheckbox.checked;
|
||||||
|
checkboxes.forEach(checkbox => {
|
||||||
|
checkbox.checked = isChecked;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
// Mettre à jour la checkbox globale si l'une des checkboxes change
|
||||||
|
checkboxes.forEach(checkbox => {
|
||||||
|
checkbox.addEventListener('change', function () {
|
||||||
|
const allChecked = Array.from(checkboxes).every(checkbox => checkbox.checked);
|
||||||
|
selectAllCheckbox.checked = allChecked;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
@@ -31,7 +31,7 @@
|
|||||||
<img alt="burger-menu" src="{{ asset('img/burger-menu.svg') }}">
|
<img alt="burger-menu" src="{{ asset('img/burger-menu.svg') }}">
|
||||||
</button>
|
</button>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<ul id="navbar" class="hidden absolute top-12 right-0 w-48 bg-white shadow-md p-4 flex-col space-y-4">
|
<ul id="navbar" class="hidden absolute top-20 right-0 w-max bg-white shadow-md p-4 pl-2 flex-col space-y-4">
|
||||||
<li><a href="{{ path('home') }}" class="text-gray-700 font-bold hover:text-blue-500">Accueil</a></li>
|
<li><a href="{{ path('home') }}" class="text-gray-700 font-bold hover:text-blue-500">Accueil</a></li>
|
||||||
{% if app.user %}
|
{% if app.user %}
|
||||||
<li><a href="{{ path('profile_view', {'uuid': app.user.idParticipant}) }}" class="text-gray-700 font-bold hover:text-blue-500">Mon profile</a></li>
|
<li><a href="{{ path('profile_view', {'uuid': app.user.idParticipant}) }}" class="text-gray-700 font-bold hover:text-blue-500">Mon profile</a></li>
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
{%block content %}
|
{%block content %}
|
||||||
<div class="flex justify-center items-center py-52">
|
<div class="flex justify-center items-center py-52">
|
||||||
<div class="bg-white shadow-lg rounded-lg p-8 max-w-md text-center">
|
<div class="bg-white shadow-lg rounded-lg p-8 max-w-md text-center">
|
||||||
<h3 class="text-2xl font-bold text-center pb-3">Bonjour,</h3>
|
<h3 class="text-2xl font-bold text-center pb-3">Bonjour, {{ fullName }}</h3>
|
||||||
<p class="text-gray-700 text-justify mb-4">Vous venez de vous inscrire à notre plateforme d'évenementiels. <br> Un administrateur traite votre demande d'inscription et va donner son verdict d'ici quelques instant.</p>
|
<p class="text-gray-700 text-justify mb-4">Vous venez de vous inscrire à notre plateforme d'évenementiels. <br> Un administrateur traite votre demande d'inscription et va donner son verdict d'ici quelques instant.</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user