diff options
author | Étienne Loks <etienne.loks@proxience.com> | 2015-02-22 17:02:28 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@proxience.com> | 2015-02-22 17:02:28 +0100 |
commit | 80c656db799b87bad37d3fb16e880657ccef810d (patch) | |
tree | 8d1284e70570dd3ad45fa5e269d6f903289febaa | |
parent | ac85de348c85f36a0d00ebb1526fa9c0a4396cf7 (diff) | |
download | Chimère-80c656db799b87bad37d3fb16e880657ccef810d.tar.bz2 Chimère-80c656db799b87bad37d3fb16e880657ccef810d.zip |
Few style and layout fix
-rw-r--r-- | chimere/models.py | 30 | ||||
-rw-r--r-- | chimere/search_indexes.py | 2 | ||||
-rw-r--r-- | chimere/static/chimere/css/styles.css | 25 | ||||
-rw-r--r-- | chimere/templates/chimere/blocks/footer.html | 2 |
4 files changed, 30 insertions, 29 deletions
diff --git a/chimere/models.py b/chimere/models.py index 566b4fe..caddefc 100644 --- a/chimere/models.py +++ b/chimere/models.py @@ -660,6 +660,18 @@ class Marker(GeographicItem): '''Return a GeoJSON string ''' jsons = [] + full_json = u'{"type":"Feature", "geometry":%(geometry)s, '\ + u'"properties":{"pk": %(id)d, "name": %(name)s, '\ + u'"icon_path":"%(icon_path)s", '\ + u'"icon_hover_path":"%(icon_hover_path)s", '\ + u'"icon_width":%(icon_width)d, '\ + u'"icon_height":%(icon_height)d, '\ + u'"category_name":%(category_name)s}}' + light_json = u'{"type":"Feature", "geometry":%(geometry)s, '\ + u'"properties":{"pk": %(id)d, "name": %(name)s, '\ + u'"icon_path":"%(icon_path)s", '\ + u'"icon_hover_path":"%(icon_hover_path)s", '\ + u'"category_name":%(category_name)s}}' for cat in self.categories.all(): if categories_id and cat.id not in categories_id: continue @@ -668,16 +680,16 @@ class Marker(GeographicItem): 'icon_path':cat.icon.image, 'icon_hover_path':cat.hover_icon.image \ if cat.hover_icon else '', - 'icon_width':cat.icon.image.width, - 'icon_height':cat.icon.image.height, 'category_name':json.dumps(cat.name)} - jsons.append(u'{"type":"Feature", "geometry":%(geometry)s, '\ - u'"properties":{"pk": %(id)d, "name": %(name)s, '\ - u'"icon_path":"%(icon_path)s", '\ - u'"icon_hover_path":"%(icon_hover_path)s", '\ - u'"icon_width":%(icon_width)d, '\ - u'"icon_height":%(icon_height)d, '\ - u'"category_name":%(category_name)s}}' % items) + try: + items.update({'icon_width':cat.icon.image.width, + 'icon_height':cat.icon.image.height,}) + cjson = full_json % items + except IOError: + cjson = light_json % items + + jsons.append(cjson) + return ",".join(jsons) @property diff --git a/chimere/search_indexes.py b/chimere/search_indexes.py index 5e4a69a..edf9bd1 100644 --- a/chimere/search_indexes.py +++ b/chimere/search_indexes.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -# Copyright (C) 2014 Étienne Loks <etienne.loks_AT_peacefrogsDOTnet> +# Copyright (C) 2014-2015 Étienne Loks <etienne.loks_AT_peacefrogsDOTnet> # # This program is free software: you can redistribute it and/or modify diff --git a/chimere/static/chimere/css/styles.css b/chimere/static/chimere/css/styles.css index c0b3b0e..5d7f177 100644 --- a/chimere/static/chimere/css/styles.css +++ b/chimere/static/chimere/css/styles.css @@ -63,7 +63,7 @@ fieldset, .action li, #content, background-color:#FFF; } -div.warning, .errorlist{ +div.warning, .errorlist, .errorlist legend{ background-color:#ffca64; } @@ -75,23 +75,6 @@ div.warning, .errorlist{ border:1px solid #54c200; } -#layer_selection h4, -#layer_selection #layer_list, -#areas, #detail, #main-map, -div.warning, -#content, -.action li.selected, -#content .olControlLayerSwitcher .layersDiv, -#panel, #map-footer, #chimere_itinerary_panel, -#search-box, #utils-div{ - border:1px solid #327e04; -} - - -.errorlist{ - border:1px solid #ff3f3f; -} - /* rounded */ /* entête */ @@ -974,6 +957,12 @@ ul#multimedia_list_content li.multimedia{ min-height:50px; } +.errorlist legend{ + margin:0; + padding:0 10px; + border:none; +} + p.legend{ padding:0; margin:0; diff --git a/chimere/templates/chimere/blocks/footer.html b/chimere/templates/chimere/blocks/footer.html index 8958939..f5830ed 100644 --- a/chimere/templates/chimere/blocks/footer.html +++ b/chimere/templates/chimere/blocks/footer.html @@ -1,3 +1,3 @@ {% load i18n %} -{% trans "This site uses Chimère"%} <img src="{{STATIC_URL}}chimere/img/copyleft.png" alt="copyleft"/> 2008-2014 <a href='http://www.chymeres.net/'>Chimère project</a> - {% trans "Map"%} <img src="{{STATIC_URL}}chimere/img/copyleft.png" alt="copyleft"/> <a href='http://openstreetmap.org/'>OpenStreetMap</a> +{% trans "This site uses Chimère"%} <img src="{{STATIC_URL}}chimere/img/copyleft.png" alt="copyleft"/> 2008-2015 <a href='http://www.chymeres.net/'>Chimère project</a> - {% trans "Map"%} <img src="{{STATIC_URL}}chimere/img/copyleft.png" alt="copyleft"/> <a href='http://openstreetmap.org/'>OpenStreetMap</a> |