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
a7a9c61c
Commit
a7a9c61c
authored
Aug 23, 2018
by
Florent Chehab
Browse files
Removed files and lines that were making flake8 crash in pipelines
parent
f385513b
Changes
3
Hide whitespace changes
Inline
Side-by-side
backend/templates/rex/home.html
deleted
100644 → 0
View file @
f385513b
{% extends 'main_website/base.html' %}
{% load staticfiles %}
{% block content %}
<div
id=
"mapid"
style=
"height:400px"
></div>
<link
rel=
"stylesheet"
href=
"{% static 'css/leaflet.css' %}"
/>
<script
type=
"text/javascript"
src=
"{% static 'js/leaflet.js' %}"
></script>
<link
rel=
"stylesheet"
href=
"{% static 'css/MarkerCluster.css' %}"
/>
<link
rel=
"stylesheet"
href=
"{% static 'css/MarkerCluster.Default.css' %}"
/>
<script
type=
"text/javascript"
src=
"{% static 'js/leaflet.markercluster.js' %}"
></script>
<script>
var
Stamen_Watercolor
=
L
.
tileLayer
(
'
https://stamen-tiles-{s}.a.ssl.fastly.net/watercolor/{z}/{x}/{y}.{ext}
'
,
{
attribution
:
'
Map tiles by <a href="http://stamen.com">Stamen Design</a>, <a href="http://creativecommons.org/licenses/by/3.0">CC BY 3.0</a> — Map data © <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>
'
,
subdomains
:
'
abcd
'
,
minZoom
:
1
,
maxZoom
:
18
,
ext
:
'
png
'
});
var
Stamen_Label
=
L
.
tileLayer
(
'
https://stamen-tiles-{s}.a.ssl.fastly.net/toner-labels/{z}/{x}/{y}.{ext}
'
,
{
attribution
:
'
Map tiles by <a href="http://stamen.com">Stamen Design</a>, <a href="http://creativecommons.org/licenses/by/3.0">CC BY 3.0</a> — Map data © <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>
'
,
subdomains
:
'
abcd
'
,
minZoom
:
1
,
maxZoom
:
18
,
ext
:
'
png
'
});
var
OpenStreetMap_France
=
L
.
tileLayer
(
'
https://{s}.tile.openstreetmap.fr/osmfr/{z}/{x}/{y}.png
'
,
{
maxZoom
:
20
,
attribution
:
'
© Openstreetmap France | © <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>
'
});
var
Esri_WorldImagery
=
L
.
tileLayer
(
'
https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}
'
,
{
attribution
:
'
Tiles © Esri — Source: Esri, i-cubed, USDA, USGS, AEX, GeoEye, Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community
'
});
var
Stamen
=
L
.
layerGroup
();
Stamen_Watercolor
.
addTo
(
Stamen
);
Stamen_Label
.
addTo
(
Stamen
);
var
baseLayers
=
{
"
Stamen Watercolor
"
:
Stamen
,
"
OpenStreetMap
"
:
OpenStreetMap_France
,
"
Satellite
"
:
Esri_WorldImagery
};
// End of handling of layers, now let's handle markers.
var
universities_markers
=
L
.
markerClusterGroup
();
{
%
for
camp
in
campus
%
}
L
.
marker
([{{
camp
.
lat
}},
{{
camp
.
lon
}}]).
addTo
(
universities_markers
)
.
bindPopup
(
"
<b>{{ camp.university.name }}</b>
"
);
{
%
endfor
%
}
// Creation of map
var
mymap
=
L
.
map
(
'
mapid
'
,
{
'
layers
'
:[
Stamen
,
universities_markers
]}).
setView
([
45
,
1.2
],
4
);
L
.
control
.
layers
(
baseLayers
).
addTo
(
mymap
);
// Extra feature
var
popup
=
L
.
popup
();
function
onMapClick
(
e
)
{
popup
.
setLatLng
(
e
.
latlng
)
.
setContent
(
"
You clicked the map at
"
+
e
.
latlng
.
toString
())
.
openOn
(
mymap
);
}
mymap
.
on
(
'
click
'
,
onMapClick
);
</script>
<!-- {% for univ in universities %}
<p>{{ univ.country.name }}</p>
{% endfor %} -->
{% endblock %}
\ No newline at end of file
backend/urls.py
View file @
a7a9c61c
from
django.conf.urls
import
url
,
include
from
backend
import
views
from
rest_framework
import
routers
from
backend.models.location
import
CountryViewSet
from
backend.models.location
import
CityViewSet
...
...
backend/views.py
deleted
100644 → 0
View file @
f385513b
from
django.shortcuts
import
render
from
backend.models.university
import
Campus
# def home(request):
# campus = Campus.objects.filter(is_main_campus=True).select_related()
# return render(request, 'rex/home.html', {'campus': campus})
# TODO clean old stuff (remove it)
\ No newline at end of file
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