| @@ 31-41 (lines=11) @@ | ||
| 28 | /** |
|
| 29 | * @Route("/comments", name="admin_comments") |
|
| 30 | */ |
|
| 31 | public function indexAction(Request $request) |
|
| 32 | { |
|
| 33 | $comments = $this->getDoctrine()->getRepository('AppBundle:Comment')->getDisabledComments(); |
|
| 34 | $paginator = $this->get('knp_paginator'); |
|
| 35 | $pagination = $paginator->paginate( |
|
| 36 | $comments, |
|
| 37 | $request->query->getInt('page', 1), |
|
| 38 | 20 |
|
| 39 | ); |
|
| 40 | return $this->render('AppBundle::admin/comment/comments.html.twig', array('pagination' => $pagination)); |
|
| 41 | } |
|
| 42 | ||
| 43 | /** |
|
| 44 | * @Route("/comments/all", name="admin_all_comments") |
|
| @@ 46-56 (lines=11) @@ | ||
| 43 | /** |
|
| 44 | * @Route("/comments/all", name="admin_all_comments") |
|
| 45 | */ |
|
| 46 | public function allCommentsAction(Request $request) |
|
| 47 | { |
|
| 48 | $comments = $this->getDoctrine()->getRepository('AppBundle:Comment')->findAll(); |
|
| 49 | $paginator = $this->get('knp_paginator'); |
|
| 50 | $pagination = $paginator->paginate( |
|
| 51 | $comments, |
|
| 52 | $request->query->getInt('page', 1), |
|
| 53 | 20 |
|
| 54 | ); |
|
| 55 | return $this->render('AppBundle::admin/comment/all_comments.html.twig', array('pagination' => $pagination)); |
|
| 56 | } |
|
| 57 | ||
| 58 | /** |
|
| 59 | * @Route("/comments/published", name="admin_published_comments") |
|
| @@ 61-71 (lines=11) @@ | ||
| 58 | /** |
|
| 59 | * @Route("/comments/published", name="admin_published_comments") |
|
| 60 | */ |
|
| 61 | public function publishedCommentsAction(Request $request) |
|
| 62 | { |
|
| 63 | $comments = $this->getDoctrine()->getRepository('AppBundle:Comment')->getEnabledComments(); |
|
| 64 | $paginator = $this->get('knp_paginator'); |
|
| 65 | $pagination = $paginator->paginate( |
|
| 66 | $comments, |
|
| 67 | $request->query->getInt('page', 1), |
|
| 68 | 20 |
|
| 69 | ); |
|
| 70 | return $this->render('AppBundle:admin/comment:published_comments.html.twig', array('pagination' => $pagination)); |
|
| 71 | } |
|
| 72 | ||
| 73 | /** |
|
| 74 | * @Route("/comment/show/{id}", name="admin_comment_show") |
|
| @@ 45-55 (lines=11) @@ | ||
| 42 | * @Route("/estates", name="admin_estates") |
|
| 43 | * @Method("GET") |
|
| 44 | */ |
|
| 45 | public function estatesAction(Request $request) |
|
| 46 | { |
|
| 47 | $estates = $this->getDoctrine()->getRepository('AppBundle:Estate')->getEstatesWithAll(); |
|
| 48 | $paginator = $this->get('knp_paginator'); |
|
| 49 | $pagination = $paginator->paginate( |
|
| 50 | $estates, |
|
| 51 | $request->query->getInt('page', 1), |
|
| 52 | 10 |
|
| 53 | ); |
|
| 54 | return $this->render('@App/admin/estate/estates.html.twig', array('pagination' => $pagination)); |
|
| 55 | } |
|
| 56 | ||
| 57 | /** |
|
| 58 | * @Route("/estate/show/{slug}", name="admin_estate_show") |
|
| @@ 23-33 (lines=11) @@ | ||
| 20 | * @Route("/users", name="admin_users") |
|
| 21 | * @Method("GET") |
|
| 22 | */ |
|
| 23 | public function usersAction(Request $request) |
|
| 24 | { |
|
| 25 | $users = $this->getDoctrine()->getRepository('AppBundle:User')->findAll(); |
|
| 26 | $paginator = $this->get('knp_paginator'); |
|
| 27 | $pagination = $paginator->paginate( |
|
| 28 | $users, |
|
| 29 | $request->query->getInt('page', 1), |
|
| 30 | 10 |
|
| 31 | ); |
|
| 32 | return $this->render('@App/admin/user/users.html.twig', array('pagination' => $pagination)); |
|
| 33 | } |
|
| 34 | ||
| 35 | /** |
|
| 36 | * @Route("/users/managers", name="admin_users_managers") |
|
| @@ 39-49 (lines=11) @@ | ||
| 36 | * @Route("/users/managers", name="admin_users_managers") |
|
| 37 | * @Method("GET") |
|
| 38 | */ |
|
| 39 | public function usersManagersAction(Request $request) |
|
| 40 | { |
|
| 41 | $users = $this->getDoctrine()->getRepository('AppBundle:User')->findByRole('ROLE_MANAGER'); |
|
| 42 | $paginator = $this->get('knp_paginator'); |
|
| 43 | $pagination = $paginator->paginate( |
|
| 44 | $users, |
|
| 45 | $request->query->getInt('page', 1), |
|
| 46 | 10 |
|
| 47 | ); |
|
| 48 | return $this->render('@App/admin/user/users.html.twig', array('pagination' => $pagination)); |
|
| 49 | } |
|
| 50 | ||
| 51 | /** |
|
| 52 | * @Route("/estates/{slug}", name="admin_estates_manager") |
|
| @@ 54-64 (lines=11) @@ | ||
| 51 | /** |
|
| 52 | * @Route("/estates/{slug}", name="admin_estates_manager") |
|
| 53 | */ |
|
| 54 | public function showEstatesManagerAction(Request $request, $slug) |
|
| 55 | { |
|
| 56 | $estates = $this->getDoctrine()->getManager()->getRepository('AppBundle:Estate') |
|
| 57 | ->getEstatesOfManager($slug); |
|
| 58 | $paginator = $this->get('knp_paginator'); |
|
| 59 | $pagination = $paginator->paginate( |
|
| 60 | $estates, |
|
| 61 | $request->query->getInt('page', 1), |
|
| 62 | 10 |
|
| 63 | ); |
|
| 64 | return $this->render('@App/admin/user/estates_manager.html.twig', array('pagination' => $pagination)); } |
|
| 65 | ||
| 66 | /** |
|
| 67 | * @Route("/users/lock_user/{username}", name="lock_user") |
|