diff --git a/src/Controller/StaticPages.php b/src/Controller/StaticPages.php index c3576ab6b2fb60c40024a7f461b0c3aa613324ca..c4078d10fc65ad5589ff5ea5f417176fa7d42f06 100644 --- a/src/Controller/StaticPages.php +++ b/src/Controller/StaticPages.php @@ -7,6 +7,10 @@ use App\Entity\Ecurie; use App\Form\EcurieType; use App\Repository\EcurieRepository; +use App\Entity\Category; +use App\Form\CategoryType; +use App\Repository\CategoryRepository; + use Symfony\Component\HttpFoundation\Response; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; @@ -21,11 +25,14 @@ class StaticPages extends AbstractController { $ecurieRepository = $this->getDoctrine() ->getRepository(Ecurie::class); + $categoryRepository = $this->getDoctrine() + ->getRepository(Category::class); $titre = 'Bienvenue'; return $this->render('home.html.twig', [ 'titre' => $titre, 'ecuries' => $ecurieRepository->findAll(), + 'categories' => $categoryRepository->findAll(), ]); } } \ No newline at end of file diff --git a/templates/home.html.twig b/templates/home.html.twig index b26d645f73a6a8dbc4eccd27f62385b87c34106c..fe3ba824410a553da3c4287339d2e7f9f5c09774 100644 --- a/templates/home.html.twig +++ b/templates/home.html.twig @@ -36,26 +36,4 @@ </a> </div> </div> - - <h1 class="text-3xl px-[5rem]">Shop By Driver</h1> - <div class="flex flex-row mt-[1.5rem]"> - <a href=""> - <img src="{{ asset('img/drivers/max_verstappen.avif') }}" alt=""> - </a> - <a href=""> - <img src="{{ asset('img/drivers/charles_leclerc.avif') }}" alt=""> - </a> - <a href=""> - <img src="{{ asset('img/drivers/lewis_hamilton.avif') }}" alt=""> - </a> - <a href=""> - <img src="{{ asset('img/drivers/fernando_alonso.avif') }}" alt=""> - </a> - <a href=""> - <img src="{{ asset('img/drivers/sergio_perez.avif') }}" alt=""> - </a> - <a href=""> - <img src="{{ asset('img/drivers/carlos_sainz.avif') }}" alt=""> - </a> - </div> {% endblock %} \ No newline at end of file diff --git a/templates/layouts/_header.html.twig b/templates/layouts/_header.html.twig index 09584649fba301dfed9d4381edc391d0358c0429..548b099ca778d13583da208dac40d3dc89bd4bdd 100644 --- a/templates/layouts/_header.html.twig +++ b/templates/layouts/_header.html.twig @@ -22,13 +22,12 @@ <nav> <ul class="flex flex-row justify-around uppercase"> <li class="hover:bg-[#EEEEEE] px-[1rem] font-medium w-full text-center"> - <a href="" class="leading-[2.1875rem] ">équipes</a> + <a href="{{ path('app_ecurie_index') }}" class="leading-[2.1875rem] ">équipes</a> </li> + {% for category in categories %} <li class="hover:bg-[#EEEEEE] px-[1rem] font-medium w-full text-center"> - <a href="" class="leading-[2.1875rem] ">pilotes</a> - </li> - <li class="hover:bg-[#EEEEEE] px-[1rem] font-medium w-full text-center"> - <a href="" class="leading-[2.1875rem] ">casquettes et chapeaux</a> + <a href="{{ path('app_category_show', {'id': category.id}) }}" class="leading-[2.1875rem] ">{{ category.name }}</a> </li> + {% endfor %} </ul> </nav> \ No newline at end of file