summaryrefslogtreecommitdiff
path: root/ishtar_common/templates/ishtar/blocks/sheet_geo_items.html
blob: 3d76a5aa5af31793a9de9695694ca7b0e7ae4dcd (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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
{% 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>
        <fieldset>
            {% if geo_item.SLUG == "operation" %}
            <input type="checkbox" name="display-cr-for-ope" id="display-cr-for-ope">
            <label for="display-cr-for-ope">{% trans "Display context records" %}</label>
            <input type="checkbox" name="display-bf-for-ope" id="display-bf-for-ope">
            <label for="display-bf-for-ope">{% trans "Display base finds" %}</label>
            {% else %}
            <input type="checkbox" name="display-bf-for-cr" id="display-bf-for-cr">
            <label for="display-bf-for-cr">{% trans "Display base finds" %}</label>
            {% endif %}
        </fieldset>
    </dd>
    <dd>
        {% if geo_item.SLUG == "operation" %}
        <label for="get-poly-ope" id="label-get-poly-ope">{% trans "Geometry: " %}</label>
        <select name="get-poly-ope" id="get-poly-ope">
            <option value="polygons" selected="selected">{% trans "Display polygons" %}</option>
            <option value="points">{% trans "Display points" %}</option>
        </select>
        {% else %}
        <label for="get-poly-cr" id="label-get-poly-cr">{% trans "Geometry: " %}</label>
        <select name="get-poly-cr" id="get-poly-cr">
            <option value="polygons" selected="selected">{% trans "Display polygons" %}</option>
            <option value="points">{% trans "Display points" %}</option>
        </select>
        {% endif %}
    </dd>
</dl>
<script>
const hide_get_polygons = function() {
    {% if geo_item.SLUG == "operation" %}
    const disp_cr = $("#display-cr-for-ope");
    const disp_bf = $("#display-bf-for-ope");
    const get_poly = $("#get-poly-ope");
    const label = $("#label-get-poly-ope");
    {% else %}
    const disp_cr = null;
    const disp_bf = $("#display-bf-for-cr");
    const get_poly = $("#get-poly-cr");
    const label = $("#label-get-poly-cr");
    {% endif %}
    get_poly.hide();
    label.hide();
    const display_get_poly = function () {
        if (disp_bf.prop('checked') || ((disp_cr != null) && disp_cr.prop('checked'))) {
            get_poly.show();
            label.show();
        } else {
            get_poly.hide();
            label.hide();}
    }
    if (disp_cr != null) {
        disp_cr.change( display_get_poly );
    }
    disp_bf.change( display_get_poly )
}
hide_get_polygons();

</script>
{% endif %}
{% endif %}