Compare commits

..

No commits in common. "5f3be5fc8305ee719100f0778f039b9f7e352906" and "9af55d3f24b4f504ce4c4d2685a4f5a7ddc662e9" have entirely different histories.

8 changed files with 6 additions and 10 deletions

View File

@ -57,7 +57,8 @@ class Place (models.Model):
# Get center position of all LP-geocoordinates. # Get center position of all LP-geocoordinates.
def average_latlon(place_list): def average_latlon():
place_list = Place.objects.all()
amount = len(place_list) amount = len(place_list)
longitude = 0 longitude = 0
latitude = 0 latitude = 0

View File

@ -1,6 +0,0 @@
# Keeping these files up-to-date is something for CI / release management.
# But for now I noted the source urls down here for later reference.
https://cdn.jsdelivr.net/gh/openlayers/openlayers.github.io@master/en/v6.3.1/css/ol.css
https://cdn.jsdelivr.net/gh/openlayers/openlayers.github.io@master/en/v6.3.1/build/ol.js
https://cdn.jsdelivr.net/gh/openlayers/openlayers.github.io@master/en/v6.3.1/build/ol.js.map

View File

@ -1,8 +1,8 @@
{% extends 'global.html'%} {% extends 'global.html'%}
{% load static %} {% load static %}
{% block additional_head %} {% block additional_head %}
<link rel="stylesheet" href="{% static 'maps/ol.css' %}" type="text/css"> <link rel="stylesheet" href="{% static 'ol.css' %}" type="text/css">
<script src="{% static 'maps/ol.js' %}"></script> <script src="{% static 'ol.js' %}"></script>
{% endblock additional_head %} {% endblock additional_head %}
# {% block title %}Start{% endblock %} # {% block title %}Start{% endblock %}

View File

@ -1,3 +1,4 @@
{% load static %}
<div id="map" class="map"></div> <div id="map" class="map"></div>
<div id="info" class="map-popup"></div> <div id="info" class="map-popup"></div>

View File

@ -64,7 +64,7 @@ class PlaceDetailView(IsAuthenticated, View):
class HomeView(View): class HomeView(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]
place_map_center = Place.average_latlon(place_list) place_map_center = Place.average_latlon()
context = { context = {
'place_list': place_list, 'place_list': place_list,
'place_map_center': place_map_center 'place_map_center': place_map_center