blob: 12e4b4ef0bb539ec882a03df15d7c8d61910c7cd (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
{% load i18n window_field %}{% if PROFILE.mapping %}
{% if geo_item.point_2d or geo_item.multi_polygon %}
<dl class="col-12">
<dt id="display-geo-items-for-{{geo_item.SLUG}}-{{geo_item.pk}}">{% trans "Display geo items" %}</dt>
<dd>
<fieldset>
{% if geo_item.SLUG == "operation" %}
<input type="checkbox" id="disp-cr-for-{{geo_item.SLUG}}-{{geo_item.pk}}" class='checkbox-geo-items'>
<label for="disp-cr-for-{{geo_item.SLUG}}-{{geo_item.pk}}">{% trans "Display context records" %}</label>
{% endif %}
<input type="checkbox" id="disp-bf-for-{{geo_item.SLUG}}-{{geo_item.pk}}" class='checkbox-geo-items'>
<label for="disp-bf-for-{{geo_item.SLUG}}-{{geo_item.pk}}">{% trans "Display base finds" %}</label>
</fieldset>
</dd>
<dd>
<label for="get-poly-for-{{geo_item.SLUG}}-{{geo_item.pk}}" id="get-poly-label-for-{{geo_item.SLUG}}-{{geo_item.pk}}">{% trans "Geometry: " %}</label>
<select id="get-poly-for-{{geo_item.SLUG}}-{{geo_item.pk}}" class='get-poly-geo-items'>
<option value="polygons" selected="selected">{% trans "Display polygons" %}</option>
<option value="points">{% trans "Display points" %}</option>
</select>
</dd>
</dl>
<script>
const hide_get_polygons = function() {
const disp_cr = $("#disp-cr-for-{{geo_item.SLUG}}-{{geo_item.pk}}");
const disp_bf = $("#disp-bf-for-{{geo_item.SLUG}}-{{geo_item.pk}}");
const get_poly = $("#get-poly-for-{{geo_item.SLUG}}-{{geo_item.pk}}");
const label = $("#get-poly-label-for-{{geo_item.SLUG}}-{{geo_item.pk}}");
get_poly.hide();
label.hide();
const display_get_poly = function () {
if (disp_bf.prop('checked') || ((disp_cr.length > 0) && disp_cr.prop('checked'))) {
get_poly.show();
label.show();
} else {
get_poly.hide();
label.hide();}
}
if (disp_cr.length > 0) {
disp_cr.change( display_get_poly );
}
disp_bf.change( display_get_poly )
}
hide_get_polygons();
</script>
{% endif %}
{% endif %}
|