Change title scheme format
Change section name
Cleanup
$doctrine = $this->getDoctrine();
//Fetch location
$doctrine = $this->getDoctrine();
//Fetch location
- $location = $doctrine->getRepository(Location::class)->findOneById($id);
+ if (empty($location = $doctrine->getRepository(Location::class)->findOneById($id))) {
+ throw $this->createNotFoundException($this->translator->trans('Unable to find location: %id%', ['%id%' => $id]));
+ }
- $section = $this->translator->trans($location);
+ $section = $this->translator->trans('Argentine Tango at '.$location);
- $title = $section.' - '.$this->translator->trans($this->config['site']['title']);
+ $title = $this->translator->trans($this->config['site']['title']).' - '.$section;
//Init context
$context = [];
//Init context
$context = [];
//Fetch locations
//XXX: we want to display all active locations anyway
//Fetch locations
//XXX: we want to display all active locations anyway
- $locations = $doctrine->getRepository(Location::class)->fetchTranslatedLocationByDatePeriod($this->translator, $period/*, !$this->isGranted('IS_AUTHENTICATED_REMEMBERED')*/);
+ $locations = $doctrine->getRepository(Location::class)->findTranslatedSortedByPeriod($this->translator, $period);
//Render the view
return $this->render('@RapsysAir/location/view.html.twig', ['id' => $id, 'title' => $title, 'section' => $section, 'calendar' => $calendar, 'locations' => $locations]+$context+$this->context);
//Render the view
return $this->render('@RapsysAir/location/view.html.twig', ['id' => $id, 'title' => $title, 'section' => $section, 'calendar' => $calendar, 'locations' => $locations]+$context+$this->context);