From 6818ef290e70c49ddf0a98b00a6c251ee44d53ea Mon Sep 17 00:00:00 2001 From: mipel Date: Wed, 4 Aug 2021 13:32:35 +0200 Subject: [PATCH] Intervention revocation * adds Revocation model to interventions/models.py * adds revocations to interventions detail view * fixes duplicated ids in html includes * refactors controls for detail view into included template files (controls.html) * reduces max length for payment transfer notes from 1000 to 200 * adds RevocationAdmin to intervention/admin.py * adds new form for adding a Revocation to an intervention's legal_data * only one revocation per intervention possible * removes add button in case of an existing revocation * adds revocation routes to intervention app * renames document field in Document model into file for more clarity * adds/updates translations --- compensation/forms.py | 3 +- .../compensation/detail/includes/actions.html | 2 +- .../detail/includes/controls.html | 26 ++ .../detail/includes/deadlines.html | 2 +- .../detail/includes/documents.html | 2 +- .../detail/includes/states-after.html | 2 +- .../detail/includes/states-before.html | 2 +- .../templates/compensation/detail/view.html | 25 +- intervention/admin.py | 12 +- intervention/forms.py | 70 ++++- intervention/models.py | 18 +- .../detail/includes/compensations.html | 2 +- .../detail/includes/controls.html | 43 +++ .../detail/includes/documents.html | 2 +- .../includes/eco-account-withdraws.html | 2 +- .../detail/includes/payments.html | 2 +- .../detail/includes/revocation.html | 70 +++++ .../templates/intervention/detail/view.html | 53 +--- intervention/urls.py | 6 +- intervention/views.py | 71 ++++- konova/forms.py | 2 +- konova/models.py | 4 +- konova/sub_settings/django_settings.py | 6 +- locale/de/LC_MESSAGES/django.mo | Bin 14290 -> 14793 bytes locale/de/LC_MESSAGES/django.po | 265 +++++++++++------- 25 files changed, 495 insertions(+), 197 deletions(-) create mode 100644 compensation/templates/compensation/detail/includes/controls.html create mode 100644 intervention/templates/intervention/detail/includes/controls.html create mode 100644 intervention/templates/intervention/detail/includes/revocation.html diff --git a/compensation/forms.py b/compensation/forms.py index b6d801eb..ccba35cd 100644 --- a/compensation/forms.py +++ b/compensation/forms.py @@ -47,7 +47,7 @@ class NewPaymentForm(BaseModalForm): ) ) transfer_note = forms.CharField( - max_length=1000, + max_length=200, required=False, label_suffix=_(""), label=_("Transfer note"), @@ -55,7 +55,6 @@ class NewPaymentForm(BaseModalForm): ) def __init__(self, *args, **kwargs): - self.template = "modal/modal_form.html" super().__init__(*args, **kwargs) self.intervention = self.instance self.form_title = _("Payment") diff --git a/compensation/templates/compensation/detail/includes/actions.html b/compensation/templates/compensation/detail/includes/actions.html index 5a56e80c..ec6fd4ab 100644 --- a/compensation/templates/compensation/detail/includes/actions.html +++ b/compensation/templates/compensation/detail/includes/actions.html @@ -1,5 +1,5 @@ {% load i18n l10n fontawesome_5 humanize %} -