Merge remote-tracking branch 'origin/main'

This commit is contained in:
mepiphana2023
2024-11-25 16:24:35 +01:00
2 changed files with 14 additions and 11 deletions

View File

@@ -89,6 +89,10 @@ class SortieController extends AbstractController
$this->addFlash('error', 'Cette sortie n\'existe pas.'); $this->addFlash('error', 'Cette sortie n\'existe pas.');
return $this->redirectToRoute('home'); return $this->redirectToRoute('home');
} }
if ($sortie->getDateHeureDebut() < (new DateTime())->modify('-1 month')) {
$this->addFlash('error', "Cette sortie à plus de 30 jours.");
return $this->redirectToRoute('home');
}
return $this->render('sortie/view.html.twig', [ return $this->render('sortie/view.html.twig', [
'sortie' => $sortie, 'sortie' => $sortie,

View File

@@ -92,6 +92,7 @@
</div> </div>
</a> </a>
{% for sortie in sorties %} {% for sortie in sorties %}
<a href="{{ path('sortie_view', { id: sortie.idSortie }) }}" class="text-blue-500 hover:text-blue-700 font-medium">
<div class="bg-white rounded-lg shadow-md p-4"> <div class="bg-white rounded-lg shadow-md p-4">
<h2 class="text-lg font-semibold text-gray-800">{{ sortie.nom }}</h2> <h2 class="text-lg font-semibold text-gray-800">{{ sortie.nom }}</h2>
<p class="mt-2 text-gray-600"> <p class="mt-2 text-gray-600">
@@ -100,10 +101,8 @@
<strong>Inscriptions max :</strong> {{ sortie.nbInscriptionsMax }}<br> <strong>Inscriptions max :</strong> {{ sortie.nbInscriptionsMax }}<br>
<strong>Infos :</strong> {{ sortie.infosSortie }} <strong>Infos :</strong> {{ sortie.infosSortie }}
</p> </p>
<div class="mt-4 flex justify-end">
<a href="{{ path('sortie_view', { id: sortie.idSortie }) }}" class="text-blue-500 hover:text-blue-700 font-medium">Voir plus</a>
</div>
</div> </div>
</a>
{% else %} {% else %}
<p class="text-gray-600 text-center col-span-6">Aucune sortie ne correspond à vos critères.</p> <p class="text-gray-600 text-center col-span-6">Aucune sortie ne correspond à vos critères.</p>
{% endfor %} {% endfor %}