sortie > 1 month
This commit is contained in:
@@ -89,6 +89,10 @@ class SortieController extends AbstractController
|
||||
$this->addFlash('error', 'Cette sortie n\'existe pas.');
|
||||
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', [
|
||||
'sortie' => $sortie,
|
||||
|
||||
@@ -92,6 +92,7 @@
|
||||
</div>
|
||||
</a>
|
||||
{% 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">
|
||||
<h2 class="text-lg font-semibold text-gray-800">{{ sortie.nom }}</h2>
|
||||
<p class="mt-2 text-gray-600">
|
||||
@@ -100,10 +101,8 @@
|
||||
<strong>Inscriptions max :</strong> {{ sortie.nbInscriptionsMax }}<br>
|
||||
<strong>Infos :</strong> {{ sortie.infosSortie }}
|
||||
</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>
|
||||
</a>
|
||||
{% else %}
|
||||
<p class="text-gray-600 text-center col-span-6">Aucune sortie ne correspond à vos critères.</p>
|
||||
{% endfor %}
|
||||
|
||||
Reference in New Issue
Block a user