function index($slug, Request $request, Application $app)
 {
     if (!$this->build($slug, $request, $app)) {
         $app->abort(404, "Area does not exist.");
     }
     if ($request->request->get('areaCommentSlug') && $request->request->get('CSFRToken') == $app['websession']->getCSFRToken()) {
         $repo = new AreaCommentRepository();
         $areaComment = $repo->getByAreaAndSlug($this->parameters['area'], $request->request->get('areaCommentSlug'));
         if ($areaComment) {
             if ($request->request->get('action') == 'delete') {
                 $repo->delete($areaComment, $app['currentUser']);
             } else {
                 if ($request->request->get('action') == 'undelete') {
                     $repo->undelete($areaComment, $app['currentUser']);
                 } else {
                     if ($request->request->get('action') == 'close') {
                         $repo->closeByAdmin($areaComment, $app['currentUser']);
                     } else {
                         if ($request->request->get('action') == 'unclose') {
                             $repo->uncloseByAdmin($areaComment, $app['currentUser']);
                         }
                     }
                 }
             }
         }
     }
     $ecrb = new AreaCommentRepositoryBuilder();
     $ecrb->setIncludeDeleted(true);
     $ecrb->setIncludeClosedByAdmin(true);
     $ecrb->setArea($this->parameters['area']);
     $this->parameters['areaComments'] = $ecrb->fetchAll();
     return $app['twig']->render('site/commentsadminarea/index.html.twig', $this->parameters);
 }
 function comments($slug, Request $request, Application $app)
 {
     if (!$this->build($slug, $request, $app)) {
         $app->abort(404, "Area does not exist.");
     }
     $ecrb = new AreaCommentRepositoryBuilder();
     $ecrb->setIncludeDeleted(false);
     $ecrb->setIncludeClosedByAdmin(false);
     $ecrb->setArea($this->parameters['area'], false, true);
     $ecrb->setLimit(1000);
     $this->parameters['areaComments'] = $ecrb->fetchAll();
     // TODO should it really start "action"?
     $app['currentUserActions']->set("org.openacalendar.comments", "actionAreaNewComment", $app['currentUserPermissions']->hasPermission("org.openacalendar.comments", "COMMENTS_CHANGE") && !$this->parameters['area']->getIsDeleted());
     return $app['twig']->render('site/area/comments.html.twig', $this->parameters);
 }