From ad6174177c495291bf039660243a3d360ff2134d Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Tue, 12 Oct 2021 16:07:34 +0200 Subject: Preventive file: back button - quick action button --- archaeological_files/models.py | 8 ++++++++ .../templates/ishtar/forms/preventive_detail.html | 7 +++++++ archaeological_files/views.py | 2 +- ishtar_common/templates/ishtar/forms/base_form.html | 2 ++ 4 files changed, 18 insertions(+), 1 deletion(-) diff --git a/archaeological_files/models.py b/archaeological_files/models.py index 0eac73119..c6ab3b3d5 100644 --- a/archaeological_files/models.py +++ b/archaeological_files/models.py @@ -1085,6 +1085,14 @@ class File( actions = super(File, self).get_extra_actions(request) if self.can_do(request, "add_administrativeact"): actions += [ + ( + reverse("file-edit-preventive", args=[self.pk]), + _("Edit intervention plan"), + "fa fa-plus", + _("plan"), + "", + False, + ), ( reverse("file-add-adminact", args=[self.pk]), _("Add associated administrative act"), diff --git a/archaeological_files/templates/ishtar/forms/preventive_detail.html b/archaeological_files/templates/ishtar/forms/preventive_detail.html index 3c58053ba..1d743c615 100644 --- a/archaeological_files/templates/ishtar/forms/preventive_detail.html +++ b/archaeological_files/templates/ishtar/forms/preventive_detail.html @@ -78,3 +78,10 @@ }); {% endblock %} {# #} +{% block extra_validation_button %} +
+ + {% trans "Back to the file" %} + +
+{% endblock %} diff --git a/archaeological_files/views.py b/archaeological_files/views.py index 5a7c6b1d9..b9c4395f5 100644 --- a/archaeological_files/views.py +++ b/archaeological_files/views.py @@ -407,7 +407,7 @@ class MixFormFormsetUpdateView(UpdateView): class PreventiveEditView(IshtarMixin, LoginRequiredMixin, MixFormFormsetUpdateView): - page_name = _("Preventive modification") + page_name = _("Intervention plan") form_class = forms.FileFormPreventiveDetail template_name = "ishtar/forms/preventive_detail.html" model = models.File diff --git a/ishtar_common/templates/ishtar/forms/base_form.html b/ishtar_common/templates/ishtar/forms/base_form.html index 3f069e7d6..69825eed2 100644 --- a/ishtar_common/templates/ishtar/forms/base_form.html +++ b/ishtar_common/templates/ishtar/forms/base_form.html @@ -47,6 +47,8 @@ {% if submit_label %}{{submit_label}}{% else%}{% trans "Validate" %}{% endif %} + {% block extra_validation_button %} + {% endblock %} {% include 'ishtar/blocks/footer.html' %} -- cgit v1.2.3