summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@peacefrogs.net>2013-04-05 13:01:08 +0200
committerÉtienne Loks <etienne.loks@peacefrogs.net>2013-04-05 13:01:08 +0200
commit0419bb2f1ff9ad08db2c336df31c9a0c51bb62b9 (patch)
treebb32211f796e121112a19df165aed13987ba9264
parente3dd113da11a69f2107e6ac7fc5998626a23a2cc (diff)
downloadChimère-0419bb2f1ff9ad08db2c336df31c9a0c51bb62b9.tar.bz2
Chimère-0419bb2f1ff9ad08db2c336df31c9a0c51bb62b9.zip
Manage conditionnal CSS (better to come...)
-rw-r--r--chimere/settings.sample.py6
-rw-r--r--chimere/templates/chimere/blocks/head_chimere.html2
-rw-r--r--chimere/templatetags/chimere_tags.py2
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