From 1d26a7a62d150d19e659e66515fcda5a40c6c68a Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Wed, 28 Nov 2018 17:14:20 +0100 Subject: Treatment deletion: more explicit messages. --- .../ishtar/wizard/wizard_treatement_deletion.html | 27 ++++++++++++++++++++++ archaeological_finds/wizards.py | 1 + ishtar_common/models_imports.py | 2 +- .../templates/ishtar/wizard/confirm_wizard.html | 8 ++++++- 4 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 archaeological_finds/templates/ishtar/wizard/wizard_treatement_deletion.html diff --git a/archaeological_finds/templates/ishtar/wizard/wizard_treatement_deletion.html b/archaeological_finds/templates/ishtar/wizard/wizard_treatement_deletion.html new file mode 100644 index 000000000..b0ebe7409 --- /dev/null +++ b/archaeological_finds/templates/ishtar/wizard/wizard_treatement_deletion.html @@ -0,0 +1,27 @@ +{% extends "ishtar/wizard/confirm_wizard.html" %} +{% load i18n %} + +{% block "warning_message" %} +{% with has_downstream=current_object.downstream.count %} +
+ + {% trans "Are you sure you want to delete this treatment?" %} +{% if has_downstream %} + {% trans "The following finds will be deleted and restored to a previous version."%} + + {% trans "All changes made to the associated finds since this treatment record will be lost!" %} +{% endif %} +
+ +
+ {% trans "Treatment informations:" %} +
+ + + +{% endwith %} +{% endblock %} diff --git a/archaeological_finds/wizards.py b/archaeological_finds/wizards.py index 29ca50056..8ed7061e2 100644 --- a/archaeological_finds/wizards.py +++ b/archaeological_finds/wizards.py @@ -396,6 +396,7 @@ class Treatment1NWizard(TreatmentBase): class TreatmentDeletionWizard(DeletionWizard): + wizard_confirm = 'ishtar/wizard/wizard_treatement_deletion.html' model = models.Treatment fields = ['label', 'other_reference', 'year', 'index', 'treatment_types', 'location', 'person', 'organization', diff --git a/ishtar_common/models_imports.py b/ishtar_common/models_imports.py index 9aae1d52d..fde4b3440 100644 --- a/ishtar_common/models_imports.py +++ b/ishtar_common/models_imports.py @@ -133,7 +133,7 @@ class ImporterType(models.Model): ImporterModel, verbose_name=_(u"Models that can accept new items"), blank=True, help_text=_(u"Leave blank for no restrictions"), related_name='+') - is_template = models.BooleanField(_(u"Is template"), default=False) + is_template = models.BooleanField(_(u"Can be exported"), default=False) unicity_keys = models.CharField(_(u"Unicity keys (separator \";\")"), blank=True, null=True, max_length=500) available = models.BooleanField(_(u"Available"), default=True) diff --git a/ishtar_common/templates/ishtar/wizard/confirm_wizard.html b/ishtar_common/templates/ishtar/wizard/confirm_wizard.html index 401fe570c..9829058a8 100644 --- a/ishtar_common/templates/ishtar/wizard/confirm_wizard.html +++ b/ishtar_common/templates/ishtar/wizard/confirm_wizard.html @@ -9,7 +9,12 @@
{% csrf_token %}
{% block "warning_informations" %}{% endblock %} -

{% if confirm_msg %}{{confirm_msg|safe}}{%else%}{% trans "You have entered the following informations:" %}{%endif%}

+ {% block "warning_message" %} +
+ {% if confirm_msg %}{{confirm_msg|safe}}{%else%}{% trans "You have entered the following informations:" %}{%endif%} +
+ {% endblock %} + {% block "detailed_informations" %} {% for form_label, form_data in datas %}
@@ -42,6 +47,7 @@ {{ extra_form }} {% endif %} + {% endblock %} {% block "extra_informations" %}{% endblock %} {% block "footer" %} -- cgit v1.2.3