Adapting home view

This commit is contained in:
2020-09-12 11:47:42 +02:00
parent e1002b5315
commit a1886b0b60
2 changed files with 7 additions and 5 deletions

View File

@@ -27,10 +27,12 @@ class SignUpView(SuccessMessageMixin, CreateView):
class HomeView(IsAuthenticated, View):
def get(self, request, *args, **kwargs):
place_list = Place.objects.all().order_by('-submitted_when')[:10]
place_map_center = Place.average_latlon(place_list)
context = {
'place_list': place_list,
'place_map_center': place_map_center
'map_config': {
'point_list': place_list,
'map_center': Place.average_latlon(place_list)
}
}
return render(request, 'home.html', context)