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

View File

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

View File

@ -43,7 +43,7 @@
<section class="LP-Section"> <section class="LP-Section">
<h1 class="LP-Headline">Map-Links</h1> <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"> <div class="LP-LinkList">
<ul class="LP-LinkList__Container"> <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> <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 %} {% block maincontent %}
{% include 'partials/osm_map.html' with config=map_config %} {% include 'partials/osm_map.html' with config=mapping_config %}
<div class="LP-PlaceList"> <div class="LP-PlaceList">
<h1 class="LP-Headline">Listing our places</h1> <h1 class="LP-Headline">Listing our places</h1>
<ul class="LP-PlaceList__List"> <ul class="LP-PlaceList__List">

View File

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

View File

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