Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Julien Jerphanion
Rex Dri
Commits
f43f9776
Commit
f43f9776
authored
Aug 19, 2018
by
Florent Chehab
Browse files
Update view to render with new campus format
parent
5b2410d0
Changes
2
Hide whitespace changes
Inline
Side-by-side
rex/templates/rex/home.html
View file @
f43f9776
...
...
@@ -53,9 +53,9 @@
var
universities_markers
=
L
.
markerClusterGroup
();
{
%
for
univ
in
universitie
s
%
}
L
.
marker
([{{
univ
.
loc
.
lat
}},
{{
univ
.
loc
.
lon
}}]).
addTo
(
universities_markers
)
.
bindPopup
(
"
<b>{{
univ
.name }}</b>
"
);
{
%
for
camp
in
campu
s
%
}
L
.
marker
([{{
camp
.
lat
}},
{{
camp
.
lon
}}]).
addTo
(
universities_markers
)
.
bindPopup
(
"
<b>{{
camp.university
.name }}</b>
"
);
{
%
endfor
%
}
...
...
rex/views.py
View file @
f43f9776
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
})
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment