diff options
-rw-r--r-- | chimere/migrations/0018_auto_20180717_1204.py | 40 | ||||
-rw-r--r-- | chimere/models.py | 2 | ||||
-rw-r--r-- | chimere/static/chimere/js/jquery.chimere.js | 7 | ||||
-rw-r--r-- | chimere/templates/chimere/blocks/map.html | 1 | ||||
-rw-r--r-- | chimere/templatetags/chimere_tags.py | 1 | ||||
-rw-r--r-- | version.py | 2 |
6 files changed, 52 insertions, 1 deletions
diff --git a/chimere/migrations/0018_auto_20180717_1204.py b/chimere/migrations/0018_auto_20180717_1204.py new file mode 100644 index 0000000..ff21cbb --- /dev/null +++ b/chimere/migrations/0018_auto_20180717_1204.py @@ -0,0 +1,40 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.5 on 2018-07-17 12:04 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('chimere', '0017_auto_20180318_1958'), + ] + + operations = [ + migrations.AddField( + model_name='area', + name='single_click_map', + field=models.BooleanField(default=False, verbose_name='Mobile - Hide categories after click'), + ), + migrations.AlterField( + model_name='page', + name='content', + field=models.TextField(blank=True, help_text='Content of the page (do not fill external link if you want to display this content)', null=True, verbose_name='Content'), + ), + migrations.AlterField( + model_name='page', + name='image', + field=models.ImageField(blank=True, help_text='If an image is provided, this image replace the title on the menu', null=True, upload_to='maps', verbose_name='Image'), + ), + migrations.AlterField( + model_name='page', + name='url', + field=models.URLField(blank=True, help_text='Target to an external link (do not fill content if you want to point to this external link)', null=True, verbose_name='Url'), + ), + migrations.AlterField( + model_name='subcategory', + name='simplify_tolerance', + field=models.FloatField(blank=True, help_text='Only relevant when Minimum zoom is set. Use the Douglas-Peucker algorythm to simplify the geometry when details is not available. Adjust to your data volume and your performance need. 0.0003 is a good starting point. Note: topology is not preserved.', null=True, verbose_name='Simplify tolerance for lower zoom'), + ), + ] diff --git a/chimere/models.py b/chimere/models.py index 4bbe1bc..ccbe4ef 100644 --- a/chimere/models.py +++ b/chimere/models.py @@ -2075,6 +2075,8 @@ class Area(models.Model, SimpleArea): null=True) restrict_to_extent = models.BooleanField(_("Restrict to the area extent"), default=False) + single_click_map = models.BooleanField( + _("Mobile - Hide categories after click"), default=False) min_zoom = models.IntegerField( _("Minimum zoom"), blank=True, null=True, help_text=_("Set a minimal zoom level. By default minimal zoom level " diff --git a/chimere/static/chimere/js/jquery.chimere.js b/chimere/static/chimere/js/jquery.chimere.js index 53eadc1..ec9513e 100644 --- a/chimere/static/chimere/js/jquery.chimere.js +++ b/chimere/static/chimere/js/jquery.chimere.js @@ -226,6 +226,7 @@ function transformCoordToLonLat(coord) { lat: null, lon: null, simple: false, + single_click_category: false, routing_start_lat: null, routing_start_lon: null, routing_end_lat: null, @@ -1812,6 +1813,12 @@ function transformCoordToLonLat(coord) { $('#layer_cat_'+c_name).prop("checked", this.checked); } + if (settings[map_id].single_click_category){ + if($("#switch-menu").is(":visible")){ + $("#switch-map").click(); + slow = true; + } + } methods._hidePopup(map_id, e); }); $(".main-category-tick").bind("click", function(event){ diff --git a/chimere/templates/chimere/blocks/map.html b/chimere/templates/chimere/blocks/map.html index 8960d90..10e3143 100644 --- a/chimere/templates/chimere/blocks/map.html +++ b/chimere/templates/chimere/blocks/map.html @@ -29,6 +29,7 @@ $("#{{map_id}}").show(); var chimere_init_options = { {% if MOBILE %}"mobile": true,{% endif %} {% if enable_clustering %}"enable_clustering": true,{% endif %} + {% if single_click %}"single_click_category": true,{% endif %} "routing_panel_open": routing_panel_open, "category_accordion": false, "category_plus": STATIC_URL + "saclay/images/plus.png", diff --git a/chimere/templatetags/chimere_tags.py b/chimere/templatetags/chimere_tags.py index cabfd9f..4ed6183 100644 --- a/chimere/templatetags/chimere_tags.py +++ b/chimere/templatetags/chimere_tags.py @@ -292,6 +292,7 @@ def map(context, map_id='map'): context_data['min_zoom'] = area.min_zoom if area.max_zoom: context_data['max_zoom'] = area.max_zoom + context_data['single_click'] = area.single_click_map context_data['subcat_layer'], c_cat = [], None for subcat in subcat_layer.order_by('category__order', 'category').all(): @@ -1,4 +1,4 @@ -VERSION = (3, 1, 19) +VERSION = (3, 1, 20) def get_version(): |