diff --git a/src/Controller/CaseController.php b/src/Controller/CaseController.php new file mode 100644 index 0000000..6b3d783 --- /dev/null +++ b/src/Controller/CaseController.php @@ -0,0 +1,69 @@ +navLinks = NavList::LIST; + } + + #[Route('/list-cases', name: 'app_list_cases')] + public function listCases(#[CurrentUser()] User $user): Response + { + $this->denyAccessUnlessGranted('ROLE_ADMIN'); + + $this->navLinks['case_list'] = 'nav-link text-white active bg-gradient-dark'; + + return $this->render( + 'internal/cases/case-list.html.twig', + array_merge( + $this->navLinks, + [ + 'breadcrumbs' => [ + 'List Cases' + ], + 'notifications' => $user->retrieveUnreadNotifications(), + ] + ) + ); + } + + #[Route('/add-case', name: 'app_case')] + public function addCase(#[CurrentUser()] User $admin): Response + { + $this->denyAccessUnlessGranted('ROLE_ADMIN'); + + $this->navLinks['case_list'] = 'nav-link text-white active bg-gradient-dark'; + + $case = new MemberCase(); + $form = $this->createForm(MemberCaseFormType::class, $case); + + return $this->render( + 'internal/admin/cases/add-case.html.twig', + array_merge( + $this->navLinks, + [ + 'title' => 'Add Case', + 'breadcrumbs' => [ + 'Case', + 'Add Case' + ], + 'notifications' => $admin->retrieveUnreadNotifications(), + 'form' => $form, + ] + ) + ); + } +}