summaryrefslogtreecommitdiff
path: root/ishtar_common
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2019-02-26 11:59:03 +0100
committerÉtienne Loks <etienne.loks@iggdrasil.net>2019-04-24 19:38:57 +0200
commitbccac276d46ee4fc109efb5a37eba9cbcfda2f08 (patch)
tree88762341af66bb87beab2bd2ccc37c2a9e69a123 /ishtar_common
parente36e48efcdf8ed7368404b57b2ca7f36dcd60e71 (diff)
downloadIshtar-bccac276d46ee4fc109efb5a37eba9cbcfda2f08.tar.bz2
Ishtar-bccac276d46ee4fc109efb5a37eba9cbcfda2f08.zip
Map: improve layout on map windows
Diffstat (limited to 'ishtar_common')
-rw-r--r--ishtar_common/static/js/ishtar.js25
-rw-r--r--ishtar_common/templates/ishtar/blocks/sheet_simple_map.html2
2 files changed, 15 insertions, 12 deletions
diff --git a/ishtar_common/static/js/ishtar.js b/ishtar_common/static/js/ishtar.js
index 415398b95..0aac181ab 100644
--- a/ishtar_common/static/js/ishtar.js
+++ b/ishtar_common/static/js/ishtar.js
@@ -1269,18 +1269,21 @@ var displayed_map_msg = "{0} items displayed on the map";
var non_displayed_map_msg = "{0} items not displayed";
var non_displayed_map_link_msg = "(list)";
-var render_map = function(map_id, use_map_limit){
+var render_map = function(map_id, use_map_limit, hide_limit){
var html = "";
- html += "<div class='ishtar-map-top row'>";
- html += "<div class='ishtar-map-info col-sm' id='ishtar-map-info-" + map_id + "'></div>";
- html += "<div class='ishtar-map-limit col-sm form-check'>";
- html += "<input class='form-check-input' type='checkbox' id='ishtar-map-limit-" + map_id + "' ";
- if (use_map_limit) html += " checked='checked'";
- html += "/> ";
- html += "<label class='form-check-label' for='ishtar-map-limit-" + map_id + "'>";
- html += limit_map_msg.format(number_with_commas(limit_map_nb));
- html += " <i class='fa fa-question-circle' title=\""+ limit_map_help_msg +"\" aria-hidden='true'></i></label>";
- html += "</div></div>";
+ if (!hide_limit){
+ html += "<div class='ishtar-map-top row'>";
+ html += "<div class='ishtar-map-info col-sm' id='ishtar-map-info-" + map_id + "'></div>";
+ html += "<div class='ishtar-map-limit col-sm form-check'>";
+ html += "<input class='form-check-input' type='checkbox' id='ishtar-map-limit-" + map_id + "' ";
+ if (use_map_limit) html += " checked='checked'";
+ html += "/> ";
+ html += "<label class='form-check-label' for='ishtar-map-limit-" + map_id + "'>";
+ html += limit_map_msg.format(number_with_commas(limit_map_nb));
+ html += " <i class='fa fa-question-circle' title=\""+ limit_map_help_msg +"\" aria-hidden='true'></i></label>";
+ html += "</div></div>";
+ }
+
html += "<div class='ishtar-table-map' id='" + map_id + "'></div>";
html += "<div class='ishtar-map-popup' id='ishtar-map-popup-" + map_id + "'></div>";
html += render_map_list_modal(map_id);
diff --git a/ishtar_common/templates/ishtar/blocks/sheet_simple_map.html b/ishtar_common/templates/ishtar/blocks/sheet_simple_map.html
index d0ec50b5f..d94c6024c 100644
--- a/ishtar_common/templates/ishtar/blocks/sheet_simple_map.html
+++ b/ishtar_common/templates/ishtar/blocks/sheet_simple_map.html
@@ -5,7 +5,7 @@
<div id="map-content-{{window_id}}-{{geo_item.SLUG}}-{{geo_item.pk}}"></div>
</div>
<script type="text/javascript">
-var html = render_map("map-{{window_id}}-{{geo_item.SLUG}}-{{geo_item.pk}}");
+var html = render_map("map-{{window_id}}-{{geo_item.SLUG}}-{{geo_item.pk}}", false, true);
$("#map-content-{{window_id}}-{{geo_item.SLUG}}-{{geo_item.pk}}").html(html);
{% if geo_item.point_source == 'P' or not geo_item.multi_polygon %}
var {{geo_item.SLUG}}{{geo_item.pk}} = {{geo_item.point_2d_geojson|safe}};