Rework and share code between geojson and index controllers. Improve templates inheri...
[infos-pratiques:etalage.git] / poiscasse / templates / map.mako
1 ## -*- coding: utf-8 -*-
2
3
4 ## PoisCasse -- Open Data POIs portal
5 ## By: Emmanuel Raviart <eraviart@easter-eggs.com>
6 ##     Romain Soufflet <rsoufflet@easter-eggs.com>
7 ##
8 ## Copyright (C) 2011 Easter-eggs
9 ## http://gitorious.org/infos-pratiques/poiscasse
10 ##
11 ## This file is part of PoisCasse.
12 ##
13 ## PoisCasse is free software; you can redistribute it and/or modify
14 ## it under the terms of the GNU Affero General Public License as
15 ## published by the Free Software Foundation, either version 3 of the
16 ## License, or (at your option) any later version.
17 ##
18 ## PoisCasse is distributed in the hope that it will be useful,
19 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
20 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21 ## GNU Affero General Public License for more details.
22 ##
23 ## You should have received a copy of the GNU Affero General Public License
24 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
25
26
27 <%!
28 from poiscasse import conf
29 %>
30
31
32 <%inherit file="/index.mako"/>
33
34
35 <%def name="css()" filter="trim">
36     <%parent:css/>
37     <link rel="stylesheet" href="${conf['leaflet.css']}">
38 <!--[if lte IE 8]>
39     <link rel="stylesheet" href="${conf['leaflet.ie.css']}">
40 <![endif]-->
41 </%def>
42
43
44 <%def name="results()" filter="trim">
45     <div id="map" style="height: 400px;"></div>
46 </%def>
47
48
49 <%def name="scripts()" filter="trim">
50     <%parent:scripts/>
51     <script src="${conf['leaflet.js']}"></script>
52 <!--[if lt IE 10]>
53     <script src="${conf['pie.js']}"></script>
54 <![endif]-->
55     <script src="/js/map.js"></script>
56     <script>
57 var etalage = etalage || {};
58 etalage.map.organismsUrl = '/api/v1/geojson';
59
60
61 $(function () {
62     etalage.map.createMap('map');
63 });
64     </script>
65 </%def>
66