Commit f43f9776 authored by Florent Chehab's avatar Florent Chehab

Update view to render with new campus format

parent 5b2410d0
Pipeline #26289 passed with stages
in 1 minute and 23 seconds
......@@ -53,9 +53,9 @@
var universities_markers = L.markerClusterGroup();
{% for univ in universities %}
L.marker([{{ univ.loc.lat }}, {{ univ.loc.lon }}]).addTo(universities_markers)
.bindPopup("<b>{{ univ.name }}</b>");
{% for camp in campus %}
L.marker([{{ camp.lat }}, {{ camp.lon }}]).addTo(universities_markers)
.bindPopup("<b>{{ camp.university.name }}</b>");
{% endfor %}
......
from django.shortcuts import render
from rex.models.university import University
from rex.models.university import Campus
def home(request):
universities = University.objects.all()
for univ in universities:
univ.loc = univ.location()
return render(request, 'rex/home.html', {'universities': universities})
campus = Campus.objects.filter(is_main_campus=True).select_related()
return render(request, 'rex/home.html', {'campus': campus})
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment