start building a new main site based on leaflet!

This commit is contained in:
Laura Klünder 2017-10-10 19:31:51 +02:00
parent 44b2f828ab
commit 2ad82d169d
7 changed files with 682 additions and 641 deletions

View file

@ -1,4 +1,5 @@
# flake8: noqa
import json
from datetime import timedelta
import qrcode
@ -8,6 +9,7 @@ from django.shortcuts import get_object_or_404, redirect, render
from django.urls import reverse
from django.utils import timezone
from c3nav.mapdata.models import Source
from c3nav.mapdata.models.level import Level
ctype_mapping = {
@ -58,6 +60,13 @@ def qr_code(request, location):
return response
def map_index(request):
ctx = {
'bounds': json.dumps(Source.max_bounds())
}
return render(request, 'site/map.html', ctx)
def main(request, location=None, origin=None, destination=None):
location = get_location_or_404(request, location)
origin = get_location_or_404(request, origin)