diff --git a/compensation/forms/modalForms.py b/compensation/forms/modalForms.py index 53fdf3c..c70d52a 100644 --- a/compensation/forms/modalForms.py +++ b/compensation/forms/modalForms.py @@ -127,7 +127,7 @@ class NewStateModalForm(BaseModalForm): } ), ) - biotope_extra = forms.ModelChoiceField( + biotope_extra = forms.ModelMultipleChoiceField( label=_("Biotope additional type"), label_suffix="", required=False, diff --git a/compensation/models/compensation.py b/compensation/models/compensation.py index 6603557..46ea452 100644 --- a/compensation/models/compensation.py +++ b/compensation/models/compensation.py @@ -114,6 +114,8 @@ class AbstractCompensation(BaseObject, GeoReferencedMixin): biotope_type=form_data["biotope_type"], surface=form_data["surface"], ) + state_additional_types = form_data["biotope_extra"] + state.biotope_extra_types.set(state_additional_types) if is_before_state: self.before_states.add(state) else: diff --git a/compensation/models/state.py b/compensation/models/state.py index 01aad14..a4b8faf 100644 --- a/compensation/models/state.py +++ b/compensation/models/state.py @@ -8,7 +8,7 @@ Created on: 16.11.21 from django.db import models from codelist.models import KonovaCode -from codelist.settings import CODELIST_BIOTOPES_ID +from codelist.settings import CODELIST_BIOTOPES_ID, CODELIST_BIOTOPES_EXTRA_CODES_ID from compensation.managers import CompensationStateManager from konova.models import UuidModel @@ -26,7 +26,18 @@ class CompensationState(UuidModel): "code_lists__in": [CODELIST_BIOTOPES_ID], "is_selectable": True, "is_archived": False, - } + }, + related_name='+', + ) + biotope_extra_types = models.ManyToManyField( + KonovaCode, + blank=True, + limit_choices_to={ + "code_lists__in": [CODELIST_BIOTOPES_EXTRA_CODES_ID], + "is_selectable": True, + "is_archived": False, + }, + related_name='+', ) surface = models.FloatField() diff --git a/konova/autocompletes.py b/konova/autocompletes.py index cbe42b0..a5d6ea6 100644 --- a/konova/autocompletes.py +++ b/konova/autocompletes.py @@ -95,6 +95,7 @@ class KonovaCodeAutocomplete(Select2GroupQuerySetView): * c: Search inside a special codelist """ + paginate_by = 50 def order_by(self, qs): """ Orders by a predefined value @@ -199,6 +200,7 @@ class BiotopeExtraCodeAutocomplete(KonovaCodeAutocomplete): """ group_by_related = "parent" related_field_name = "long_name" + paginate_by = 200 def __init__(self, *args, **kwargs): self.c = CODELIST_BIOTOPES_EXTRA_CODES_ID diff --git a/locale/de/LC_MESSAGES/django.mo b/locale/de/LC_MESSAGES/django.mo index cb58ae7..f93f41b 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 40c27fe..2c57d8d 100644 --- a/locale/de/LC_MESSAGES/django.po +++ b/locale/de/LC_MESSAGES/django.po @@ -5,7 +5,7 @@ # #: compensation/filters.py:122 compensation/forms/modalForms.py:34 #: compensation/forms/modalForms.py:45 compensation/forms/modalForms.py:61 -#: compensation/forms/modalForms.py:238 compensation/forms/modalForms.py:316 +#: compensation/forms/modalForms.py:255 compensation/forms/modalForms.py:333 #: intervention/forms/forms.py:52 intervention/forms/forms.py:154 #: intervention/forms/forms.py:166 intervention/forms/modalForms.py:125 #: intervention/forms/modalForms.py:138 intervention/forms/modalForms.py:151 @@ -26,7 +26,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-01-28 16:27+0100\n" +"POT-Creation-Date: 2022-01-31 10:52+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -95,7 +95,7 @@ msgstr "" #: analysis/templates/analysis/reports/includes/eco_account/amount.html:3 #: analysis/templates/analysis/reports/includes/intervention/amount.html:3 #: analysis/templates/analysis/reports/includes/old_data/amount.html:3 -#: compensation/forms/modalForms.py:299 +#: compensation/forms/modalForms.py:316 #: compensation/templates/compensation/detail/eco_account/includes/deductions.html:34 #: intervention/templates/intervention/detail/includes/deductions.html:31 msgid "Amount" @@ -177,8 +177,9 @@ msgstr "Einzelflächen" #: analysis/templates/analysis/reports/includes/intervention/laws.html:23 #: analysis/templates/analysis/reports/includes/intervention/laws.html:43 #: analysis/templates/analysis/reports/includes/old_data/amount.html:19 -#: konova/templates/konova/home.html:23 konova/templates/konova/home.html:61 -#: konova/templates/konova/home.html:100 +#: konova/templates/konova/includes/quickstart/compensations.html:16 +#: konova/templates/konova/includes/quickstart/ecoaccounts.html:16 +#: konova/templates/konova/includes/quickstart/interventions.html:16 msgid "Total" msgstr "Insgesamt" @@ -212,7 +213,7 @@ msgstr "Abbuchungen" #: analysis/templates/analysis/reports/includes/eco_account/deductions.html:9 #: analysis/templates/analysis/reports/includes/eco_account/deductions.html:11 -#: compensation/forms/modalForms.py:133 +#: compensation/forms/modalForms.py:150 #: compensation/templates/compensation/detail/compensation/includes/states-after.html:36 #: compensation/templates/compensation/detail/compensation/includes/states-before.html:36 #: compensation/templates/compensation/detail/eco_account/includes/states-after.html:36 @@ -240,7 +241,8 @@ msgstr "Kompensationsart" #: analysis/templates/analysis/reports/includes/old_data/amount.html:29 #: compensation/tables.py:85 #: compensation/templates/compensation/detail/compensation/view.html:19 -#: konova/templates/konova/home.html:49 templates/navbars/navbar.html:28 +#: konova/templates/konova/includes/quickstart/compensations.html:4 +#: templates/navbars/navbar.html:28 msgid "Compensation" msgstr "Kompensation" @@ -285,7 +287,8 @@ msgstr "Typ" #: intervention/forms/modalForms.py:306 intervention/forms/modalForms.py:313 #: intervention/tables.py:89 #: intervention/templates/intervention/detail/view.html:19 -#: konova/templates/konova/home.html:11 templates/navbars/navbar.html:22 +#: konova/templates/konova/includes/quickstart/interventions.html:4 +#: templates/navbars/navbar.html:22 msgid "Intervention" msgstr "Eingriff" @@ -293,7 +296,8 @@ msgstr "Eingriff" #: compensation/tables.py:226 #: compensation/templates/compensation/detail/eco_account/view.html:19 #: intervention/forms/modalForms.py:279 intervention/forms/modalForms.py:286 -#: konova/templates/konova/home.html:88 templates/navbars/navbar.html:34 +#: konova/templates/konova/includes/quickstart/ecoaccounts.html:4 +#: templates/navbars/navbar.html:34 msgid "Eco-account" msgstr "Ökokonto" @@ -350,7 +354,7 @@ msgid "Compensation XY; Location ABC" msgstr "Kompensation XY; Flur ABC" #: compensation/forms/forms.py:57 compensation/forms/modalForms.py:60 -#: compensation/forms/modalForms.py:237 compensation/forms/modalForms.py:315 +#: compensation/forms/modalForms.py:254 compensation/forms/modalForms.py:332 #: compensation/templates/compensation/detail/compensation/includes/actions.html:34 #: compensation/templates/compensation/detail/compensation/includes/deadlines.html:34 #: compensation/templates/compensation/detail/compensation/includes/documents.html:31 @@ -478,8 +482,8 @@ msgstr "Fällig am" msgid "Due on which date" msgstr "Zahlung wird an diesem Datum erwartet" -#: compensation/forms/modalForms.py:62 compensation/forms/modalForms.py:239 -#: compensation/forms/modalForms.py:317 intervention/forms/modalForms.py:152 +#: compensation/forms/modalForms.py:62 compensation/forms/modalForms.py:256 +#: compensation/forms/modalForms.py:334 intervention/forms/modalForms.py:152 #: konova/forms.py:375 msgid "Additional comment, maximum {} letters" msgstr "Zusätzlicher Kommentar, maximal {} Zeichen" @@ -500,31 +504,39 @@ msgstr "Biotoptyp" msgid "Select the biotope type" msgstr "Biotoptyp wählen" -#: compensation/forms/modalForms.py:136 intervention/forms/modalForms.py:297 +#: compensation/forms/modalForms.py:131 compensation/forms/modalForms.py:143 +msgid "Biotope additional type" +msgstr "Zusatzbezeichnung" + +#: compensation/forms/modalForms.py:134 +msgid "Select an additional biotope type" +msgstr "Zusatzbezeichnung wählen" + +#: compensation/forms/modalForms.py:153 intervention/forms/modalForms.py:297 msgid "in m²" msgstr "" -#: compensation/forms/modalForms.py:147 +#: compensation/forms/modalForms.py:164 msgid "New state" msgstr "Neuer Zustand" -#: compensation/forms/modalForms.py:148 +#: compensation/forms/modalForms.py:165 msgid "Insert data for the new state" msgstr "Geben Sie die Daten des neuen Zustandes ein" -#: compensation/forms/modalForms.py:155 konova/forms.py:190 +#: compensation/forms/modalForms.py:172 konova/forms.py:190 msgid "Object removed" msgstr "Objekt entfernt" -#: compensation/forms/modalForms.py:209 +#: compensation/forms/modalForms.py:226 msgid "Deadline Type" msgstr "Fristart" -#: compensation/forms/modalForms.py:212 +#: compensation/forms/modalForms.py:229 msgid "Select the deadline type" msgstr "Fristart wählen" -#: compensation/forms/modalForms.py:221 +#: compensation/forms/modalForms.py:238 #: compensation/templates/compensation/detail/compensation/includes/deadlines.html:31 #: compensation/templates/compensation/detail/eco_account/includes/deadlines.html:31 #: ema/templates/ema/detail/includes/deadlines.html:31 @@ -532,27 +544,27 @@ msgstr "Fristart wählen" msgid "Date" msgstr "Datum" -#: compensation/forms/modalForms.py:224 +#: compensation/forms/modalForms.py:241 msgid "Select date" msgstr "Datum wählen" -#: compensation/forms/modalForms.py:251 +#: compensation/forms/modalForms.py:268 msgid "New deadline" msgstr "Neue Frist" -#: compensation/forms/modalForms.py:252 +#: compensation/forms/modalForms.py:269 msgid "Insert data for the new deadline" msgstr "Geben Sie die Daten der neuen Frist ein" -#: compensation/forms/modalForms.py:270 +#: compensation/forms/modalForms.py:287 msgid "Action Type" msgstr "Maßnahmentyp" -#: compensation/forms/modalForms.py:273 +#: compensation/forms/modalForms.py:290 msgid "Select the action type" msgstr "Maßnahmentyp wählen" -#: compensation/forms/modalForms.py:282 +#: compensation/forms/modalForms.py:299 #: compensation/templates/compensation/detail/compensation/includes/actions.html:38 #: compensation/templates/compensation/detail/compensation/includes/deadlines.html:38 #: compensation/templates/compensation/detail/compensation/includes/documents.html:35 @@ -578,23 +590,23 @@ msgstr "Maßnahmentyp wählen" msgid "Action" msgstr "Aktionen" -#: compensation/forms/modalForms.py:287 +#: compensation/forms/modalForms.py:304 msgid "Unit" msgstr "Einheit" -#: compensation/forms/modalForms.py:290 +#: compensation/forms/modalForms.py:307 msgid "Select the unit" msgstr "Einheit wählen" -#: compensation/forms/modalForms.py:302 +#: compensation/forms/modalForms.py:319 msgid "Insert the amount" msgstr "Menge eingeben" -#: compensation/forms/modalForms.py:328 +#: compensation/forms/modalForms.py:345 msgid "New action" msgstr "Neue Maßnahme" -#: compensation/forms/modalForms.py:329 +#: compensation/forms/modalForms.py:346 msgid "Insert data for the new action" msgstr "Geben Sie die Daten der neuen Maßnahme ein" @@ -876,13 +888,13 @@ msgstr "Ist CEF Maßnahme" #: compensation/templates/compensation/detail/compensation/view.html:56 #: venv/lib/python3.7/site-packages/django/forms/widgets.py:710 msgid "Yes" -msgstr "" +msgstr "Ja" #: compensation/templates/compensation/detail/compensation/view.html:48 #: compensation/templates/compensation/detail/compensation/view.html:58 #: venv/lib/python3.7/site-packages/django/forms/widgets.py:711 msgid "No" -msgstr "" +msgstr "Nein" #: compensation/templates/compensation/detail/compensation/view.html:53 msgid "Is Coherence keeping compensation" @@ -1725,21 +1737,6 @@ msgstr "" msgid "English" msgstr "" -#: konova/templates/konova/home.html:27 konova/templates/konova/home.html:65 -#: konova/templates/konova/home.html:104 -msgid "Shared with you" -msgstr "Für Sie freigegeben" - -#: konova/templates/konova/home.html:35 konova/templates/konova/home.html:73 -#: konova/templates/konova/home.html:114 -msgid "Create" -msgstr "Neu" - -#: konova/templates/konova/home.html:40 konova/templates/konova/home.html:78 -#: konova/templates/konova/home.html:119 -msgid "Show" -msgstr "Anzeigen" - #: konova/templates/konova/includes/parcels.html:3 msgid "Spatial reference" msgstr "Raumreferenz" @@ -1764,6 +1761,24 @@ msgstr "Kreis" msgid "Gemarkung" msgstr "Gemarkung" +#: konova/templates/konova/includes/quickstart/compensations.html:20 +#: konova/templates/konova/includes/quickstart/ecoaccounts.html:20 +#: konova/templates/konova/includes/quickstart/interventions.html:20 +msgid "Shared with you" +msgstr "Für Sie freigegeben" + +#: konova/templates/konova/includes/quickstart/compensations.html:28 +#: konova/templates/konova/includes/quickstart/ecoaccounts.html:30 +#: konova/templates/konova/includes/quickstart/interventions.html:28 +msgid "Create" +msgstr "Neu" + +#: konova/templates/konova/includes/quickstart/compensations.html:33 +#: konova/templates/konova/includes/quickstart/ecoaccounts.html:35 +#: konova/templates/konova/includes/quickstart/interventions.html:33 +msgid "Show" +msgstr "Anzeigen" + #: konova/templates/konova/widgets/generate-content-input.html:6 msgid "Generate new" msgstr "Neu generieren"