Renaming map config

This commit is contained in:
reverend 2020-09-13 20:15:49 +02:00
parent b3db6643b9
commit f919fe30fa
6 changed files with 10 additions and 10 deletions

View File

@ -14,7 +14,7 @@
<article class="LP-TextSection">
</article>
{% include 'partials/osm_map.html' with config=map_config %}
{% include 'partials/osm_map.html' with config=mapping_config %}
<div class="LP-PlaceGrid">
<h1 class="LP-Headline LP-Headline">Explore the latest locations</h1>
<ul class="LP-PlaceGrid__Grid">

View File

@ -18,7 +18,7 @@
var vectorSource = new ol.source.Vector({
features: [
{% for point in config.point_list %}
{% for point in config.all_points %}
new ol.Feature({
geometry: new ol.geom.Point(
ol.proj.fromLonLat([{{point.longitude}},{{point.latitude}}])

View File

@ -43,7 +43,7 @@
<section class="LP-Section">
<h1 class="LP-Headline">Map-Links</h1>
{% include 'partials/osm_map.html' with config=map_config%}
{% include 'partials/osm_map.html' with config=mapping_config%}
<div class="LP-LinkList">
<ul class="LP-LinkList__Container">
<li class="LP-LinkList__Item"><a target="_blank" href="https://www.google.com/maps?q={{place.latitude}},{{place.longitude}}" class="LP-Link"><span class="LP-Text">Google Maps</span></a></li>

View File

@ -10,7 +10,7 @@
{% block maincontent %}
{% include 'partials/osm_map.html' with config=map_config %}
{% include 'partials/osm_map.html' with config=mapping_config %}
<div class="LP-PlaceList">
<h1 class="LP-Headline">Listing our places</h1>
<ul class="LP-PlaceList__List">

View File

@ -23,8 +23,8 @@ class PlaceListView(IsAuthenticatedMixin, ListView):
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
context['map_config'] = {
'point_list': context['place_list'],
context['mapping_config'] = {
'all_points': context['place_list'],
'map_center': Place.average_latlon(context['place_list'])
}
return context
@ -34,8 +34,8 @@ class PlaceDetailView(IsAuthenticatedMixin, View):
place = Place.objects.get(pk=pk)
context = {
'place': place,
'map_config': {
'point_list': [ place ],
'mapping_config': {
'all_points': [ place ],
'map_center': {'latitude': place.latitude, 'longitude': place.longitude},
},
'tagging_config': {

View File

@ -28,8 +28,8 @@ class HomeView(IsAuthenticatedMixin, View):
def get(self, request, *args, **kwargs):
place_list = Place.objects.all().order_by('-submitted_when')[:10]
context = {
'place_list': place_list,
'map_config': {
'all_points': place_list,
'mapping_config': {
'point_list': place_list,
'map_center': Place.average_latlon(place_list)
}