diff --git a/public/img/add.svg b/public/img/add.svg new file mode 100644 index 0000000..b46319f --- /dev/null +++ b/public/img/add.svg @@ -0,0 +1,5 @@ + + \ No newline at end of file diff --git a/src/Controller/MainController.php b/src/Controller/MainController.php index e7cca7c..6fc488e 100644 --- a/src/Controller/MainController.php +++ b/src/Controller/MainController.php @@ -2,6 +2,7 @@ namespace App\Controller; +use App\Repository\SiteRepository; use App\Repository\SortieRepository; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Response; @@ -11,12 +12,14 @@ use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInt class MainController extends AbstractController { #[Route('/', name: 'home')] - public function index(TokenStorageInterface $tokenStorage, SortieRepository $sortieRepository): Response + public function index(TokenStorageInterface $tokenStorage, SortieRepository $sortieRepository, SiteRepository $siteRepository): Response { $token = $tokenStorage->getToken(); $userConnect = $token?->getUser(); $sorties = $sortieRepository->findAll(); + $sites = $siteRepository->findAll(); return $this->render('main/index.html.twig', [ + 'sites' => $sites, 'profile' => $userConnect, 'sorties' => $sorties, ]); diff --git a/templates/main/index.html.twig b/templates/main/index.html.twig index 33729f3..32080ba 100644 --- a/templates/main/index.html.twig +++ b/templates/main/index.html.twig @@ -13,7 +13,74 @@