summaryrefslogtreecommitdiff
path: root/ishtar_common/templates
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2022-09-29 18:05:08 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2022-12-12 12:23:18 +0100
commit8475c8d481208f1fa501de46e35f5a43fcddce4c (patch)
treec47ea21f2c4be849406d1d1ae40b34b560424504 /ishtar_common/templates
parentd2907db96fdb4b5cf3c26272923fbb755ca1d970 (diff)
downloadIshtar-8475c8d481208f1fa501de46e35f5a43fcddce4c.tar.bz2
Ishtar-8475c8d481208f1fa501de46e35f5a43fcddce4c.zip
Geodata: delete action
Diffstat (limited to 'ishtar_common/templates')
-rw-r--r--ishtar_common/templates/ishtar/blocks/sheet_geographic.html12
-rw-r--r--ishtar_common/templates/ishtar/forms/geo_delete_form.html118
2 files changed, 127 insertions, 3 deletions
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 @@
<th>{% trans "Origin" %}</th>
<th>{% trans "Provider" %}</th>
<th>{% trans "Comment" %}</th>
+ {% if permission_change_geo %}<th>&nbsp;</th>{% endif %}
</tr>
{% for geo in geo_item.geodata.all %}
<tr>
- {% if permission_change_geo %}
- <td><a href="{% url 'edit-geo' geo.pk %}{% if search_url %}?back_url={{search_url}}%3Fopen_item={{geo_item.pk}}{% endif %}">{% if geo|can_edit_item:request %}<i class="fa fa-pencil"></i></a>{% else %}&ndash;{% endif %}</td>
- {% endif %}
+ {% if 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}}{% 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>
@@ -25,6 +26,11 @@
<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 permission_change_geo %}<td>
+ <a title="{% trans 'Delete' %}"
+ href="{% url 'delete-geo' geo.pk %}{% if search_url %}?back_url={{search_url}}%3Fopen_item={{geo_item.pk}}{% endif %}">
+ {% if geo|can_edit_item:request %}<i class="fa fa-trash text-danger"></i></a>{% else %}&ndash;{% endif %}
+ </td>{% endif %}
</tr>
{% endfor %}
</table>
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 %}
+<h2>{{page_name}}</h2>
+ <form action="." method="post">{% csrf_token %}
+ <input type="hidden" name="back_url" value="{{back_url}}" />
+ <div class="form container">
+ {% block "warning_message" %}
+ <div class="alert alert-danger">
+ <div><i class="fa fa-exclamation-triangle" aria-hidden="true"></i>&nbsp;
+ {% trans "Are you sure to want to delete this geographic item?" %}
+ <p>{% trans "No rollback is possible." %}</p>
+ </div>
+ </div>
+ {% endblock %}
+
+ <div class="card">
+ <div class="card-header">
+ {{ object }}
+ </div>
+ <div class="card-body">
+ <table class="table">
+ <tr>
+ <th>{% trans "Name" %}</th><td>{{object.name|default:'-'}}</td>
+ </tr>
+ <tr>
+ <th>{% trans "Source" %}</th><td>{{object.source_label|default:'-'}}</td>
+ </tr>
+ <tr>
+ <th>{% trans "Origin" %}</th><td>{{object.origin|default:'-'}}</td>
+ </tr>
+ <tr>
+ <th>{% trans "Data type" %}</th><td>{{object.data_type|default:'-'}}</td>
+ </tr>
+ <tr>
+ <th>{% trans "Provider" %}</th><td>{{object.provider|default:'-'}}</td>
+ </tr>
+ <tr>
+ <th>{% trans "Comment" %}</th><td>{{object.comment|default:'-'}}</td>
+ </tr>
+ {% if object.related_items_ishtar_common_town.count %}
+ <tr>
+ <th>{% trans "Geographic item for these towns" %}</th>
+ <td><ul>
+ {% for item in object.related_items_ishtar_common_town.all %}
+ <li>{{item}}</li>{% endfor %}
+ </ul></td>
+ </tr>
+ {% endif %}
+ {% if object.related_items_archaeological_operations_operation.count %}
+ <tr>
+ <th>{% trans "Geographic item for these operations" %}</th>
+ <td><ul>
+ {% for item in object.related_items_archaeological_operations_operation.all %}
+ <li>{{item}}</li>{% endfor %}
+ </ul></td>
+ </tr>
+ {% endif %}
+ {% if object.related_items_archaeological_operations_archaeologicalsite.count %}
+ <tr>
+ <th>{% trans "Geographic item for these sites" %}</th>
+ <td><ul>
+ {% for item in object.related_items_archaeological_operations_archaeologicalsite.all %}
+ <li>{{item}}</li>{% endfor %}
+ </ul></td>
+ </tr>
+ {% endif %}
+ {% if object.related_items_archaeological_context_records_contextrecord.count %}
+ <tr>
+ <th>{% trans "Geographic item for these context records" %}</th>
+ <td><ul>
+ {% for item in object.related_items_archaeological_context_records_contextrecord.all %}
+ <li>{{item}}</li>{% endfor %}
+ </ul></td>
+ </tr>
+ {% endif %}
+ {% if object.related_items_archaeological_finds_basefind.count %}
+ <tr>
+ <th>{% trans "Geographic item for these base finds" %}</th>
+ <td><ul>
+ {% for item in object.related_items_archaeological_finds_basefind.all %}
+ <li>{{item}}</li>{% endfor %}
+ </ul></td>
+ </tr>
+ {% endif %}
+ {% if object.related_items_archaeological_warehouse_container.count %}
+ <tr>
+ <th>{% trans "Geographic item for these containers" %}</th>
+ <td><ul>
+ {% for item in object.related_items_archaeological_warehouse_container.all %}
+ <li>{{item}}</li>{% endfor %}
+ </ul></td>
+ </tr>
+ {% endif %}
+ {% if object.related_items_archaeological_warehouse_warehouse.count %}
+ <tr>
+ <th>{% trans "Geographic item for these operations" %}</th>
+ <td><ul>
+ {% for item in object.related_items_archaeological_warehouse_warehouse.all %}
+ <li>{{item}}</li>{% endfor %}
+ </ul></td>
+ </tr>
+ {% endif %}
+ </table>
+ </div>
+ </div>
+
+ </div>
+ {% block "footer" %}
+ <div id="footer">
+ <p class="confirm-message">{% trans "Are you sure to want to delete this import?" %}</p>
+ {% include 'ishtar/wizard/validation_bar.html' %}
+ {% include 'ishtar/blocks/footer.html' %}
+ </div>
+ {% endblock %}
+ </div>
+ </form>
+{% endblock %}