From 22a4b20ed04a9c709fbbe3e254ad8b2d7757a38b Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Fri, 12 May 2017 15:02:32 +0200 Subject: First draft for notifications Signed-off-by: Thomas Citharel --- .../Controller/NotificationsController.php | 38 ++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 src/Wallabag/CoreBundle/Controller/NotificationsController.php (limited to 'src/Wallabag/CoreBundle/Controller/NotificationsController.php') diff --git a/src/Wallabag/CoreBundle/Controller/NotificationsController.php b/src/Wallabag/CoreBundle/Controller/NotificationsController.php new file mode 100644 index 00000000..24870b37 --- /dev/null +++ b/src/Wallabag/CoreBundle/Controller/NotificationsController.php @@ -0,0 +1,38 @@ +getDoctrine()->getRepository('WallabagCoreBundle:Notification')->findByUser($this->getUser()); + + return $this->render('WallabagCoreBundle:Notification:notifications.html.twig', ['notifications' => $notifications]); + } + + /** + * @Route("/notifications/readall", name="notification-archive-all") + * + * @param Request $request + * @return Response + */ + public function markAllNotificationsAsReadAction(Request $request) + { + $this->getDoctrine()->getRepository('WallabagCoreBundle:Notification')->markAllAsReadForUser($this->getUser()->getId()); + + return $this->redirectToRoute('notifications-all'); + } +} -- cgit v1.2.3