From 4ab3725af5ba8f12d69cbc1702baa13e9773880e Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Thu, 29 Sep 2022 18:05:08 +0200 Subject: Geodata: delete action --- .../templates/ishtar/blocks/sheet_geographic.html | 12 ++- .../templates/ishtar/forms/geo_delete_form.html | 118 +++++++++++++++++++++ 2 files changed, 127 insertions(+), 3 deletions(-) create mode 100644 ishtar_common/templates/ishtar/forms/geo_delete_form.html (limited to 'ishtar_common/templates') diff --git a/ishtar_common/templates/ishtar/blocks/sheet_geographic.html b/ishtar_common/templates/ishtar/blocks/sheet_geographic.html index 295c7ef46..8b6255f26 100644 --- a/ishtar_common/templates/ishtar/blocks/sheet_geographic.html +++ b/ishtar_common/templates/ishtar/blocks/sheet_geographic.html @@ -11,12 +11,13 @@ {% trans "Origin" %} {% trans "Provider" %} {% trans "Comment" %} + {% if permission_change_geo %} {% endif %} {% for geo in geo_item.geodata.all %} - {% if permission_change_geo %} - {% if geo|can_edit_item:request %}{% else %}–{% endif %} - {% endif %} + {% if permission_change_geo %} + {% if geo|can_edit_item:request %}{% else %}–{% endif %} + {% endif %} {% if geo.id == geo_item.main_geodata_id %}{% else %}–{% endif %} {% if geo.data_type %}{{ geo.data_type }}{% else %}-{% endif %} {{ geo.source_label }} @@ -25,6 +26,11 @@ {% if geo.origin %}{{ geo.origin }}{% else %}-{% endif %} {% if geo.provider %}{{ geo.provider }}{% else %}-{% endif %} {% if geo.comment %}{{ geo.comment }}{% else %}-{% endif %} + {% if permission_change_geo %} + + {% if geo|can_edit_item:request %}{% else %}–{% endif %} + {% endif %} {% endfor %} diff --git a/ishtar_common/templates/ishtar/forms/geo_delete_form.html b/ishtar_common/templates/ishtar/forms/geo_delete_form.html new file mode 100644 index 000000000..643e4d211 --- /dev/null +++ b/ishtar_common/templates/ishtar/forms/geo_delete_form.html @@ -0,0 +1,118 @@ +{% extends "base.html" %} +{% load i18n inline_formset verbose_names %} +{% block content %} +

{{page_name}}

+
{% csrf_token %} + +
+ {% block "warning_message" %} +
+
  + {% trans "Are you sure to want to delete this geographic item?" %} +

{% trans "No rollback is possible." %}

+
+
+ {% endblock %} + +
+
+ {{ object }} +
+
+ + + + + + + + + + + + + + + + + + + + {% if object.related_items_ishtar_common_town.count %} + + + + + {% endif %} + {% if object.related_items_archaeological_operations_operation.count %} + + + + + {% endif %} + {% if object.related_items_archaeological_operations_archaeologicalsite.count %} + + + + + {% endif %} + {% if object.related_items_archaeological_context_records_contextrecord.count %} + + + + + {% endif %} + {% if object.related_items_archaeological_finds_basefind.count %} + + + + + {% endif %} + {% if object.related_items_archaeological_warehouse_container.count %} + + + + + {% endif %} + {% if object.related_items_archaeological_warehouse_warehouse.count %} + + + + + {% endif %} +
{% trans "Name" %}{{object.name|default:'-'}}
{% trans "Source" %}{{object.source_label|default:'-'}}
{% trans "Origin" %}{{object.origin|default:'-'}}
{% trans "Data type" %}{{object.data_type|default:'-'}}
{% trans "Provider" %}{{object.provider|default:'-'}}
{% trans "Comment" %}{{object.comment|default:'-'}}
{% trans "Geographic item for these towns" %}
    + {% for item in object.related_items_ishtar_common_town.all %} +
  • {{item}}
  • {% endfor %} +
{% trans "Geographic item for these operations" %}
    + {% for item in object.related_items_archaeological_operations_operation.all %} +
  • {{item}}
  • {% endfor %} +
{% trans "Geographic item for these sites" %}
    + {% for item in object.related_items_archaeological_operations_archaeologicalsite.all %} +
  • {{item}}
  • {% endfor %} +
{% trans "Geographic item for these context records" %}
    + {% for item in object.related_items_archaeological_context_records_contextrecord.all %} +
  • {{item}}
  • {% endfor %} +
{% trans "Geographic item for these base finds" %}
    + {% for item in object.related_items_archaeological_finds_basefind.all %} +
  • {{item}}
  • {% endfor %} +
{% trans "Geographic item for these containers" %}
    + {% for item in object.related_items_archaeological_warehouse_container.all %} +
  • {{item}}
  • {% endfor %} +
{% trans "Geographic item for these operations" %}
    + {% for item in object.related_items_archaeological_warehouse_warehouse.all %} +
  • {{item}}
  • {% endfor %} +
+
+
+ +
+ {% block "footer" %} + + {% endblock %} + +
+{% endblock %} -- cgit v1.2.3