feat(order): Ajoute les pages mentions légales et RGPD

Ajoute les templates et les routes pour afficher les mentions légales et la politique de confidentialité (RGPD).
This commit is contained in:
Serreau Jovann
2025-10-28 09:17:58 +01:00
parent 1bfb7aa8d2
commit a47a683154
4 changed files with 53 additions and 2 deletions

View File

@@ -62,7 +62,7 @@ class HomeController extends AbstractController
#[Route('/commande/legal',name: 'commande_legal')]
public function legal(): Response
{
return $this->render('order/display.twig',[
return $this->render('order/legal.twig',[
'formules' => self::formules,
]);
}
@@ -70,7 +70,7 @@ class HomeController extends AbstractController
#[Route('/commande/rgpd',name: 'commande_rgpd')]
public function rgpd(): Response
{
return $this->render('order/display.twig',[
return $this->render('order/rgpd.twig',[
'formules' => self::formules,
]);
}

View File

@@ -0,0 +1,31 @@
<?php
namespace App\EventListener;
use Presta\SitemapBundle\Event\SitemapPopulateEvent;
use Presta\SitemapBundle\Sitemap\Url\UrlConcrete;
use Symfony\Component\EventDispatcher\Attribute\AsEventListener;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpKernel\Event\RequestEvent;
use Symfony\Component\HttpKernel\KernelEvents;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
#[AsEventListener(event: KernelEvents::REQUEST,method: 'onKernelRequest')]
class OrderSubscriber
{
public function __construct(private readonly UrlGeneratorInterface $urlGenerator)
{
}
public function onKernelRequest(RequestEvent $event): void
{
$host = $event->getRequest()->getHost();
$path = $event->getRequest()->getPathInfo();
if($host == "commande.esy-web.fr" && !str_contains($path,"/commande")) {
$redirect = new RedirectResponse($this->urlGenerator->generate('commande'));
$event->setResponse($redirect);
}
}
}

File diff suppressed because one or more lines are too long

10
templates/order/rgpd.twig Normal file

File diff suppressed because one or more lines are too long