+ *
+ * @desc Display all granted sessions with an application or login form
+ *
+ * @param Request $request The request instance
+ *
+ * @return Response The rendered view
+ */
+ public function index(Request $request): Response {
+ //Fetch doctrine
+ $doctrine = $this->getDoctrine();
+
+ //Set section
+ $section = $this->translator->trans('Argentine Tango in Paris');
+
+ //Set description
+ $this->context['description'] = $this->translator->trans('Outdoor Argentine Tango session calendar in Paris');
+
+ //Set keywords
+ $this->context['keywords'] = [
+ $this->translator->trans('Argentine Tango'),
+ $this->translator->trans('Paris'),
+ $this->translator->trans('outdoor'),
+ $this->translator->trans('calendar'),
+ $this->translator->trans('Libre Air')
+ ];
+
+ //Set title
+ $title = $this->translator->trans($this->config['site']['title']).' - '.$section;
+
+ //Compute period
+ $period = new \DatePeriod(
+ //Start from first monday of week
+ new \DateTime('Monday this week'),
+ //Iterate on each day
+ new \DateInterval('P1D'),
+ //End with next sunday and 4 weeks
+ new \DateTime(
+ $this->isGranted('IS_AUTHENTICATED_REMEMBERED')?'Monday this week + 4 week':'Monday this week + 2 week'
+ )
+ );
+
+ //Fetch calendar
+ $calendar = $doctrine->getRepository(Session::class)->fetchCalendarByDatePeriod($this->translator, $period, null, $request->get('session'), !$this->isGranted('IS_AUTHENTICATED_REMEMBERED'));
+
+ //Fetch locations
+ //XXX: we want to display all active locations anyway
+ $locations = $doctrine->getRepository(Location::class)->findTranslatedSortedByPeriod($this->translator, $period);
+
+ //Render the view
+ return $this->render('@RapsysAir/default/index.html.twig', ['title' => $title, 'section' => $section, 'calendar' => $calendar, 'locations' => $locations]+$this->context);
+
+ //Set Cache-Control must-revalidate directive
+ #$response->setPublic(true);
+ #$response->setMaxAge(300);
+ #$response->mustRevalidate();
+ ##$response->setCache(['public' => true, 'max_age' => 300]);
+
+ //Return the response
+ #return $response;
+ }
+
+ /**
+ * The organizer regulation page
+ *
+ * @desc Display the organizer regulation policy
+ *
+ * @return Response The rendered view
+ */
+ public function organizerRegulation(): Response {
+ //Set section
+ $section = $this->translator->trans('Organizer regulation');
+
+ //Set description
+ $this->context['description'] = $this->translator->trans('Libre Air organizer regulation');
+
+ //Set keywords
+ $this->context['keywords'] = [
+ $this->translator->trans('organizer regulation'),
+ $this->translator->trans('Libre Air')
+ ];
+
+ //Set title
+ $title = $this->translator->trans($this->config['site']['title']).' - '.$section;
+
+ //Render template
+ return $this->render('@RapsysAir/default/organizer_regulation.html.twig', ['title' => $title, 'section' => $section]+$this->context);
+ }
+
+ /**
+ * The terms of service page
+ *
+ * @desc Display the terms of service policy
+ *
+ * @return Response The rendered view