diff --git a/compensation/models.py b/compensation/models.py index bc6aaa58..4ab3f952 100644 --- a/compensation/models.py +++ b/compensation/models.py @@ -15,7 +15,8 @@ from django.db.models import Sum, QuerySet from django.utils.translation import gettext_lazy as _ from codelist.models import KonovaCode -from codelist.settings import CODELIST_COMPENSATION_ACTION_ID, CODELIST_BIOTOPES_ID +from codelist.settings import CODELIST_COMPENSATION_ACTION_ID, CODELIST_BIOTOPES_ID, \ + CODELIST_COMPENSATION_COMBINATION_ID from intervention.models import Intervention, ResponsibilityData from konova.models import BaseObject, BaseResource, Geometry, UuidModel, AbstractDocument, \ generate_document_file_upload_path @@ -138,6 +139,18 @@ class AbstractCompensation(BaseObject): after_states = models.ManyToManyField(CompensationState, blank=True, related_name='+', help_text="Refers to 'Zielzustand Biotop'") actions = models.ManyToManyField(CompensationAction, blank=True, help_text="Refers to 'Maßnahmen'") + fundings = models.ManyToManyField( + KonovaCode, + null=True, + blank=True, + limit_choices_to={ + "code_lists__in": [CODELIST_COMPENSATION_COMBINATION_ID], + "is_selectable": True, + "is_archived": False, + }, + help_text="List of funding project codes", + ) + deadlines = models.ManyToManyField("konova.Deadline", blank=True, related_name="+") geometry = models.ForeignKey(Geometry, null=True, blank=True, on_delete=models.SET_NULL) diff --git a/compensation/templates/compensation/detail/compensation/view.html b/compensation/templates/compensation/detail/compensation/view.html index f0c0c1ad..6401cdb7 100644 --- a/compensation/templates/compensation/detail/compensation/view.html +++ b/compensation/templates/compensation/detail/compensation/view.html @@ -66,6 +66,19 @@ {% endif %} + + {% trans 'Funded by' %} + + {% for funding in obj.fundings.all %} +
+ {{ funding.short_name}} +
+
+ {% empty %} + None + {% endfor %} + + {% trans 'Last modified' %} diff --git a/compensation/templates/compensation/detail/eco_account/view.html b/compensation/templates/compensation/detail/eco_account/view.html index 7af9b648..f03c22b2 100644 --- a/compensation/templates/compensation/detail/eco_account/view.html +++ b/compensation/templates/compensation/detail/eco_account/view.html @@ -65,6 +65,19 @@ {% trans 'Intervention handler' %} {{obj.responsible.handler|default_if_none:""}} + + {% trans 'Funded by' %} + + {% for funding in obj.fundings.all %} +
+ {{ funding.short_name}} +
+
+ {% empty %} + {% trans 'None' %} + {% endfor %} + + {% trans 'Last modified' %} diff --git a/locale/de/LC_MESSAGES/django.mo b/locale/de/LC_MESSAGES/django.mo index 25b93fb8..51178b8f 100644 Binary files a/locale/de/LC_MESSAGES/django.mo and b/locale/de/LC_MESSAGES/django.mo differ diff --git a/locale/de/LC_MESSAGES/django.po b/locale/de/LC_MESSAGES/django.po index 2f954fa3..757a35b9 100644 --- a/locale/de/LC_MESSAGES/django.po +++ b/locale/de/LC_MESSAGES/django.po @@ -16,7 +16,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-20 08:55+0200\n" +"POT-Creation-Date: 2021-09-20 12:44+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -217,43 +217,44 @@ msgstr "Geben Sie die Daten der neuen Maßnahme ein" msgid "Added action" msgstr "Maßnahme hinzugefügt" -#: compensation/models.py:77 +#: compensation/models.py:78 msgid "cm" msgstr "" -#: compensation/models.py:78 +#: compensation/models.py:79 msgid "m" msgstr "" -#: compensation/models.py:79 +#: compensation/models.py:80 msgid "km" msgstr "" -#: compensation/models.py:80 +#: compensation/models.py:81 msgid "m²" msgstr "" -#: compensation/models.py:81 +#: compensation/models.py:82 msgid "ha" msgstr "" -#: compensation/models.py:82 +#: compensation/models.py:83 msgid "Pieces" msgstr "Stück" -#: compensation/models.py:299 +#: compensation/models.py:312 msgid "" "Deductable surface can not be larger than existing surfaces in after states" msgstr "" -"Die abbuchbare Fläche darf die Gesamtfläche der Zielzustände nicht überschreiten" +"Die abbuchbare Fläche darf die Gesamtfläche der Zielzustände nicht " +"überschreiten" -#: compensation/models.py:306 +#: compensation/models.py:319 msgid "" "Deductable surface can not be smaller than the sum of already existing " "deductions. Please contact the responsible users for the deductions!" msgstr "" -"Es wurde bereits mehr Fläche abgebucht, als Sie nun als abbuchbar einstellen wollen. " -"Kontaktieren Sie die für die Abbuchungen verantwortlichen Nutzer!" +"Es wurde bereits mehr Fläche abgebucht, als Sie nun als abbuchbar einstellen " +"wollen. Kontaktieren Sie die für die Abbuchungen verantwortlichen Nutzer!" #: compensation/tables.py:24 compensation/tables.py:164 ema/tables.py:28 #: intervention/forms.py:30 intervention/tables.py:23 @@ -566,14 +567,14 @@ msgid "Recorded on " msgstr "Verzeichnet am" #: compensation/templates/compensation/detail/compensation/view.html:71 -#: compensation/templates/compensation/detail/eco_account/view.html:70 +#: compensation/templates/compensation/detail/eco_account/view.html:83 #: ema/templates/ema/detail/view.html:54 #: intervention/templates/intervention/detail/view.html:103 msgid "Last modified" msgstr "Zuletzt bearbeitet" #: compensation/templates/compensation/detail/compensation/view.html:79 -#: compensation/templates/compensation/detail/eco_account/view.html:78 +#: compensation/templates/compensation/detail/eco_account/view.html:91 #: ema/templates/ema/detail/view.html:69 intervention/forms.py:255 #: intervention/templates/intervention/detail/view.html:111 msgid "Shared with" @@ -652,6 +653,11 @@ msgstr "Aktenzeichen Naturschutzbehörde" msgid "Intervention handler" msgstr "Eingriffsverursacher" +#: compensation/templates/compensation/detail/eco_account/view.html:70 +msgid "Funded by" +msgstr "Gefördert mit" + + #: compensation/views/compensation_views.py:123 #: compensation/views/eco_account_views.py:190 ema/views.py:128 #: intervention/views.py:391