diff --git a/people/templates/people/organisation/update.html b/people/templates/people/organisation/update.html
index d79d315..7b5aa44 100644
--- a/people/templates/people/organisation/update.html
+++ b/people/templates/people/organisation/update.html
@@ -2,27 +2,12 @@
{% block extra_head %}
{% load staticfiles %}
-
-
-
+ {{ map_markers|json_script:'map-markers' }}
+
-
{% endblock %}
diff --git a/people/templates/people/person/update.html b/people/templates/people/person/update.html
index 2e22b07..db4e256 100644
--- a/people/templates/people/person/update.html
+++ b/people/templates/people/person/update.html
@@ -2,25 +2,12 @@
{% block extra_head %}
{% load staticfiles %}
-
+ {{ map_markers|json_script:'map-markers' }}
+
-
{% endblock %}
diff --git a/people/views/organisation.py b/people/views/organisation.py
index b405923..c67542d 100644
--- a/people/views/organisation.py
+++ b/people/views/organisation.py
@@ -45,3 +45,16 @@ class OrganisationUpdateView(LoginRequiredMixin, UpdateView):
context_object_name = 'organisation'
template_name = 'people/organisation/update.html'
form_class = forms.OrganisationForm
+
+ def get_context_data(self,
+ **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
+ """Add map marker to context."""
+ context = super().get_context_data(**kwargs)
+
+ context['map_markers'] = [{
+ 'name': self.object.name,
+ 'lat': self.object.latitude,
+ 'lng': self.object.longitude,
+ }]
+
+ return context
diff --git a/people/views/person.py b/people/views/person.py
index 3ecbb4b..28e26f9 100644
--- a/people/views/person.py
+++ b/people/views/person.py
@@ -57,7 +57,8 @@ class ProfileView(permissions.UserIsLinkedPersonMixin, DetailView):
# pk was not provided in URL
return self.request.user.person
- def get_context_data(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
+ def get_context_data(self,
+ **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
"""Add current :class:`PersonAnswerSet` to context."""
context = super().get_context_data(**kwargs)
@@ -74,6 +75,14 @@ class PersonUpdateView(permissions.UserIsLinkedPersonMixin, UpdateView):
template_name = 'people/person/update.html'
form_class = forms.PersonAnswerSetForm
+ def get_context_data(self,
+ **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
+ context = super().get_context_data(**kwargs)
+
+ context['map_markers'] = [get_map_data(self.object)]
+
+ return context
+
def get_initial(self) -> typing.Dict[str, typing.Any]:
return {
'person_id': self.object.id,
@@ -129,7 +138,8 @@ class PersonMapView(LoginRequiredMixin, ListView):
model = models.Person
template_name = 'people/person/map.html'
- def get_context_data(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
+ def get_context_data(self,
+ **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
context = super().get_context_data(**kwargs)
context['map_markers'] = [