summaryrefslogtreecommitdiff
path: root/ishtar_common/templates/ishtar/blocks/sheet_geo_items.html
diff options
context:
space:
mode:
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