summaryrefslogtreecommitdiff
path: root/ishtar_common/templates/ishtar/blocks/sheet_geographic.html
blob: eeb618bfe6bb9918cc5466cbd4bdca643726fec0 (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
{% load i18n l10n ishtar_helpers window_field %}
{% with search_url=item.get_search_url %}
<table id='{{window_id}}-geographic-data' class="table table-striped">
    <tr>
        {% if not IS_HISTORY and permission_change_geo %}<th>&nbsp;</th>{% endif %}
        <th>{% trans "Main" %}</th>
        <th>{% trans "Data type" %}</th>
        <th>{% trans "Source" %}</th>
        <th>{% trans "Geometry" %}</th>
        <th>{% trans "Name" %}</th>
        <th>{% trans "Origin" %}</th>
        <th>{% trans "Provider" %}</th>
        <th>{% trans "Comment" %}</th>
        {% if not IS_HISTORY and permission_change_geo %}<th>&nbsp;</th>{% endif %}
    </tr>
{% for geo in geo_item.geodata.all %}
    <tr>
        {% if not IS_HISTORY and permission_change_geo %}<td>
        <a title="{% trans 'Edit' %}" href="{% url 'edit-geo' geo.pk %}{% if search_url %}?back_url={{search_url}}%3Fopen_item={{geo_item.pk|unlocalize}}{% endif %}">{% if geo|can_edit_item:request %}<i class="fa fa-pencil"></i></a>{% else %}&ndash;{% endif %}
        </td>{% endif %}
        <td>{% if geo.id == geo_item.main_geodata_id %}<i class="fa fa-check-circle text-success" aria-hidden="true"></i>{% else %}&ndash;{% endif %}</td>
        <td>{% if geo.data_type %}{{ geo.data_type }}{% else %}-{% endif %}</td>
        <td>{{ geo.source_label }}</td>
        <td>{{ geo.geometry_type_label }}</td>
        <td>{{ geo.name }}</td>
        <td>{% if geo.origin %}{{ geo.origin }}{% else %}-{% endif %}</td>
        <td>{% if geo.provider %}{{ geo.provider }}{% else %}-{% endif %}</td>
        <td>{% if geo.comment %}{{ geo.comment }}{% else %}-{% endif %}</td>
        {% if not IS_HISTORY and permission_change_geo and output != "ODT" and output != "PDF" %}<td>
            <a title="{% trans 'Delete' %}"
               href="{% url 'delete-geo' geo.pk %}{% if search_url %}?back_url={{search_url}}%3Fopen_item={{geo_item.pk|unlocalize}}{% endif %}">
                {% if geo|can_edit_item:request %}<i class="fa fa-trash text-danger"></i></a>{% else %}&ndash;{% endif %}
        </td>{% endif %}
    </tr>
{% endfor %}
</table>
{% if not IS_HISTORY and permission_change_geo and output != "ODT" and output != "PDF" %}
<div class="text-center">
    <a class="btn btn-success" href="{% url 'create-pre-geo' item.app_label item.model_name item.pk %}{% if search_url %}?back_url={{search_url}}%3Fopen_item={{geo_item.pk|unlocalize}}{% endif %}"><i class="fa fa-plus"></i> &nbsp;{% trans "geo item" %}</a>
</div>
{% endif %}
{% endwith %}