diff options
| -rw-r--r-- | chimere/settings.sample.py | 6 | ||||
| -rw-r--r-- | chimere/templates/chimere/blocks/head_chimere.html | 2 | ||||
| -rw-r--r-- | chimere/templatetags/chimere_tags.py | 2 |
3 files changed, 7 insertions, 3 deletions
diff --git a/chimere/settings.sample.py b/chimere/settings.sample.py index 391c6e5..da703fb 100644 --- a/chimere/settings.sample.py +++ b/chimere/settings.sample.py @@ -300,8 +300,12 @@ if 'MAP_JS_URLS' not in globals(): if 'MAP_CSS_URLS' not in globals(): global MAP_CSS_URLS - # key: [(url, condition)] MAP_CSS_URLS = { + 'openlayers':["http://www.openlayers.org/api/theme/default/style.css"], + 'leaflet':[STATIC_URL + "leaflet/leaflet.css"], + } + # key: [(url, condition)] + MAP_CONDITIONNAL_CSS_URLS = { 'openlayers':[("http://www.openlayers.org/api/theme/default/style.css", None)], 'leaflet':[ diff --git a/chimere/templates/chimere/blocks/head_chimere.html b/chimere/templates/chimere/blocks/head_chimere.html index dea92ec..c1cdcc9 100644 --- a/chimere/templates/chimere/blocks/head_chimere.html +++ b/chimere/templates/chimere/blocks/head_chimere.html @@ -1,4 +1,4 @@ -{% for css_url, condition in MAP_CSS_URLS %} +{% for css_url, condition in MAP_CONDITIONNAL_CSS_URLS %} {% if condition %}<!--[if {{condition}}]>{%endif%}<link rel="stylesheet" href="{{ css_url }}" />{% if condition %}<![endif]-->{%endif%}{% endfor %} {% for js_url in MAP_JS_URLS %} <script src="{{ js_url }}" type="text/javascript"></script>{% endfor %} diff --git a/chimere/templatetags/chimere_tags.py b/chimere/templatetags/chimere_tags.py index 90252a1..47f0800 100644 --- a/chimere/templatetags/chimere_tags.py +++ b/chimere/templatetags/chimere_tags.py @@ -144,7 +144,7 @@ def head_chimere(context, view=True): "DEFAULT_ZOOM": settings.CHIMERE_DEFAULT_ZOOM, "MAP_LAYER": settings.CHIMERE_DEFAULT_MAP_LAYER, "CHIMERE_VIEW_RENDERER": settings.CHIMERE_VIEW_RENDERER, - "MAP_CSS_URLS": settings.MAP_CSS_URLS[map_renderer], + "MAP_CONDITIONNAL_CSS_URLS": settings.MAP_CONDITIONNAL_CSS_URLS[map_renderer], "MAP_JS_URLS": settings.MAP_JS_URLS[map_renderer], 'routing': settings.CHIMERE_ENABLE_ROUTING \ if hasattr(settings, 'CHIMERE_ENABLE_ROUTING') else False |
