diff --git a/umap/static/umap/umap.css b/umap/static/umap/umap.css index e4adfcc2c864839a8079a20e9670b7eeb7e3d303..fffb5639d064512714a88265f1fe85c6efbab840 100644 --- a/umap/static/umap/umap.css +++ b/umap/static/umap/umap.css @@ -80,6 +80,32 @@ input:-moz-placeholder, :-moz-placeholder { background-color: #970b0e; } +#style_options > * { + display: none; +} + +#style_options .more_style_options, +#style_options legend { + display: block; + cursor: pointer; +} +#style_options .more_style_options:before { + content: "…"; +} +#style_options legend:before { + content: "▶"; + padding-right: 5px; +} +#style_options.on legend:before { + content: "▼"; +} +#style_options.on > * { + display: block; +} +#style_options.on .more_style_options { + display: none; +} + /* Map infos */ .category_color { display: inline-block; diff --git a/umap/templates/base.html b/umap/templates/base.html index f46ebd909da2f678686608671e994f569e0c8e21..d34145653323cffc5bcf4517602c41cea40046eb 100644 --- a/umap/templates/base.html +++ b/umap/templates/base.html @@ -45,6 +45,19 @@ {% endcompress js %} {% block bottom_js %} <script src="{{ STATIC_URL }}storage/contrib/js/storage.ui.default.js"></script> + <script type="text/javascript"> + function fn (e) { + var styleDiv = L.DomUtil.get("style_options"); + if (L.DomUtil.hasClass(styleDiv, "on")) { + L.DomUtil.removeClass(styleDiv, "on"); + } + else { + L.DomUtil.addClass(styleDiv, "on"); + } + } + $(document).on('click', '#style_options_toggle', fn); + $(document).on('click', '.more_style_options', fn); + </script> {% endblock %} <div id="storage-ui-container"></div> <div id="storage-alert-container"></div> diff --git a/umap/templates/umap/styles_fieldset.html b/umap/templates/umap/styles_fieldset.html index b90577325953bf04ea73e571226d409c3d957bfb..a494a5cbd62ab6918dfe1abbbb09644610541fb4 100644 --- a/umap/templates/umap/styles_fieldset.html +++ b/umap/templates/umap/styles_fieldset.html @@ -1,7 +1,8 @@ {% load umap_tags i18n %} -<fieldset> - <legend>{% trans "Styles" %}</legend> - {% foundation_field form.color %} +<fieldset id="style_options"> + <legend id="style_options_toggle">{% trans "Styles options" %}</legend> + <label class="more_style_options"></label> + {% foundation_field form.options_color %} {% if form.icon_class and form.pictogram %} <div class="formbox columns twelve"> <div class="six columns"> @@ -12,4 +13,22 @@ </div> </div> {% endif %} -</fieldset> + {% foundation_field form.options_weight %} + {% if form.options_stroke %} + <div class="formbox"> + <span>{{ form.options_stroke.label }}</span>{{ form.options_stroke }} + </div> + <small class="help-text">{{ form.options_stroke.help_text }}</small> + {% endif %} + {% foundation_field form.options_smoothFactor %} + {% foundation_field form.options_opacity %} + {% if form.options_fill %} + <div class="formbox"> + <span>{{ form.options_fill.label }}</span>{{ form.options_fill }} + </div> + <small class="help-text">{{ form.options_fill.help_text }}</small> + {% endif %} + {% foundation_field form.options_fillOpacity %} + {% foundation_field form.options_fillColor %} + {% foundation_field form.options_dashArray %} +</fieldset> \ No newline at end of file