From 1ae9096729bdd495ba24bfd939bbd5d0adba8ea0 Mon Sep 17 00:00:00 2001 From: thisfro Date: Tue, 18 May 2021 19:39:44 +0200 Subject: [PATCH] Show users offers on dedicated page --- src/Controller/UserController.php | 13 ++++++++- templates/base.html.twig | 1 + templates/user/index.html.twig | 26 ----------------- templates/user/offers.html.twig | 47 +++++++++++++++++++++++-------- 4 files changed, 49 insertions(+), 38 deletions(-) diff --git a/src/Controller/UserController.php b/src/Controller/UserController.php index a019f5a..9663449 100644 --- a/src/Controller/UserController.php +++ b/src/Controller/UserController.php @@ -47,7 +47,7 @@ class UserController extends AbstractController { $user = $this->getUser(); - return $this->render('user/offers.html.twig', [ + return $this->render('user/public.html.twig', [ 'user' => $user, 'offers' => $offeringRepository->findByUser($user), ]); @@ -105,4 +105,15 @@ class UserController extends AbstractController throw new HttpException(403, "No permission"); } + + #[Route('/myoffers', name: 'own_offers')] + public function ownOffers(OfferingRepository $offeringRepository): Response + { + $user = $this->getUser(); + + return $this->render('user/offers.html.twig', [ + 'user' => $user, + 'offers' => $offeringRepository->findByUser($user), + ]); + } } diff --git a/templates/base.html.twig b/templates/base.html.twig index d857ed7..7cd805e 100644 --- a/templates/base.html.twig +++ b/templates/base.html.twig @@ -45,6 +45,7 @@