+ )
+ );
+
+ //Get textual cities
+ $cities = implode($this->translator->trans(' and '), array_filter(array_merge([implode(', ', array_slice($cities, 0, -1))], array_slice($cities, -1)), 'strlen'));
+
+ //Get textual dances
+ $dances = implode($this->translator->trans(' and '), array_filter(array_merge([implode(', ', array_slice($dances, 0, -1))], array_slice($dances, -1)), 'strlen'));
+
+ //Set title
+ $this->context['title'] = $this->translator->trans('%dances% %cities% sessions', ['%dances%' => $dances, '%cities%' => $cities]);
+
+ //Set description
+ $this->context['description'] = $this->translator->trans('%dances% indoor and outdoor session calendar %cities%', ['%dances%' => $dances, '%cities%' => $cities]);
+
+ //Render the view
+ return $this->render('@RapsysAir/session/index.html.twig', $this->context);
+ }
+
+ /**
+ * List all sessions for tango argentin
+ *
+ * @desc Display all sessions in tango argentin json format
+ *
+ * @todo Drop it if unused by tangoargentin ???
+ *
+ * @param Request $request The request instance
+ *
+ * @return Response The rendered view or redirection
+ */
+ public function tangoargentin(Request $request): Response {
+ //Retrieve events to update
+ $sessions = $this->doctrine->getRepository(Session::class)->findAllByPeriodAsCalendarArray($this->period);
+
+ //Init return array
+ $ret = [];
+
+ //Flatten sessions tree
+ $sessions = array_reduce($sessions, function ($c, $v) { return array_merge($c, $v['sessions']); }, []);
+
+ //Iterate on sessions
+ foreach($sessions as $sessionId => $session) {
+ //Set route params
+ $routeParams = $this->router->match($session['link']);
+
+ //Set route
+ $route = $routeParams['_route'];
+
+ //Drop _route from route params
+ unset($routeParams['_route']);
+
+ //Add session
+ $ret[$session['id']] = [
+ 'start' => $session['start']->format(\DateTime::ISO8601),
+ 'stop' => $session['start']->format(\DateTime::ISO8601),
+ 'fromto' => $this->translator->trans('from %start% to %stop%', ['%start%' => $session['start']->format('H\hi'), '%stop%' => $session['stop']->format('H\hi')]),
+ 'title' => $this->slugger->latin($session['application']['user']['title'])/*.' '.$this->translator->trans('at '.$session['location']['title'])*/,
+ 'short' => $session['rate']['short'],
+ 'rate' => $session['rate']['title'],
+ 'location' => implode(' ', [$session['location']['address'], $session['location']['zipcode'], $session['location']['city']]),
+ 'status' => in_array('canceled', $session['class'])?'annulé':'confirmé',
+ 'modified' => $session['modified']->format(\DateTime::ISO8601),
+ #'organizer' => $session['application']['user']['title'],
+ #'source' => $this->router->generate('rapsys_air_session_view', ['id' => $sessionId, 'location' => $this->translator->trans($session['l_title'])], UrlGeneratorInterface::ABSOLUTE_URL)
+ 'source' => $this->router->generate($route, $routeParams, UrlGeneratorInterface::ABSOLUTE_URL)