diff options
author | etienne <etienne@9215b0d5-fb2c-4bbd-8d3e-bd2e9090e864> | 2010-03-01 21:11:40 +0000 |
---|---|---|
committer | etienne <etienne@9215b0d5-fb2c-4bbd-8d3e-bd2e9090e864> | 2010-03-01 21:11:40 +0000 |
commit | 7f7c333f114eee34dd089543e84028eb18f448c4 (patch) | |
tree | 2f4342ed79718c1377b7c36d9bcc1393fa3169c6 | |
parent | 0b244065c631cbec0ca08e3b8fe4a15792c4443b (diff) | |
download | Chimère-7f7c333f114eee34dd089543e84028eb18f448c4.tar.bz2 Chimère-7f7c333f114eee34dd089543e84028eb18f448c4.zip |
Load only one time the categories when DYNAMIC_CATEGORIES is disabled
git-svn-id: http://www.peacefrogs.net/svn/chimere/trunk@68 9215b0d5-fb2c-4bbd-8d3e-bd2e9090e864
-rw-r--r-- | chimere/main/views.py | 4 | ||||
-rw-r--r-- | chimere/static/main_map.js | 5 | ||||
-rw-r--r-- | chimere/static/styles.css | 4 | ||||
-rw-r--r-- | chimere/templates/main_map.html | 1 |
4 files changed, 11 insertions, 3 deletions
diff --git a/chimere/main/views.py b/chimere/main/views.py index f584702..86d98e7 100644 --- a/chimere/main/views.py +++ b/chimere/main/views.py @@ -69,6 +69,7 @@ def index(request): 'welcome':welcome(request, display_welcome), 'areas':Area.getAvailable(), 'map_layer':settings.MAP_LAYER, + 'dynamic_categories':settings.DYNAMIC_CATEGORIES, }) # manage permalink if request.GET: @@ -270,7 +271,8 @@ def getAvailableCategories(request, area=None, status='A', force=None): subcategories = SubCategory.getAvailable() response_dct['sub_categories'] = subcategories return render_to_response('categories.html', response_dct) - default_message = "<p>%s</p>" % _("No category available in this area.") + default_message = "<p class='warning'>%s</p>" % \ + _("No category available in this area.") if not status: # there must be a status status = 'A' try: diff --git a/chimere/static/main_map.js b/chimere/static/main_map.js index ee742a2..52d694f 100644 --- a/chimere/static/main_map.js +++ b/chimere/static/main_map.js @@ -465,8 +465,9 @@ function init(){ map.addLayers([map_layer]); map.events.register('click', map, hidePopUp); - map.events.register('moveend', map, refreshMapItems); - + if (dynamic_categories){ + map.events.register('moveend', map, refreshMapItems); + } /* if from a permalink */ if (p_zoom) { var p_centerLonLat = new OpenLayers.LonLat(p_lon, p_lat); diff --git a/chimere/static/styles.css b/chimere/static/styles.css index c6a0b97..217cba3 100644 --- a/chimere/static/styles.css +++ b/chimere/static/styles.css @@ -388,6 +388,10 @@ border-radius: 10px; background-color:#ffdbdb; } +p.warning{ +text-align:center; +} + #logos{ text-align:center; z-index:5; diff --git a/chimere/templates/main_map.html b/chimere/templates/main_map.html index 3b27d2a..a6c95e4 100644 --- a/chimere/templates/main_map.html +++ b/chimere/templates/main_map.html @@ -29,6 +29,7 @@ <script type='text/javascript'><!-- var map_layer = {{map_layer|safe}}; var permalink_label = '{%trans "Permalink"%}'; +var dynamic_categories{%if dynamic_categories %} = 1{%endif%}; var p_zoom; {%if p_zoom %}p_zoom={{p_zoom}}; var p_lat={{p_lat}}; |