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>2022-07-08 09:58:48 +0200
commit2a8d2108f9d87f62db245895cc716e90f2225af6 (patch)
tree941848bc1ef3914c21e5606bc62b422b10b85c5b /ishtar_common/templates/ishtar/blocks/sheet_geo_items.html
parent92bd9026e0b6397103da83bffe64f3a53ee06742 (diff)
downloadIshtar-2a8d2108f9d87f62db245895cc716e90f2225af6.tar.bz2
Ishtar-2a8d2108f9d87f62db245895cc716e90f2225af6.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