Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Shelter Database
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
CHARISM
Shelter Database
Commits
c3fd6964
Commit
c3fd6964
authored
Sep 05, 2016
by
Cédric Bonhomme
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://github.com/rodekruis/shelter-database
parents
fd0646d8
1cba741d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
59 additions
and
20 deletions
+59
-20
src/web/templates/layout.html
src/web/templates/layout.html
+4
-0
src/web/templates/shelter.html
src/web/templates/shelter.html
+55
-20
No files found.
src/web/templates/layout.html
View file @
c3fd6964
...
...
@@ -100,7 +100,11 @@
$
(
function
()
{
var
loc
=
window
.
location
.
pathname
;
// returns the full URL
if
(
""
===
loc
||
"
/
"
===
loc
)
{
// add landingpage class to header
$
(
'
header
'
).
addClass
(
'
landingpage
'
);
// remove page class from main
$
(
'
main
'
).
removeClass
();
}
});
</script>
...
...
src/web/templates/shelter.html
View file @
c3fd6964
...
...
@@ -17,7 +17,7 @@
<h1
id=
"shelter-name"
>
[UNKNOWN NAME]
</h1>
</div>
</section>
<section
class=
"shelterimg"
onclick=
"modalOpen()"
style=
"background-image: url('{{ url_for('static', filename = 'img/shelter.jpg') }}')"
>
<section
id=
"coverpicture"
class=
"shelterimg"
onclick=
"modalOpen()"
style=
"background-image: url('{{ url_for('static', filename = 'img/shelter.jpg') }}')"
>
<div
class=
"dots"
>
<div
class=
"dot selected"
></div>
<div
class=
"dot"
></div>
...
...
@@ -81,31 +81,14 @@
</div>
</section>
<section
class=
"shelterimg"
onclick=
"modalOpen()"
style=
"background-image: url('{{ url_for('static', filename = 'img/shelter.jpg') }}')"
>
<div
class=
"dots"
>
<div
class=
"dot selected"
></div>
<div
class=
"dot"
></div>
<div
class=
"dot"
></div>
</div>
</section>
{% endblock %}
{% block footer %}
<div
class=
"mymodal"
>
<div
class=
"mymodal-close"
onclick=
"modalClose()"
></div>
<div
class=
"swipe"
>
<div
class=
"panes"
>
<div
class=
"pane"
style=
"background-image: url('{{ url_for('static', filename = 'img/shelter.jpg') }}"
></div>
<div
class=
"pane"
style=
"background-image: url('{{ url_for('static', filename = 'img/1.jpg') }}"
></div>
<div
class=
"pane"
style=
"background-image: url('{{ url_for('static', filename = 'img/2.jpg') }}"
></div>
<div
class=
"pane"
style=
"background-image: url('{{ url_for('static', filename = 'img/3.jpg') }}')"
></div>
</div>
<div
class=
"dots"
>
<div
class=
"dot"
onclick=
"show(0, 0, true)"
></div>
<div
class=
"dot"
onclick=
"show(1, 0, true)"
></div>
<div
class=
"dot"
onclick=
"show(2, 0, true)"
></div>
<div
class=
"dot"
onclick=
"show(2, 0, true)"
></div>
</div>
<div
id=
"modalIdentificationPanes"
class=
"panes"
></div>
<div
id=
"modalIdentificationDots"
class=
"dots"
></div>
</div>
</div>
...
...
@@ -170,9 +153,61 @@
// Initiate leaflet map
var
map
=
L
.
map
(
'
location-map
'
).
setView
([
lat
,
lon
],
13
);
// Add OSM base layer
L
.
tileLayer
(
'
http://a.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png
'
).
addTo
(
map
);
// disable dragging and scrolling for mobile view
map
.
scrollWheelZoom
.
disable
();
map
.
dragging
.
disable
();
// add location of shelter to map
L
.
marker
([
lat
,
lon
]).
addTo
(
map
);
// add pictures
addCoverPicture
(
'
#coverpicture
'
,
data
[
shelter_id
][
'
Identification
'
]);
addSwipePictures
(
'
#modalIdentification
'
,
data
[
shelter_id
][
'
Identification
'
]);
}
});
function
addCoverPicture
(
elementId
,
section
){
if
(
typeof
section
[
'
Cover
'
]
!==
'
undefined
'
&&
section
[
'
Cover
'
].
length
>
0
)
{
$
(
elementId
).
css
(
"
background-image
"
,
"
url('
"
+
section
[
'
Cover
'
][
0
]
+
"
')
"
);
}
}
function
addSwipePictures
(
elementId
,
section
){
if
(
typeof
section
[
'
Pictures
'
]
!==
'
undefined
'
)
{
//merge arrays
var
d
=
section
[
'
Cover
'
].
concat
(
section
[
'
Pictures
'
]);
// add panes
d3
.
select
(
elementId
+
"
Panes
"
)
.
selectAll
(
"
div
"
)
.
data
(
d
)
.
enter
()
.
append
(
"
div
"
)
.
attr
(
"
class
"
,
"
pane
"
)
.
attr
(
"
style
"
,
function
(
d
){
return
"
background-image: url('
"
+
d
+
"
')
"
;});
// add dots
// TODO increment show id
var
dot
=
0
;
d3
.
select
(
elementId
+
"
Dots
"
)
.
selectAll
(
"
div
"
)
.
data
(
d
)
.
enter
()
.
append
(
"
div
"
)
.
attr
(
"
class
"
,
"
dot
"
)
.
attr
(
"
onclick
"
,
function
(
d
){
var
r
=
"
_swipe.show(
"
+
dot
+
"
,0,true)
"
;
dot
++
;
return
r
;
});
}
}
function
tabulate
(
table_id
,
d
,
columns
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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