diff options
6 files changed, 79 insertions, 14 deletions
diff --git a/archaeological_files/templates/ishtar/wizard/wizard_file_deletion.html b/archaeological_files/templates/ishtar/wizard/wizard_file_deletion.html index a29436e1d..d45747e4e 100644 --- a/archaeological_files/templates/ishtar/wizard/wizard_file_deletion.html +++ b/archaeological_files/templates/ishtar/wizard/wizard_file_deletion.html @@ -1,6 +1,6 @@  {% extends "ishtar/wizard/delete_wizard.html" %}  {% load i18n %} -{% block "detailled_extra_info" %} +{% block "detailed_extra_info" %}  {% if current_object.operations.count %}  <h3>{% trans "Associated operations" %}</h3> diff --git a/archaeological_warehouse/templates/ishtar/wizard/wizard_container_deletion.html b/archaeological_warehouse/templates/ishtar/wizard/wizard_container_deletion.html new file mode 100644 index 000000000..ea11652af --- /dev/null +++ b/archaeological_warehouse/templates/ishtar/wizard/wizard_container_deletion.html @@ -0,0 +1,58 @@ +{% extends "ishtar/wizard/delete_wizard.html" %} +{% load i18n %} +{% block "detailed_related_info" %} + +{% if current_object.children.count %} +<div class="card"> +  <div class="card-header"> +    {% trans "Associated containers" %} +  </div> +  <div class="card-body"> +    <div class="alert alert-danger"> +      <div><i class="fa fa-exclamation-triangle" aria-hidden="true"></i> +        {% trans "Theses containers are inside this item. If you delete this item, they won't have any parent container. You probably want to fix that." %} +      </div> +    </div> +    <ul class='list'> +    {% for container in current_object.children.all %} +      <li>{{container}} <a class='display_details_inline' href="#" +                        onclick='load_window("{% url "show-container" container.pk "" %}")'><i class="fa fa-info-circle" aria-hidden="true"></i></a></li>{% endfor %} +    </ul> +  </div> +</div> +{% endif %} +{% if current_object.finds.count or current_object.finds_ref.count %} +<div class="card"> +  <div class="card-header"> +    {% trans "Associated finds" %} +  </div> +  <div class="card-body"> +    {% if current_object.finds.count %} +    <div class="alert alert-danger"> +      <div><i class="fa fa-exclamation-triangle" aria-hidden="true"></i> +        {% trans "Theses finds are inside this item. If you delete this item, they won't be inside any container. You probably want to fix that." %} +      </div> +    </div> +    <ul class='list'> +      {% for find in current_object.finds.all %} +      <li>{{find}} <a class='display_details_inline' href="#" +                           onclick='load_window("{% url "show-find" find.pk "" %}")'><i class="fa fa-info-circle" aria-hidden="true"></i></a></li>{% endfor %} +    </ul> +    {% endif %} +    {% if current_object.finds_ref.count %} +    <div class="alert alert-danger"> +      <div><i class="fa fa-exclamation-triangle" aria-hidden="true"></i> +        {% trans "This item is the reference container for theses finds. If you delete this item, they won't have any reference container. You probably want to fix that." %} +      </div> +    </div> +    <ul class='list'> +      {% for find in current_object.finds_ref.all %} +      <li>{{find}} <a class='display_details_inline' href="#" +                      onclick='load_window("{% url "show-find" find.pk "" %}")'><i class="fa fa-info-circle" aria-hidden="true"></i></a></li>{% endfor %} +    </ul> +    {% endif %} +  </div> +</div> +{% endif %} + +{% endblock %} diff --git a/archaeological_warehouse/wizards.py b/archaeological_warehouse/wizards.py index 9bce9381b..614e6e6be 100644 --- a/archaeological_warehouse/wizards.py +++ b/archaeological_warehouse/wizards.py @@ -179,3 +179,6 @@ class ContainerDeletionWizard(MultipleDeletionWizard):      fields = ['container_type', 'reference', 'comment', 'location', 'index',                'cached_label']      redirect_url = "container_deletion" +    wizard_templates = { +        'final-container_deletion': +            'ishtar/wizard/wizard_container_deletion.html'} diff --git a/ishtar_common/templates/ishtar/wizard/delete_wizard.html b/ishtar_common/templates/ishtar/wizard/delete_wizard.html index 21c5f31b5..3a3d5ab1d 100644 --- a/ishtar_common/templates/ishtar/wizard/delete_wizard.html +++ b/ishtar_common/templates/ishtar/wizard/delete_wizard.html @@ -3,15 +3,15 @@  {% load range %}  {% block "warning_message" %}  <div class="alert alert-danger"> -    <p><i class="fa fa-exclamation-triangle" aria-hidden="true"></i> -    {% if current_objs and current_objs.1 %} -    {% trans "Are you sure to want to delete theses items?" %} -    <ul>{% for obj in current_objs %} -        <li>{{obj}}</li> -    {% endfor %}</ul> -    {% else %} -    {% trans "Are you sure to want to delete this item?" %}{% endif %} -    </p> +    <div><i class="fa fa-exclamation-triangle" aria-hidden="true"></i> +        {% if current_objs and current_objs.1 %} +        {% trans "Are you sure to want to delete theses items?" %} +        <ul>{% for obj in current_objs %} +            <li>{{obj}}</li> +        {% endfor %}</ul> +        {% else %} +        {% trans "Are you sure to want to delete this item?" %}{% endif %} +    </div>      <p>{% trans "No rollback is possible. Be careful to scroll to the end of page to check every piece of information." %}</p>  </div>  {% endblock %} @@ -26,7 +26,7 @@      </div>{% endif %}      <div class="card-body">          {% for current_object in current_objs %}{% if forloop.counter == forloop.parentloop.counter %} -        {% block "detailled_extra_info" %} +        {% block "detailed_extra_info" %}          {% endblock %}          {% endif %}{% endfor %}          <table class='table'> @@ -34,9 +34,13 @@              <tr{% if data.2 %} class='{{data.2}}'{%endif%}><th>{{data.0}}</th><td>{{data.1}}</td></tr>              {% endfor %}          </table> -      </div>  </div> +{% for current_object in current_objs %}{% if forloop.counter == forloop.parentloop.counter %} +{% block "detailed_related_info" %} +{% endblock %} +{% endif %}{% endfor %} +  {% endfor %}  {% endblock "cards" %} diff --git a/ishtar_common/templates/ishtar/wizard/wizard_organization_deletion.html b/ishtar_common/templates/ishtar/wizard/wizard_organization_deletion.html index bd45ab5e8..ba99042d9 100644 --- a/ishtar_common/templates/ishtar/wizard/wizard_organization_deletion.html +++ b/ishtar_common/templates/ishtar/wizard/wizard_organization_deletion.html @@ -1,6 +1,6 @@  {% extends "ishtar/wizard/delete_wizard.html" %}  {% load i18n %} -{% block "detailled_extra_info" %} +{% block "detailed_extra_info" %}  {% if current_object.members.count %}  <h3>{% trans "Associated persons" %}</h3> diff --git a/ishtar_common/templates/ishtar/wizard/wizard_person_deletion.html b/ishtar_common/templates/ishtar/wizard/wizard_person_deletion.html index 27595286b..d078aeba3 100644 --- a/ishtar_common/templates/ishtar/wizard/wizard_person_deletion.html +++ b/ishtar_common/templates/ishtar/wizard/wizard_person_deletion.html @@ -1,6 +1,6 @@  {% extends "ishtar/wizard/delete_wizard.html" %}  {% load i18n %} -{% block "detailled_extra_info" %} +{% block "detailed_extra_info" %}  {% if current_object.file_responsability.count %}  <h3>{% trans "In charge of archaeological files" %}</h3>  | 
