+ //Get locations at less than 2 km
+ $this->context['locations'] = $this->doctrine->getRepository(Location::class)->findAllByLatitudeLongitudeAsArray($this->context['location']['latitude'], $this->context['location']['longitude'], $this->period, 2);
+
+ //Set modified
+ //XXX: dance modified is already computed inside calendar modified
+ $this->modified = max(array_merge([$this->context['location']['updated']], array_map(function ($v) { return $v['modified']; }, array_merge($this->context['calendar'], $this->context['locations']))));
+
+ //Create response
+ $response = new Response();
+
+ //With logged user
+ if ($this->isGranted('IS_AUTHENTICATED_REMEMBERED')) {
+ //Set last modified
+ $response->setLastModified(new \DateTime('-1 year'));
+
+ //Set as private
+ $response->setPrivate();
+ //Without logged user
+ } else {
+ //Set etag
+ //XXX: only for public to force revalidation by last modified
+ $response->setEtag(md5(serialize(array_merge($this->context['location'], $this->context['calendar'], $this->context['locations']))));
+
+ //Set last modified
+ $response->setLastModified($this->modified);
+
+ //Set as public
+ $response->setPublic();
+
+ //Without role and modification
+ if ($response->isNotModified($request)) {
+ //Return 304 response
+ return $response;
+ }
+ }
+
+ //Add multi map
+ $this->context['multimap'] = $this->map->getMultiMap($this->context['location']['multimap'], $this->modified->getTimestamp(), $this->context['location']['latitude'], $this->context['location']['longitude'], $this->context['locations'], $this->map->getMultiZoom($this->context['location']['latitude'], $this->context['location']['longitude'], $this->context['locations']));
+
+ //Set keywords
+ $this->context['keywords'] = [
+ $this->context['location']['title'],
+ $this->context['location']['city'],
+ $this->translator->trans($this->context['location']['indoor']?'Indoor':'Outdoor'),
+ $this->translator->trans('Calendar'),
+ $this->translator->trans('Libre Air')
+ ];
+
+ //With dances
+ if (!empty($this->context['dances'])) {
+ //Set dances
+ $dances = array_map(function ($v) { return $v['name']; }, $this->context['dances']);
+
+ //Insert dances in keywords
+ array_splice($this->context['keywords'], 2, 0, $dances);
+
+ //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% %location%', ['%dances%' => $dances, '%location%' => $this->context['location']['atin']]);
+
+ //Set description
+ $this->context['description'] = $this->translator->trans('%dances% indoor and outdoor calendar %location%', ['%dances%' => $dances, '%location%' => $this->context['location']['at']]);
+ //Without dances
+ } else {
+ //Set title
+ $this->context['title'] = $this->translator->trans('Dance %location%', ['%location%' => $this->context['location']['atin']]);
+
+ //Set description
+ $this->context['description'] = $this->translator->trans('Indoor and outdoor dance calendar %location%', [ '%location%' => $this->context['location']['at'] ]);