Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c7cc6b20a0 | ||
|
|
2e89691ade | ||
|
|
42db692853 | ||
|
|
df68d55e5c |
@@ -1,4 +1,5 @@
|
||||
@import url('https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,400;0,600;1,400;1,600&display=swap');
|
||||
@import "button.css";
|
||||
|
||||
@tailwind base;
|
||||
@tailwind components;
|
||||
|
||||
91
assets/styles/button.css
Normal file
@@ -0,0 +1,91 @@
|
||||
.btnPrimary {
|
||||
@apply bg-[#2a8d57] text-white font-bold py-2 px-4 border-b-4 rounded transition-all duration-300 ease-in-out;
|
||||
|
||||
/* Bordure */
|
||||
border-color: #1e7a43;
|
||||
|
||||
/* Survol */
|
||||
&:hover {
|
||||
@apply bg-[#1e7a43] border-[#155d2e];
|
||||
}
|
||||
|
||||
/* Clique (État actif) */
|
||||
&:active {
|
||||
@apply bg-[#1b6b38] border-[#155d2e];
|
||||
}
|
||||
|
||||
/* Focus (État focus) */
|
||||
&:focus {
|
||||
outline: none;
|
||||
box-shadow: 0 0 0 4px rgba(42, 141, 87, 0.5);
|
||||
}
|
||||
}
|
||||
|
||||
.btnSecondary {
|
||||
@apply bg-[#2f4858] text-white font-bold py-2 px-4 border-b-4 rounded transition-all duration-300 ease-in-out;
|
||||
|
||||
/* Bordure */
|
||||
border-color: #1e3c46;
|
||||
|
||||
/* Survol */
|
||||
&:hover {
|
||||
@apply bg-[#1e3c46] border-[#16323a];
|
||||
}
|
||||
|
||||
/* Clique (État actif) */
|
||||
&:active {
|
||||
@apply bg-[#193d49] border-[#16323a];
|
||||
}
|
||||
|
||||
/* Focus (État focus) */
|
||||
&:focus {
|
||||
outline: none;
|
||||
box-shadow: 0 0 0 4px rgba(47, 72, 88, 0.5);
|
||||
}
|
||||
}
|
||||
|
||||
.btnThird {
|
||||
@apply bg-[#c0ab4d] text-white font-bold py-2 px-4 border-b-4 rounded transition-all duration-300 ease-in-out;
|
||||
|
||||
/* Bordure */
|
||||
border-color: #b0a139;
|
||||
|
||||
/* Survol */
|
||||
&:hover {
|
||||
@apply bg-[#b0a139] border-[#9a8b2b];
|
||||
}
|
||||
|
||||
/* Clique (État actif) */
|
||||
&:active {
|
||||
@apply bg-[#9a8b2b] border-[#6f6a1c];
|
||||
}
|
||||
|
||||
/* Focus (État focus) */
|
||||
&:focus {
|
||||
outline: none;
|
||||
box-shadow: 0 0 0 4px rgba(192, 171, 77, 0.5);
|
||||
}
|
||||
}
|
||||
|
||||
.btnAnnule {
|
||||
@apply bg-[#d54f45] text-white font-bold py-2 px-4 border-b-4 rounded transition-all duration-300 ease-in-out;
|
||||
|
||||
/* Bordure */
|
||||
border-color: #a73a2d;
|
||||
|
||||
/* Survol */
|
||||
&:hover {
|
||||
@apply bg-[#a73a2d] border-[#8b2d1e];
|
||||
}
|
||||
|
||||
/* Clique (État actif) */
|
||||
&:active {
|
||||
@apply bg-[#90271e] border-[#8b2d1e];
|
||||
}
|
||||
|
||||
/* Focus (État focus) */
|
||||
&:focus {
|
||||
outline: none;
|
||||
box-shadow: 0 0 0 4px rgba(213, 79, 69, 0.5);
|
||||
}
|
||||
}
|
||||
@@ -28,5 +28,12 @@ services:
|
||||
arguments:
|
||||
$targetDirectory: '../public/upload/image/profile/'
|
||||
|
||||
App\EventListener\UserProfileListener:
|
||||
arguments:
|
||||
- '@security.token_storage'
|
||||
- '@twig'
|
||||
tags:
|
||||
- { name: 'kernel.event_subscriber' }
|
||||
|
||||
# add more service definitions when explicit configuration is needed
|
||||
# please note that last definitions always *replace* previous ones
|
||||
|
||||
BIN
public/img/default-placeholder.png
Normal file
|
After Width: | Height: | Size: 6.5 KiB |
BIN
public/img/sortie/67486f16d749f714047616.jpg
Normal file
|
After Width: | Height: | Size: 8.6 KiB |
BIN
public/img/sortie/6748776b50dd7956593274.jpg
Normal file
|
After Width: | Height: | Size: 8.6 KiB |
BIN
public/img/sortie/674877c384db5339345332.jpg
Normal file
|
After Width: | Height: | Size: 8.6 KiB |
BIN
public/img/sortie/67487aa8a2f87536902687.jpg
Normal file
|
After Width: | Height: | Size: 3.0 KiB |
BIN
public/upload/image/profile/telechargement-67487571ad685.jpg
Normal file
|
After Width: | Height: | Size: 3.0 KiB |
BIN
public/upload/image/profile/telechargement-674875c34500d.jpg
Normal file
|
After Width: | Height: | Size: 3.0 KiB |
BIN
public/upload/image/profile/telechargement-674875ed7e500.jpg
Normal file
|
After Width: | Height: | Size: 3.0 KiB |
@@ -44,16 +44,12 @@ class AdminController extends AbstractController
|
||||
]);
|
||||
}
|
||||
|
||||
//Gestion des utilisateurs
|
||||
#[Route('/admin/user', name: 'app_adminUser')]
|
||||
public function adminUser(TokenStorageInterface $tokenStorage): Response
|
||||
{
|
||||
$token = $tokenStorage->getToken();
|
||||
$userConnect = $token?->getUser();
|
||||
$participants = $this->participantRepository->findAll();
|
||||
$sites = $this->siteRepository->findAll();
|
||||
return $this->render('admin/user.html.twig', [
|
||||
'profile' => $userConnect,
|
||||
'participants' => $participants,
|
||||
'sites' => $sites,
|
||||
'controller_name' => 'AdminController',
|
||||
@@ -62,68 +58,56 @@ class AdminController extends AbstractController
|
||||
#[Route('/admin/user/disable/{id}', name: 'app_adminUserDisable')]
|
||||
public function disableParticipant(string $id, ParticipantRepository $participantRepository, EntityManagerInterface $entityManager): RedirectResponse
|
||||
{
|
||||
// Récupérer le participant à partir de l'id
|
||||
$participant = $participantRepository->find($id);
|
||||
|
||||
// Vérifier si le participant existe
|
||||
if (!$participant) {
|
||||
$this->addFlash('error', 'Le participant demandé n\'existe pas.');
|
||||
return $this->redirectToRoute('app_adminUser'); // Redirigez vers une liste ou une autre page
|
||||
return $this->redirectToRoute('app_adminUser');
|
||||
}
|
||||
|
||||
// Désactiver le participant (par exemple, définir une propriété "isActive" à false)
|
||||
if ($participant->isActif()){
|
||||
$participant->setActif(false);
|
||||
}else{
|
||||
$participant->setActif(true);
|
||||
}
|
||||
|
||||
// Sauvegarder la modification en base de données
|
||||
$entityManager->persist($participant);
|
||||
$entityManager->flush();
|
||||
|
||||
// Ajouter un message de succès et rediriger
|
||||
$this->addFlash('success', 'Participant désactivé avec succès.');
|
||||
return $this->redirectToRoute('app_adminUser');
|
||||
}
|
||||
#[Route('/admin/user/delete/{id}', name: 'app_adminUserDelete')]
|
||||
public function deleteUser(string $id, ParticipantRepository $participantRepository, EntityManagerInterface $entityManager): RedirectResponse
|
||||
{
|
||||
// Récupérer l'utilisateur ou le participant à partir de l'id
|
||||
$participant = $participantRepository->find($id);
|
||||
|
||||
// Vérifier si l'utilisateur existe
|
||||
if (!$participant) {
|
||||
$this->addFlash('error', 'L\'utilisateur demandé n\'existe pas.');
|
||||
return $this->redirectToRoute('app_adminUser'); // Redirigez vers une liste ou une autre page
|
||||
}
|
||||
|
||||
// Supprimer l'utilisateur
|
||||
$entityManager->remove($participant);
|
||||
$entityManager->flush();
|
||||
|
||||
// Ajouter un message de succès et rediriger
|
||||
$this->addFlash('success', 'Utilisateur supprimé avec succès.');
|
||||
return $this->redirectToRoute('app_adminUser'); // Redirigez vers la liste des utilisateurs
|
||||
return $this->redirectToRoute('app_adminUser');
|
||||
}
|
||||
#[Route('/admin/user/add', name: 'app_adminUserAdd', methods: ['POST'])]
|
||||
public function userAdd(Request $request, EntityManagerInterface $entityManager, MailerInterface $mailer, UrlGeneratorInterface $urlGenerator): Response
|
||||
{
|
||||
try {
|
||||
// Récupérer les données envoyées par le formulaire
|
||||
$nom = $request->request->get('nom');
|
||||
$prenom = $request->request->get('prenom');
|
||||
$pseudo = $request->request->get('pseudo');
|
||||
$telephone = $request->request->get('phone');
|
||||
$mail = $request->request->get('mail');
|
||||
|
||||
// Vérifier que les champs ne sont pas vides
|
||||
if (!$mail || !$pseudo) {
|
||||
$this->addFlash('error', 'Tous les champs sont requis.');
|
||||
return $this->redirectToRoute('app_adminUser');
|
||||
}
|
||||
|
||||
// Vérifier que le mail est valide avec une regex
|
||||
if (!filter_var($mail, FILTER_VALIDATE_EMAIL)) {
|
||||
$this->addFlash('error', 'L\'adresse e-mail n\'est pas valide.');
|
||||
return $this->redirectToRoute('app_adminUser');
|
||||
@@ -143,10 +127,8 @@ class AdminController extends AbstractController
|
||||
|
||||
$entityManager->persist($participant);
|
||||
|
||||
// Générer un token unique
|
||||
$token = bin2hex(random_bytes(32));
|
||||
|
||||
// Enregistrer le token dans la base de données
|
||||
$passwordResetToken = new PasswordResetToken();
|
||||
$passwordResetToken->setToken($token)
|
||||
->setEmail($participant->getEmail())
|
||||
@@ -155,14 +137,12 @@ class AdminController extends AbstractController
|
||||
$entityManager->persist($passwordResetToken);
|
||||
$entityManager->flush();
|
||||
|
||||
// Générer un lien de réinitialisation
|
||||
$resetLink = $urlGenerator->generate(
|
||||
'app_password_reset',
|
||||
['token' => $token],
|
||||
UrlGeneratorInterface::ABSOLUTE_URL
|
||||
);
|
||||
|
||||
// Envoyer un email de notification
|
||||
$email = (new Email())
|
||||
->from('contact@sortir.com')
|
||||
->to($participant->getEmail())
|
||||
@@ -208,10 +188,8 @@ class AdminController extends AbstractController
|
||||
$participant->setPending(true);
|
||||
$em->persist($participant);
|
||||
|
||||
// Générer un token unique
|
||||
$token = bin2hex(random_bytes(32));
|
||||
|
||||
// Enregistrer le token dans la base de données
|
||||
$passwordResetToken = new PasswordResetToken();
|
||||
$passwordResetToken->setToken($token)
|
||||
->setEmail($participant->getEmail())
|
||||
@@ -219,14 +197,12 @@ class AdminController extends AbstractController
|
||||
|
||||
$em->persist($passwordResetToken);
|
||||
|
||||
// Générer un lien de réinitialisation
|
||||
$resetLink = $urlGenerator->generate(
|
||||
'app_password_reset',
|
||||
['token' => $token],
|
||||
UrlGeneratorInterface::ABSOLUTE_URL
|
||||
);
|
||||
|
||||
// Envoyer un email de notification
|
||||
$email = (new Email())
|
||||
->from('contact@sortir.com')
|
||||
->to($participant->getEmail())
|
||||
@@ -255,7 +231,6 @@ class AdminController extends AbstractController
|
||||
// $participants = $participantRepository->findAll();
|
||||
$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');
|
||||
}
|
||||
@@ -282,7 +257,6 @@ class AdminController extends AbstractController
|
||||
return $response;
|
||||
}
|
||||
|
||||
//Gestion des sites
|
||||
#[Route('/admin/site', name: 'app_adminSite')]
|
||||
public function adminSite(SiteRepository $siteRepository, TokenStorageInterface $tokenStorage): Response
|
||||
{
|
||||
@@ -298,19 +272,15 @@ class AdminController extends AbstractController
|
||||
public function adminSiteAdd(Request $request, EntityManagerInterface $entityManager): Response
|
||||
{
|
||||
try {
|
||||
// Récupérer les données envoyées par le formulaire
|
||||
$nom = $request->request->get('nom');
|
||||
|
||||
// Vérifier que les champs ne sont pas vides
|
||||
if (!$nom) {
|
||||
return new Response('Tous les champs sont requis.', Response::HTTP_BAD_REQUEST);
|
||||
}
|
||||
|
||||
// Créer une nouvelle entité City et définir ses propriétés
|
||||
$site = new Site();
|
||||
$site->setNom($nom);
|
||||
|
||||
// Enregistrer la ville dans la base de données
|
||||
$entityManager->persist($site);
|
||||
$entityManager->flush();
|
||||
$this->addFlash('success', "Site ajouté !");
|
||||
@@ -323,17 +293,13 @@ class AdminController extends AbstractController
|
||||
#[Route('/admin/site/delete/{id}', name: 'app_adminSiteDelete')]
|
||||
public function adminSiteDelete(string $id, SiteRepository $siteRepository, EntityManagerInterface $entityManager): RedirectResponse
|
||||
{
|
||||
// Récupérer la ville à supprimer
|
||||
$site = $siteRepository->find($id);
|
||||
|
||||
// Vérifier si la ville existe
|
||||
if (!$site) {
|
||||
// Si la ville n'existe pas, rediriger avec un message d'erreur
|
||||
$this->addFlash('error', 'Le site demandée n\'existe pas.');
|
||||
return $this->redirectToRoute('app_adminSite'); // Rediriger vers la liste des villes
|
||||
}
|
||||
|
||||
// Supprimer la ville
|
||||
$entityManager->remove($site);
|
||||
$entityManager->flush();
|
||||
|
||||
|
||||
@@ -20,10 +20,8 @@ class LoginController extends AbstractController
|
||||
return $this->redirectToRoute('home'); // Redirection pour utilisateurs connectés
|
||||
}
|
||||
|
||||
// get the login error if there is one
|
||||
$error = $authenticationUtils->getLastAuthenticationError();
|
||||
|
||||
// last username entered by the user
|
||||
$lastUsername = $authenticationUtils->getLastUsername();
|
||||
$user = new Participant();
|
||||
$formUser = $this->createForm(RegistrationFormType::class, $user);
|
||||
@@ -38,7 +36,6 @@ class LoginController extends AbstractController
|
||||
#[Route(path: '/logout', name: 'app_logout')]
|
||||
public function logout(Security $security): ?Response
|
||||
{
|
||||
// throw new \LogicException('This method can be blank - it will be intercepted by the logout key on your firewall.');
|
||||
return $security->logout(false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,10 +17,7 @@ class MainController extends AbstractController
|
||||
#[Route('/', name: 'home')]
|
||||
public function home(SortieRepository $sortieRepository, TokenStorageInterface $tokenStorage,): Response
|
||||
{
|
||||
// Récupérer les 5 dernières sorties
|
||||
$latestSorties = $sortieRepository->findBy([], ['dateHeureDebut' => 'DESC'], 5);
|
||||
$token = $tokenStorage->getToken();
|
||||
$userConnect = $token?->getUser();
|
||||
$dateLimit = new \DateTime();
|
||||
$dateLimit->modify('-30 days'); // Date limite = il y a 30 jours
|
||||
|
||||
@@ -35,7 +32,6 @@ class MainController extends AbstractController
|
||||
|
||||
return $this->render('main/home.html.twig', [
|
||||
'lastSorties' => $latestSorties,
|
||||
'profile' => $userConnect,
|
||||
'pastEvents' => $pastEvents,
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -30,16 +30,13 @@ class PasswordResetController extends AbstractController
|
||||
try{
|
||||
$email = $request->request->get('email');
|
||||
|
||||
// Vérifier si l'email est valide
|
||||
if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
|
||||
$this->addFlash('error', 'Adresse e-mail invalide.');
|
||||
return $this->redirectToRoute('app_login');
|
||||
}
|
||||
|
||||
// Générer un token unique
|
||||
$token = bin2hex(random_bytes(32));
|
||||
|
||||
// Enregistrer le token dans la base de données
|
||||
$passwordResetToken = new PasswordResetToken();
|
||||
$passwordResetToken->setToken($token)
|
||||
->setEmail($email)
|
||||
@@ -55,7 +52,6 @@ class PasswordResetController extends AbstractController
|
||||
UrlGeneratorInterface::ABSOLUTE_URL
|
||||
);
|
||||
|
||||
// Envoyer l'email avec le lien
|
||||
$email = (new Email())
|
||||
->from('contact@sortir.com')
|
||||
->to($email)
|
||||
@@ -79,7 +75,6 @@ class PasswordResetController extends AbstractController
|
||||
Request $request,
|
||||
EntityManagerInterface $entityManager,
|
||||
): Response {
|
||||
// Vérifier si le token existe
|
||||
$repository = $entityManager->getRepository(PasswordResetToken::class);
|
||||
$passwordResetToken = $repository->findOneBy(['token' => $token]);
|
||||
|
||||
@@ -88,14 +83,11 @@ class PasswordResetController extends AbstractController
|
||||
return $this->redirectToRoute('app_login');
|
||||
}
|
||||
|
||||
// Si la requête est POST, traiter le nouveau mot de passe
|
||||
if ($request->isMethod('POST')) {
|
||||
$newPassword = $request->request->get('password');
|
||||
$newPasswordConfirm = $request->request->get('passwordConfirm');
|
||||
|
||||
// Vérifier si les mots de passe sont identiques
|
||||
if ($newPassword !== $newPasswordConfirm) {
|
||||
// Les mots de passe ne correspondent pas
|
||||
$this->addFlash('error', 'Les mots de passe ne correspondent pas.');
|
||||
return $this->redirectToRoute('app_password_reset'); // Vous pouvez rediriger vers la page de réinitialisation
|
||||
}
|
||||
@@ -105,7 +97,6 @@ class PasswordResetController extends AbstractController
|
||||
return $this->redirectToRoute('app_password_reset', ['token' => $token]);
|
||||
}
|
||||
|
||||
// Récupérer l'utilisateur et mettre à jour le mot de passe
|
||||
$user = $entityManager->getRepository(Participant::class)->findOneBy(['email' => $passwordResetToken->getEmail()]);
|
||||
$user->setPassword(password_hash($newPassword, PASSWORD_BCRYPT));
|
||||
|
||||
|
||||
@@ -27,7 +27,6 @@ class RegistrationController extends AbstractController
|
||||
/** @var string $plainPassword */
|
||||
$plainPassword = $form->get('plainPassword')->getData();
|
||||
|
||||
// encode the plain password
|
||||
$user->setPassword($userPasswordHasher->hashPassword($user, $plainPassword));
|
||||
$user->setRoles(['ROLE_USER']);
|
||||
$user->setActif(false);
|
||||
@@ -47,7 +46,6 @@ class RegistrationController extends AbstractController
|
||||
return $this->redirectToRoute('app_register');
|
||||
}
|
||||
|
||||
// do anything else you need here, like send an email
|
||||
|
||||
return $this->render('main/inscription.html.twig', ['fullName' => $fullName]);
|
||||
// return $security->login($user, 'form_login', 'main');
|
||||
|
||||
@@ -9,6 +9,7 @@ use App\Repository\EtatRepository;
|
||||
use App\Repository\LieuRepository;
|
||||
use App\Repository\ParticipantRepository;
|
||||
use App\Repository\SortieRepository;
|
||||
use App\Service\FileUploader;
|
||||
use DateTime;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use OpenAI\Factory;
|
||||
@@ -32,7 +33,6 @@ class SortieController extends AbstractController
|
||||
$token = $tokenStorage->getToken();
|
||||
$userConnect = $token?->getUser();
|
||||
|
||||
// Récupérer les paramètres de filtre
|
||||
$search = $request->query->get('search', '');
|
||||
$siteId = $request->query->get('site', '');
|
||||
$startDate = $request->query->get('start_date', '');
|
||||
@@ -42,7 +42,6 @@ class SortieController extends AbstractController
|
||||
$nonInscrit = $request->query->get('non_inscrit', false);
|
||||
$passees = $request->query->get('passees', false);
|
||||
|
||||
// Recherche par nom de sortie
|
||||
$sorties = $sortieRepository->findWithFilters($search, $siteId, $startDate, $endDate, $organisateur, $inscrit, $nonInscrit, $passees, $userConnect);
|
||||
|
||||
return $this->render('sortie/list.html.twig', [
|
||||
@@ -62,7 +61,6 @@ class SortieController extends AbstractController
|
||||
ParticipantRepository $participantRepository,
|
||||
EtatRepository $etatRepository
|
||||
): Response {
|
||||
// Vérifier si l'utilisateur est connecté
|
||||
$userConnect = $tokenStorage->getToken()?->getUser();
|
||||
if (!$userConnect) {
|
||||
$this->addFlash('error', 'Vous devez être connecté pour créer une sortie.');
|
||||
@@ -81,20 +79,17 @@ class SortieController extends AbstractController
|
||||
return $this->redirectToRoute('sortie_create');
|
||||
}
|
||||
|
||||
// Vérifier le participant (organisateur)
|
||||
$participant = $participantRepository->find($userConnect->getIdParticipant());
|
||||
if (!$participant) {
|
||||
$this->addFlash('error', 'Impossible de trouver votre profil.');
|
||||
return $this->redirectToRoute('sortie_create');
|
||||
}
|
||||
|
||||
// Gérer l'image (upload)
|
||||
$imageFile = $form->get('imageFile')->getData();
|
||||
if ($imageFile) {
|
||||
$sortie->setImageFile($imageFile);
|
||||
}
|
||||
|
||||
// Définir les relations et l'état initial
|
||||
$etat = $etatRepository->findOneBy(['libelle' => 'Créée']);
|
||||
if (!$etat) {
|
||||
$this->addFlash('error', 'Erreur interne : état introuvable.');
|
||||
@@ -114,7 +109,6 @@ class SortieController extends AbstractController
|
||||
}
|
||||
|
||||
return $this->render('sortie/create.html.twig', [
|
||||
'profile' => $userConnect,
|
||||
'form' => $form->createView(),
|
||||
'sortie' => $sortie,
|
||||
]);
|
||||
@@ -124,7 +118,6 @@ class SortieController extends AbstractController
|
||||
public function view(
|
||||
string $id,
|
||||
EntityManagerInterface $entityManager,
|
||||
TokenStorageInterface $tokenStorage
|
||||
): Response {
|
||||
$sortie = $entityManager->getRepository(Sortie::class)->find($id);
|
||||
if (!$sortie) {
|
||||
@@ -138,7 +131,6 @@ class SortieController extends AbstractController
|
||||
|
||||
return $this->render('sortie/view.html.twig', [
|
||||
'sortie' => $sortie,
|
||||
'profile' => $tokenStorage->getToken()?->getUser(),
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -232,10 +224,17 @@ class SortieController extends AbstractController
|
||||
$form->handleRequest($request);
|
||||
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
// Vérification et mise à jour du lieu
|
||||
$lieu = $form->get('lieu')->getData();
|
||||
if ($lieu) {
|
||||
$sortie->setLieu($lieu);
|
||||
}
|
||||
|
||||
$imageFile = $form->get('imageFile')->getData();
|
||||
if ($imageFile) {
|
||||
$sortie->setImageFile($imageFile);
|
||||
}
|
||||
|
||||
$entityManager->flush();
|
||||
|
||||
$this->addFlash('success', 'Les modifications ont été enregistrées.');
|
||||
|
||||
40
src/EventListener/UserProfileListener.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
namespace App\EventListener;
|
||||
|
||||
use Symfony\Component\HttpKernel\Event\RequestEvent;
|
||||
use Symfony\Component\HttpKernel\KernelEvents;
|
||||
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
|
||||
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
|
||||
use Twig\Environment;
|
||||
|
||||
class UserProfileListener implements EventSubscriberInterface
|
||||
{
|
||||
private $tokenStorage;
|
||||
private $twig;
|
||||
|
||||
public function __construct(TokenStorageInterface $tokenStorage, Environment $twig)
|
||||
{
|
||||
$this->tokenStorage = $tokenStorage;
|
||||
$this->twig = $twig;
|
||||
}
|
||||
|
||||
public function onKernelRequest(RequestEvent $event)
|
||||
{
|
||||
$token = $this->tokenStorage->getToken();
|
||||
|
||||
if ($token && $token->getUser()) {
|
||||
$profile = $token->getUser();
|
||||
$event->getRequest()->attributes->set('profile', $profile);
|
||||
|
||||
$this->twig->addGlobal('profile', $profile);
|
||||
}
|
||||
}
|
||||
|
||||
public static function getSubscribedEvents()
|
||||
{
|
||||
return [
|
||||
KernelEvents::REQUEST => 'onKernelRequest',
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -14,7 +14,7 @@
|
||||
<!-- Actions: Ajouter -->
|
||||
<div class="mb-4">
|
||||
<!-- Bouton pour ouvrir la modale -->
|
||||
<button id="openModal" class="inline-block bg-blue-500 text-white px-4 py-2 rounded hover:bg-blue-700">
|
||||
<button id="openModal" class="btnPrimary">
|
||||
Ajouter un site
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
<div class="flex flex-row mb-4 justify-between">
|
||||
<button
|
||||
id="openModal"
|
||||
class="bg-green-600 text-white px-4 py-2 rounded hover:bg-green-700 items-end justify-end">
|
||||
class="btnPrimary">
|
||||
Ajouter un utilisateur
|
||||
</button>
|
||||
</div>
|
||||
@@ -24,10 +24,10 @@
|
||||
<div class="flex flex-row">
|
||||
<button
|
||||
id="openModalCsv" type="button"
|
||||
class="bg-green-500 text-white mb-4 mr-4 px-4 py-2 rounded hover:bg-green-600">
|
||||
class="btnSecondary">
|
||||
Importer CSV
|
||||
</button>
|
||||
<button type="submit" class="bg-blue-500 text-white px-4 py-2 mb-4 rounded hover:bg-blue-600">
|
||||
<button type="submit" class="btnThird">
|
||||
<a href="{{ path('participant_export') }}">Exporter CSV</a>
|
||||
</button>
|
||||
</div>
|
||||
@@ -177,7 +177,7 @@
|
||||
</div>
|
||||
<p>* Champ obligatoire</p>
|
||||
<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="btnPrimary">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>
|
||||
</div>
|
||||
</form>
|
||||
@@ -205,7 +205,7 @@
|
||||
<div class="flex flex-row">
|
||||
<button
|
||||
type="submit"
|
||||
class="bg-green-500 text-white mr-4 px-4 py-2 rounded hover:bg-green-600">
|
||||
class="btnSecondary">
|
||||
Importer CSV
|
||||
</button>
|
||||
<button type="button" id="closeModalCsv" class="ml-2 bg-gray-500 text-white px-4 py-2 rounded hover:bg-gray-700">Annuler</button>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
{% extends 'main/base.html.twig' %}
|
||||
|
||||
{% block head %}
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
@@ -16,28 +17,29 @@
|
||||
<form action="{{ path('app_login') }}" method="post">
|
||||
<label class="text-gray-700 font-bold" for="username">Email ou pseudo</label>
|
||||
<input class="w-full mb-4 px-4 py-2 border-2 border-gray-300 rounded-lg focus:outline-none focus:border-blue-500" placeholder="Adresse e-mail ou pseudo" type="text" value="{{ last_username }}" name="username" id="username" autocomplete="email" required autofocus>
|
||||
|
||||
<div class="mb-4">
|
||||
<label class="text-gray-700 font-bold" for="password">Mot de passe</label>
|
||||
<input class="w-full mb-2 px-4 py-2 border-2 border-gray-300 rounded-lg focus:outline-none focus:border-blue-500" placeholder="Mot de passe" type="password" name="password" id="password" autocomplete="current-password" required>
|
||||
<a id="openModal" class="text-blue-500 text-sm hover:underline">Mot de passe oublié ?</a>
|
||||
</div>
|
||||
|
||||
<label>
|
||||
<input type="checkbox" name="_remember_me" checked>
|
||||
Se souvenir de moi
|
||||
</label>
|
||||
<input type="hidden" name="_csrf_token"
|
||||
value="{{ csrf_token('authenticate') }}"
|
||||
>
|
||||
|
||||
<input type="hidden" name="_csrf_token" value="{{ csrf_token('authenticate') }}">
|
||||
|
||||
<div class="flex flex-row justify-between">
|
||||
<button class=" text-white font-bold py-2 px-4 border-b-4 btnRegister rounded" type="submit">Se connecter</button>
|
||||
<button class="btnPrimary" type="submit">Se connecter</button>
|
||||
<a href="{{ path('app_register') }}">
|
||||
<button class=" text-white font-bold py-2 px-4 border-b-4 btnRegister rounded mx-auto" type="button">S'inscrire</button>
|
||||
<button class="btnSecondary" type="button">S'inscrire</button>
|
||||
</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<!-- Modale pour ajouter une ville -->
|
||||
<div id="resetModal" 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="bg-white p-6 rounded shadow-md w-1/3">
|
||||
@@ -49,8 +51,8 @@
|
||||
</div>
|
||||
|
||||
<div class="flex justify-end">
|
||||
<button type="submit" class="bg-blue-500 text-white px-4 py-2 rounded hover:bg-blue-700">Envoyer</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="submit" class="btnPrimary">Envoyer</button>
|
||||
<button type="button" id="closeModal" class="btnAnnule ml-2">Annuler</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@@ -58,16 +60,13 @@
|
||||
</div>
|
||||
|
||||
<script>
|
||||
// Ouvrir la modale
|
||||
document.getElementById('openModal').addEventListener('click', function() {
|
||||
document.getElementById('resetModal').classList.remove('hidden');
|
||||
});
|
||||
|
||||
// Fermer la modale
|
||||
document.getElementById('closeModal').addEventListener('click', function() {
|
||||
document.getElementById('resetModal').classList.add('hidden');
|
||||
});
|
||||
</script>
|
||||
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
{{ form_row(registrationForm.email) }}
|
||||
{{ form_row(registrationForm.pseudo) }}
|
||||
{{ form_row(registrationForm.plainPassword) }}
|
||||
<button class="btnRegister text-white font-bold py-2 px-4 border-b-4 rounded mx-auto" type="submit">S'inscrire</button>
|
||||
<button class="btnSecondary" type="submit">S'inscrire</button>
|
||||
{{ form_end(registrationForm) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -14,13 +14,11 @@
|
||||
</head>
|
||||
<body class="bg-gray-100">
|
||||
<nav class="flex justify-between items-center py-4 px-6 shadow-md bg-gradient-to-r from-[#2A8D57] via-[#008167] to-[#1B5667]">
|
||||
<!-- Logo et Titre -->
|
||||
<a href="/" class="flex items-center space-x-3">
|
||||
<img src="{{ asset('img/logo.svg') }}" alt="Logo" class="h-10">
|
||||
<h3 class="text-3xl text-white font-bold">Sortie</h3>
|
||||
</a>
|
||||
|
||||
<!-- Navigation principale -->
|
||||
<ul class="hidden md:flex space-x-6 text-white font-medium">
|
||||
<li>
|
||||
<a href="{{ path('home') }}"
|
||||
@@ -42,7 +40,6 @@
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<!-- Profil utilisateur -->
|
||||
<div class="relative">
|
||||
{% if app.user %}
|
||||
<button id="profile-menu" class="flex items-center space-x-2 focus:outline-none">
|
||||
@@ -69,7 +66,6 @@
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<!-- Menu mobile -->
|
||||
<button id="mobile-menu-button" class="md:hidden text-white focus:outline-none">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16" />
|
||||
@@ -77,7 +73,6 @@
|
||||
</button>
|
||||
</nav>
|
||||
|
||||
<!-- Menu mobile (hidden par défaut) -->
|
||||
<div id="mobile-menu" class="hidden bg-gradient-to-r from-[#2A8D57] via-[#008167] to-[#1B5667] text-white py-4 md:hidden">
|
||||
<ul class="space-y-4 px-6">
|
||||
<li><a href="{{ path('home') }}" class="block hover:text-gray-200">Accueil</a></li>
|
||||
@@ -89,9 +84,7 @@
|
||||
{% block content %}
|
||||
{% endblock %}
|
||||
|
||||
<!-- Scripts -->
|
||||
<script>
|
||||
// Toggle menu pour mobile
|
||||
const mobileMenuButton = document.getElementById('mobile-menu-button');
|
||||
const mobileMenu = document.getElementById('mobile-menu');
|
||||
|
||||
@@ -99,7 +92,6 @@
|
||||
mobileMenu.classList.toggle('hidden');
|
||||
});
|
||||
|
||||
// Toggle menu déroulant pour le profil
|
||||
const profileMenuButton = document.getElementById('profile-menu');
|
||||
const dropdown = document.getElementById('dropdown');
|
||||
|
||||
@@ -109,7 +101,6 @@
|
||||
dropdown.classList.toggle('hidden');
|
||||
});
|
||||
|
||||
// Fermer le menu lorsqu'on clique ailleurs
|
||||
document.addEventListener('click', (event) => {
|
||||
if (!dropdown.classList.contains('hidden')) {
|
||||
const isClickInsideMenu = dropdown.contains(event.target) || profileMenuButton.contains(event.target);
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<style>
|
||||
.swiper-container {
|
||||
width: 100%;
|
||||
height: 500px; /* Ajustez selon vos besoins */
|
||||
height: 500px;
|
||||
}
|
||||
|
||||
.swiper-slide {
|
||||
@@ -56,7 +56,7 @@
|
||||
}
|
||||
|
||||
.swiper-pagination-bullet-active {
|
||||
background: #16a34a; /* Vert plus foncé pour le point actif */
|
||||
background: #16a34a;
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
||||
@@ -65,7 +65,6 @@
|
||||
|
||||
{% block content %}
|
||||
<div class="container mx-auto py-10">
|
||||
<!-- Section carrousel -->
|
||||
<h2 class="text-4xl font-bold text-center mb-8">Dernières sorties</h2>
|
||||
<div class="w-full relative">
|
||||
<div class="swiper default-carousel swiper-container">
|
||||
@@ -99,7 +98,6 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Section des événements terminés -->
|
||||
<div class="mt-12">
|
||||
<h2 class="text-3xl font-bold text-center mb-6">Événements terminés</h2>
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
|
||||
@@ -123,7 +121,6 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Inclure les fichiers JavaScript Swiper -->
|
||||
{% block javascripts %}
|
||||
<script src="https://unpkg.com/swiper/swiper-bundle.min.js"></script>
|
||||
<script>
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
{{ form_row(formProfile.deleteImage) }}
|
||||
<img class="mx-auto justify-items-center" alt="image de profile" src="{{ asset('/upload/image/profile/' ~ formProfile.vars.value.fileName) }}" height="128" width="128">
|
||||
{% endif %}
|
||||
<button class="btnRegister text-white font-bold py-2 px-4 border-b-4 rounded mx-auto" type="submit">Actualiser les informations</button>
|
||||
<button class="btnPrimary" type="submit">Actualiser les informations</button>
|
||||
{{ form_end(formProfile) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,13 +1,4 @@
|
||||
{% extends 'main/base.html.twig' %}
|
||||
{% block head %}
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
{% block title %}📣 Sortie.com {{ profile.pseudo }} 🔊{% endblock %}
|
||||
{% block stylesheets %}
|
||||
{{ encore_entry_link_tags('app') }}
|
||||
{% endblock %}
|
||||
</head>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="relative mx-auto md:max-w-xl pt-24 pb-8 min-w-0 break-words">
|
||||
@@ -25,30 +16,30 @@
|
||||
<i class="fas fa-map-marker-alt mr-2 text-slate-400 opacity-75"></i>{{ profile.pseudo }}
|
||||
</div>
|
||||
{% if isActiveUser %}
|
||||
<div class="text-xs mt-0 mb-2 text-slate-400 font-bold uppercase">
|
||||
<i class="fas fa-map-marker-alt mr-2 text-slate-400 opacity-75"></i>{{ profile.telephone }} - {{ profile.email }}
|
||||
</div>
|
||||
<div class="text-xs mt-0 mb-2 text-slate-400 font-bold uppercase">
|
||||
<i class="fas fa-map-marker-alt mr-2 text-slate-400 opacity-75"></i>{{ profile.telephone }} - {{ profile.email }}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% if isActiveUser %}
|
||||
<div class="mt-6 py-6 border-t border-slate-200 text-center">
|
||||
<div class="flex flex-wrap justify-center">
|
||||
<div class="w-full px-4">
|
||||
<a href="{{ path('profile_edit', {'uuid': app.user.idParticipant}) }}" class="text-slate-700 hover:text-slate-400">
|
||||
<button class="bg-green-500 px-4 py-2 rounded hover:bg-green-700">
|
||||
Modifier
|
||||
</button>
|
||||
</a>
|
||||
<div class="mt-6 py-6 border-t border-slate-200 text-center">
|
||||
<div class="flex flex-wrap justify-center">
|
||||
<div class="w-full px-4">
|
||||
<a href="{{ path('profile_edit', {'uuid': app.user.idParticipant}) }}" class="text-slate-700 hover:text-slate-400">
|
||||
<button class="btnThird">
|
||||
Modifier
|
||||
</button>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex flex-row flex-wrap mx-8">
|
||||
{# Tableau des sorties dont je suis participant#}
|
||||
<div class="w-1/2 p-4 shadow-lg rounded-lg">
|
||||
<div class="flex flex-col lg:flex-row mx-8 gap-6">
|
||||
{# Tableau des sorties dont je suis participant #}
|
||||
<div class="w-full lg:w-1/2 p-4 shadow-lg rounded-lg overflow-x-auto">
|
||||
<h4 class="text-start bg-gray-50 items-start justify-start text-base p-2 font-bold uppercase">Mes participations</h4>
|
||||
<table class="min-w-full bg-white divide-y divide-gray-200">
|
||||
<thead class="bg-gray-50">
|
||||
@@ -70,7 +61,7 @@
|
||||
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">{{ sortie.dateHeureDebut|date('d/m/Y H:i') }}</td>
|
||||
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">{{ sortie.duree }}</td>
|
||||
<td class="flex flex-row px-6 py-4 whitespace-nowrap text-base text-gray-900">
|
||||
<a href={{ path('sortie_view', { id: sortie.idSortie }) }}>👁️</a>
|
||||
<a href="{{ path('sortie_view', { id: sortie.idSortie }) }}" class="text-green-500">👁️</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% else %}
|
||||
@@ -82,8 +73,8 @@
|
||||
</table>
|
||||
</div>
|
||||
|
||||
{# Tableau des sorties dont je suis organisateur #}
|
||||
<div class="w-1/2 p-4 shadow-lg rounded-lg">
|
||||
{# Tableau des sorties dont je suis organisateur #}
|
||||
<div class="w-full lg:w-1/2 p-4 shadow-lg rounded-lg overflow-x-auto">
|
||||
<h4 class="text-start bg-gray-50 items-start justify-start text-base p-2 font-bold uppercase">Mes organisations</h4>
|
||||
<table class="min-w-full bg-white divide-y divide-gray-200">
|
||||
<thead class="bg-gray-50">
|
||||
@@ -105,7 +96,7 @@
|
||||
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">{{ sortie.dateHeureDebut|date('d/m/Y H:i') }}</td>
|
||||
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">{{ sortie.duree }}</td>
|
||||
<td class="flex flex-row px-6 py-4 whitespace-nowrap text-base text-gray-900">
|
||||
<a href={{ path('sortie_view', { id: sortie.idSortie }) }}>👁️</a>
|
||||
<a href="{{ path('sortie_view', { id: sortie.idSortie }) }}" class="text-green-500">👁️</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% else %}
|
||||
|
||||
@@ -110,9 +110,6 @@
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<button type="button" id="generate-image" class="modern-button mt-2">
|
||||
Générer une image
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -121,10 +118,7 @@
|
||||
<label for="sortie_lieu">Lieu</label>
|
||||
<div class="flex items-center space-x-2">
|
||||
{{ form_widget(form.lieu, { 'attr': { 'class': 'block w-full p-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500', 'id': 'lieu-select' } }) }}
|
||||
<button type="button" id="add-lieu-button" class="modern-button">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" class="w-5 h-5">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 4v16m8-8H4" />
|
||||
</svg>
|
||||
<button type="button" id="add-lieu-button" class="btnThird">
|
||||
Ajouter
|
||||
</button>
|
||||
</div>
|
||||
@@ -154,10 +148,10 @@
|
||||
</div>
|
||||
|
||||
<div class="mt-6 flex justify-center space-x-4">
|
||||
<button type="submit" name="action" value="save" class="px-6 py-3 bg-green-500 text-white rounded-lg shadow hover:bg-green-600 focus:outline-none focus:ring-2 focus:ring-green-300">
|
||||
<button type="submit" name="action" value="save" class="btnPrimary">
|
||||
Enregistrer
|
||||
</button>
|
||||
<a href="{{ path('home') }}" class="px-6 py-3 bg-gray-500 text-white rounded-lg shadow hover:bg-gray-600 focus:outline-none focus:ring-2 focus:ring-gray-300">
|
||||
<a href="{{ path('home') }}" class="btnAnnule">
|
||||
Annuler
|
||||
</a>
|
||||
</div>
|
||||
|
||||
@@ -70,15 +70,51 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="sortie_imageFile">Image de la sortie</label>
|
||||
{{ form_widget(form.imageFile, { 'attr': { 'class': 'block w-full p-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500', 'onchange': 'previewImage(event)' } }) }}
|
||||
<small class="text-gray-500">Formats acceptés : JPG, PNG (max. 5 Mo).</small>
|
||||
|
||||
{% if sortie and sortie.image %}
|
||||
<div class="mt-4">
|
||||
<img id="image-preview" src="{{ asset('img/sortie/' ~ sortie.image) }}" alt="Image prévisualisée" class="max-w-xs h-auto rounded-lg border border-gray-300">
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="mt-4">
|
||||
<img id="image-preview" src="" alt="Aucune image sélectionnée" class="max-w-xs h-auto rounded-lg border border-gray-300 hidden">
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="flex justify-end mt-8 space-x-4">
|
||||
<a href="{{ path('sortie_view', { id: sortie.getIdSortie() }) }}" class="px-6 py-3 bg-gray-500 text-white rounded-lg shadow-md hover:bg-gray-600">
|
||||
<a href="{{ path('sortie_view', { id: sortie.getIdSortie() }) }}" class="btnAnnule">
|
||||
❌ Annuler
|
||||
</a>
|
||||
<button type="submit" class="px-6 py-3 bg-blue-500 text-white rounded-lg shadow-md hover:bg-blue-600">
|
||||
<button type="submit" class="btnPrimary">
|
||||
💾 Enregistrer
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{{ form_end(form) }}
|
||||
</div>
|
||||
{% block javascripts %}
|
||||
<script>
|
||||
function previewImage(event) {
|
||||
const input = event.target;
|
||||
const preview = document.getElementById('image-preview');
|
||||
|
||||
if (input.files && input.files[0]) {
|
||||
const reader = new FileReader();
|
||||
reader.onload = function (e) {
|
||||
preview.src = e.target.result;
|
||||
preview.classList.remove('hidden');
|
||||
};
|
||||
reader.readAsDataURL(input.files[0]);
|
||||
} else {
|
||||
preview.src = '';
|
||||
preview.classList.add('hidden');
|
||||
}
|
||||
}
|
||||
</script>
|
||||
{% endblock %}
|
||||
{% endblock %}
|
||||
@@ -31,17 +31,14 @@
|
||||
<div class="container mx-auto p-4 sm:p-6 bg-gray-50 rounded-lg shadow-lg mt-4 sm:mt-6">
|
||||
<h1 class="text-2xl sm:text-3xl font-bold text-center text-gray-800 mb-6 sm:mb-8">🎉 Liste des sorties</h1>
|
||||
|
||||
<!-- Formulaire de recherche -->
|
||||
<form method="GET" action="{{ path('home') }}" class="bg-white rounded-lg shadow-md p-4 mb-6">
|
||||
<div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4 sm:gap-6">
|
||||
<!-- Recherche -->
|
||||
<div>
|
||||
<label for="search" class="block text-sm font-medium text-gray-700">🔍 Recherche</label>
|
||||
<input type="text" name="search" id="search" value="{{ app.request.query.get('search', '') }}"
|
||||
class="block w-full mt-2 rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm"
|
||||
placeholder="Nom de la sortie">
|
||||
</div>
|
||||
<!-- Site -->
|
||||
<div>
|
||||
<label for="site" class="block text-sm font-medium text-gray-700">📍 Site</label>
|
||||
<select name="site" id="site" class="block w-full mt-2 rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm">
|
||||
@@ -53,13 +50,11 @@
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
<!-- Date de début -->
|
||||
<div>
|
||||
<label for="start_date" class="block text-sm font-medium text-gray-700">📅 Date de début</label>
|
||||
<input type="date" name="start_date" id="start_date" value="{{ app.request.query.get('start_date', '') }}"
|
||||
class="block w-full mt-2 rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm">
|
||||
</div>
|
||||
<!-- Date de fin -->
|
||||
<div>
|
||||
<label for="end_date" class="block text-sm font-medium text-gray-700">📅 Date de fin</label>
|
||||
<input type="date" name="end_date" id="end_date" value="{{ app.request.query.get('end_date', '') }}"
|
||||
@@ -67,7 +62,6 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Options supplémentaires -->
|
||||
<div class="mt-4 grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4">
|
||||
<div class="flex items-center">
|
||||
<input type="checkbox" name="organisateur" id="organisateur" value="1"
|
||||
@@ -95,15 +89,13 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Bouton de filtrage -->
|
||||
<div class="mt-6 flex justify-end">
|
||||
<button type="submit" class="px-6 py-2 bg-blue-500 text-white rounded-md shadow hover:bg-blue-600">
|
||||
<button type="submit" class="btnPrimary">
|
||||
🔎 Filtrer
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<!-- Liste des sorties -->
|
||||
<div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4 sm:gap-6">
|
||||
<a href="/sortie/creates" class="hidden sm:block">
|
||||
<div class="bg-white rounded-lg shadow-md p-4 text-center">
|
||||
|
||||
@@ -74,9 +74,10 @@
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
|
||||
{% if app.user and sortie.etat.libelle == 'Ouverte' and not sortie.participants.contains(app.user) and date(sortie.dateLimiteInscription) > date() %}
|
||||
<form action="{{ path('sortie_inscription', { id: sortie.idSortie }) }}" method="post" class="mt-6">
|
||||
<button type="submit" class="px-6 py-3 bg-green-500 text-white rounded-md shadow hover:bg-green-600">
|
||||
<button type="submit" class="btnPrimary">
|
||||
✅ S'inscrire
|
||||
</button>
|
||||
</form>
|
||||
@@ -85,7 +86,7 @@
|
||||
<p class="text-green-600 font-bold">✅ Vous êtes déjà inscrit à cette sortie.</p>
|
||||
{% if sortie.etat.libelle == 'Ouverte' %}
|
||||
<form action="{{ path('sortie_unsubscribe', { id: sortie.idSortie }) }}" method="post" class="mt-6">
|
||||
<button type="submit" class="px-6 py-3 bg-red-500 text-white rounded-md shadow hover:bg-red-600">
|
||||
<button type="submit" class="btnAnnule">
|
||||
❌ Se désister
|
||||
</button>
|
||||
</form>
|
||||
@@ -98,11 +99,11 @@
|
||||
<button
|
||||
type="button"
|
||||
id="open-delete-modal"
|
||||
class="px-6 py-3 bg-red-500 text-white rounded-md shadow hover:bg-red-600">
|
||||
class="btnAnnule">
|
||||
❌ Annuler la sortie
|
||||
</button>
|
||||
<a href="{{ path('sortie_edit', { id: sortie.idSortie }) }}"
|
||||
class="px-6 py-3 bg-yellow-500 text-white rounded-md shadow hover:bg-yellow-600">
|
||||
class="btnSecondary">
|
||||
✏️ Modifier la sortie
|
||||
</a>
|
||||
</div>
|
||||
@@ -153,7 +154,7 @@
|
||||
</button>
|
||||
<button
|
||||
type="submit"
|
||||
class="px-4 py-2 bg-red-500 text-white rounded-md hover:bg-red-600">
|
||||
class="btnAnnule">
|
||||
Confirmer l'annulation
|
||||
</button>
|
||||
</div>
|
||||
|
||||