summaryrefslogtreecommitdiff
path: root/ishtar_common/templates/ishtar/blocks/sheet_geo_items.html
diff options
context:
space:
mode:
authorQuentinAndre <quentin.andre@imt-atlantique.net>2021-07-26 14:43:05 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2021-09-01 12:36:46 +0200
commita1abf9cd4ae5a736026e2e47d3add324dd3e461b (patch)
tree0c3413c590b76e85b25c6c1f0bfd121589089c6c /ishtar_common/templates/ishtar/blocks/sheet_geo_items.html
parentc18865b0d1e0103abcd7db77ec99abe39dbdbcd4 (diff)
downloadIshtar-a1abf9cd4ae5a736026e2e47d3add324dd3e461b.tar.bz2
Ishtar-a1abf9cd4ae5a736026e2e47d3add324dd3e461b.zip
url with get and display geo items
Diffstat (limited to 'ishtar_common/templates/ishtar/blocks/sheet_geo_items.html')
-rw-r--r--ishtar_common/templates/ishtar/blocks/sheet_geo_items.html48
1 files changed, 48 insertions, 0 deletions
diff --git a/ishtar_common/templates/ishtar/blocks/sheet_geo_items.html b/ishtar_common/templates/ishtar/blocks/sheet_geo_items.html
new file mode 100644
index 000000000..451453d59
--- /dev/null
+++ b/ishtar_common/templates/ishtar/blocks/sheet_geo_items.html
@@ -0,0 +1,48 @@
+{% load i18n window_field %}{% if PROFILE.mapping %}
+{% if geo_item.point_2d or geo_item.multi_polygon %}
+<dl class="col-12">
+ <dt>{% trans "Display geo items" %}</dt>
+ <dd>
+ <label for="display-geo-items">{% trans "Display associated features: " %}</label>
+ <select name="display-geo-items" id="display-geo-items">
+ <option value="" selected="selected">{% trans "None" %}</option>
+ <option id="disp-context-records" value="contextrecords">{% trans "Context records" %}</option>
+ <option value="basefinds">{% trans "Base finds" %}</option>
+ </select>
+ </dd>
+ <dd>
+ <label for="get-polygons" id="label-get-polygons">{% trans "Geometry: " %}</label>
+ <select name="get-polygons" id="get-polygons">
+ <option value="polygons" selected="selected">{% trans "Display polygons" %}</option>
+ <option value="points">{% trans "Display points" %}</option>
+ </select>
+ </dd>
+</dl>
+<script>
+var hide_context_records = function() {
+ if ("{{geo_item.SLUG}}" === "contextrecord") {
+ const disp_cr = $("#disp-context-records")[0];
+ disp_cr.hidden = true;
+ }
+}
+hide_context_records();
+
+var hide_get_polygons = function() {
+ const disp = $("#display-geo-items")[0];
+ const get_poly = $("#get-polygons")[0];
+ const label = $("#label-get-polygons")[0];
+ get_poly.hidden = true;
+ label.hidden = true;
+ disp.addEventListener('change', (event) => {
+ if (event.target.value === "") {
+ get_poly.hidden = true;
+ label.hidden = true;
+ get_poly.value = "";
+ } else { get_poly.hidden = false;
+ label.hidden = false;}
+ })
+}
+hide_get_polygons();
+</script>
+{% endif %}
+{% endif %} \ No newline at end of file