#18 EcoAccount funding

* adds fundings field to AbstractCompensation model
* adds funded by to detail view templates of Compensation and EcoAccount
* adds/updates translations
This commit is contained in:
mipel 2021-09-20 12:47:55 +02:00
parent df4052ac00
commit 7612b1eab2
5 changed files with 60 additions and 15 deletions

View File

@ -15,7 +15,8 @@ from django.db.models import Sum, QuerySet
from django.utils.translation import gettext_lazy as _ from django.utils.translation import gettext_lazy as _
from codelist.models import KonovaCode 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 intervention.models import Intervention, ResponsibilityData
from konova.models import BaseObject, BaseResource, Geometry, UuidModel, AbstractDocument, \ from konova.models import BaseObject, BaseResource, Geometry, UuidModel, AbstractDocument, \
generate_document_file_upload_path 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'") 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'") 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="+") deadlines = models.ManyToManyField("konova.Deadline", blank=True, related_name="+")
geometry = models.ForeignKey(Geometry, null=True, blank=True, on_delete=models.SET_NULL) geometry = models.ForeignKey(Geometry, null=True, blank=True, on_delete=models.SET_NULL)

View File

@ -66,6 +66,19 @@
{% endif %} {% endif %}
</td> </td>
</tr> </tr>
<tr>
<th scope="row">{% trans 'Funded by' %}</th>
<td class="align-middle">
{% for funding in obj.fundings.all %}
<div class="badge badge-pill rlp-r-outline">
{{ funding.short_name}}
</div>
<br>
{% empty %}
None
{% endfor %}
</td>
</tr>
<tr> <tr>
<th scope="row">{% trans 'Last modified' %}</th> <th scope="row">{% trans 'Last modified' %}</th>
<td class="align-middle"> <td class="align-middle">

View File

@ -65,6 +65,19 @@
<th scope="row">{% trans 'Intervention handler' %}</th> <th scope="row">{% trans 'Intervention handler' %}</th>
<td class="align-middle">{{obj.responsible.handler|default_if_none:""}}</td> <td class="align-middle">{{obj.responsible.handler|default_if_none:""}}</td>
</tr> </tr>
<tr>
<th scope="row">{% trans 'Funded by' %}</th>
<td class="align-middle">
{% for funding in obj.fundings.all %}
<div class="badge badge-pill rlp-r-outline">
{{ funding.short_name}}
</div>
<br>
{% empty %}
{% trans 'None' %}
{% endfor %}
</td>
</tr>
<tr> <tr>
<th scope="row">{% trans 'Last modified' %}</th> <th scope="row">{% trans 'Last modified' %}</th>
<td class="align-middle"> <td class="align-middle">

Binary file not shown.

View File

@ -16,7 +16,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \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" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -217,43 +217,44 @@ msgstr "Geben Sie die Daten der neuen Maßnahme ein"
msgid "Added action" msgid "Added action"
msgstr "Maßnahme hinzugefügt" msgstr "Maßnahme hinzugefügt"
#: compensation/models.py:77 #: compensation/models.py:78
msgid "cm" msgid "cm"
msgstr "" msgstr ""
#: compensation/models.py:78 #: compensation/models.py:79
msgid "m" msgid "m"
msgstr "" msgstr ""
#: compensation/models.py:79 #: compensation/models.py:80
msgid "km" msgid "km"
msgstr "" msgstr ""
#: compensation/models.py:80 #: compensation/models.py:81
msgid "m²" msgid "m²"
msgstr "" msgstr ""
#: compensation/models.py:81 #: compensation/models.py:82
msgid "ha" msgid "ha"
msgstr "" msgstr ""
#: compensation/models.py:82 #: compensation/models.py:83
msgid "Pieces" msgid "Pieces"
msgstr "Stück" msgstr "Stück"
#: compensation/models.py:299 #: compensation/models.py:312
msgid "" msgid ""
"Deductable surface can not be larger than existing surfaces in after states" "Deductable surface can not be larger than existing surfaces in after states"
msgstr "" 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 "" msgid ""
"Deductable surface can not be smaller than the sum of already existing " "Deductable surface can not be smaller than the sum of already existing "
"deductions. Please contact the responsible users for the deductions!" "deductions. Please contact the responsible users for the deductions!"
msgstr "" msgstr ""
"Es wurde bereits mehr Fläche abgebucht, als Sie nun als abbuchbar einstellen wollen. " "Es wurde bereits mehr Fläche abgebucht, als Sie nun als abbuchbar einstellen "
"Kontaktieren Sie die für die Abbuchungen verantwortlichen Nutzer!" "wollen. Kontaktieren Sie die für die Abbuchungen verantwortlichen Nutzer!"
#: compensation/tables.py:24 compensation/tables.py:164 ema/tables.py:28 #: compensation/tables.py:24 compensation/tables.py:164 ema/tables.py:28
#: intervention/forms.py:30 intervention/tables.py:23 #: intervention/forms.py:30 intervention/tables.py:23
@ -566,14 +567,14 @@ msgid "Recorded on "
msgstr "Verzeichnet am" msgstr "Verzeichnet am"
#: compensation/templates/compensation/detail/compensation/view.html:71 #: 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 #: ema/templates/ema/detail/view.html:54
#: intervention/templates/intervention/detail/view.html:103 #: intervention/templates/intervention/detail/view.html:103
msgid "Last modified" msgid "Last modified"
msgstr "Zuletzt bearbeitet" msgstr "Zuletzt bearbeitet"
#: compensation/templates/compensation/detail/compensation/view.html:79 #: 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 #: ema/templates/ema/detail/view.html:69 intervention/forms.py:255
#: intervention/templates/intervention/detail/view.html:111 #: intervention/templates/intervention/detail/view.html:111
msgid "Shared with" msgid "Shared with"
@ -652,6 +653,11 @@ msgstr "Aktenzeichen Naturschutzbehörde"
msgid "Intervention handler" msgid "Intervention handler"
msgstr "Eingriffsverursacher" 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/compensation_views.py:123
#: compensation/views/eco_account_views.py:190 ema/views.py:128 #: compensation/views/eco_account_views.py:190 ema/views.py:128
#: intervention/views.py:391 #: intervention/views.py:391