diff --git a/compensation/models.py b/compensation/models.py
index 1d3e7cce..8c45bcf6 100644
--- a/compensation/models.py
+++ b/compensation/models.py
@@ -7,9 +7,8 @@ Created on: 17.11.20
"""
from django.contrib.auth.models import User
from django.contrib.gis.db import models
-from django.core.validators import MinValueValidator, MaxValueValidator
-from django.db import transaction
-from django.utils import timezone
+from django.core.validators import MinValueValidator
+from django.db.models import Sum
from django.utils.timezone import now
from django.utils.translation import gettext_lazy as _
@@ -121,6 +120,14 @@ class AbstractCompensation(BaseObject):
class Meta:
abstract = True
+ def get_surface(self) -> float:
+ """ Calculates the compensation's/account's surface
+
+ Returns:
+ sum_surface (float)
+ """
+ return self.after_states.all().aggregate(Sum("surface"))["surface__sum"]
+
class Compensation(AbstractCompensation):
"""
@@ -188,6 +195,14 @@ class EcoAccount(AbstractCompensation):
def __str__(self):
return "{}".format(self.identifier)
+ def get_surface_withdraws(self) -> float:
+ """ Calculates the compensation's/account's surface
+
+ Returns:
+ sum_surface (float)
+ """
+ return self.withdraws.all().aggregate(Sum("surface"))["surface__sum"]
+
class EcoAccountWithdraw(BaseResource):
"""
diff --git a/compensation/templates/compensation/detail/eco_account/includes/withdraws.html b/compensation/templates/compensation/detail/eco_account/includes/withdraws.html
index d085742e..6a003567 100644
--- a/compensation/templates/compensation/detail/eco_account/includes/withdraws.html
+++ b/compensation/templates/compensation/detail/eco_account/includes/withdraws.html
@@ -11,12 +11,10 @@
@@ -32,6 +30,9 @@
{% trans 'Amount' %}
|
+
+ {% trans 'Created' %}
+ |
{% trans 'Action' %}
|
@@ -46,6 +47,7 @@
{{ withdraw.surface|floatformat:2|intcomma }} m² |
+ {{ withdraw.created.timestamp|default_if_none:""|naturalday}} |
{% if is_default_member and has_access %}
|
{% if is_default_member and has_access %}
-
+
{% fa5_icon 'trash' %}
{% endif %}
diff --git a/intervention/templates/intervention/detail/includes/withdraws.html b/intervention/templates/intervention/detail/includes/withdraws.html
index 8a170bd7..ba577060 100644
--- a/intervention/templates/intervention/detail/includes/withdraws.html
+++ b/intervention/templates/intervention/detail/includes/withdraws.html
@@ -11,12 +11,10 @@
@@ -32,6 +30,9 @@
{% trans 'Amount' %}
|
+
+ {% trans 'Created' %}
+ |
{% trans 'Action' %}
|
@@ -49,6 +50,7 @@
|
{{ withdraw.surface|floatformat:2|intcomma }} m² |
+ {{ withdraw.created.timestamp|default_if_none:""|naturalday}} |
{% if is_default_member and has_access %}
diff --git a/intervention/urls.py b/intervention/urls.py
index e580d4b9..05f580b8 100644
--- a/intervention/urls.py
+++ b/intervention/urls.py
@@ -8,7 +8,7 @@ Created on: 30.11.20
from django.urls import path
from intervention.views import index_view, new_view, open_view, edit_view, remove_view, new_document_view, share_view, \
- create_share_view, remove_revocation_view, new_revocation_view, run_check_view, log_view
+ create_share_view, remove_revocation_view, new_revocation_view, run_check_view, log_view, new_withdraw_view
app_name = "intervention"
urlpatterns = [
@@ -23,7 +23,10 @@ urlpatterns = [
path('/share', create_share_view, name='share-create'),
path('/check', run_check_view, name='run-check'),
+ # Withdraws
+ path('/withdraw/new', new_withdraw_view, name='acc-new-withdraw'),
+
# Revocation routes
- path('/revocation/new', new_revocation_view, name='revocation-new'),
- path('revocation//remove', remove_revocation_view, name='revocation-remove'),
+ path('/revocation/new', new_revocation_view, name='new-revocation'),
+ path('revocation//remove', remove_revocation_view, name='remove-revocation'),
]
\ No newline at end of file
diff --git a/intervention/views.py b/intervention/views.py
index 5a7e9203..0f8f8c8c 100644
--- a/intervention/views.py
+++ b/intervention/views.py
@@ -5,7 +5,7 @@ from django.http import HttpRequest
from django.shortcuts import render, get_object_or_404
from intervention.forms import NewInterventionForm, EditInterventionForm, ShareInterventionForm, NewRevocationForm, \
- RunCheckForm
+ RunCheckForm, NewWithdrawForm
from intervention.models import Intervention, Revocation
from intervention.tables import InterventionTable
from konova.contexts import BaseContext
@@ -392,3 +392,23 @@ def log_view(request: HttpRequest, id: str):
}
context = BaseContext(request, context).context
return render(request, template, context)
+
+
+@login_required
+@default_group_required
+def new_withdraw_view(request: HttpRequest, id: str):
+ """ Renders a modal form view for creating withdraws
+
+ Args:
+ request (HttpRequest): The incoming request
+ id (str): The intervention's id which shall get a new withdraw
+
+ Returns:
+
+ """
+ intervention = get_object_or_404(Intervention, id=id)
+ form = NewWithdrawForm(request.POST or None, instance=intervention, user=request.user)
+ return form.process_request(
+ request,
+ msg_success=_("Withdraw added")
+ )
diff --git a/konova/autocompletes.py b/konova/autocompletes.py
index 21319bf2..cf01e02a 100644
--- a/konova/autocompletes.py
+++ b/konova/autocompletes.py
@@ -7,6 +7,8 @@ Created on: 07.12.20
"""
from dal_select2.views import Select2QuerySetView
+from compensation.models import EcoAccount
+from intervention.models import Intervention
from organisation.models import Organisation
@@ -35,4 +37,40 @@ class NonOfficialOrganisationAutocomplete(Select2QuerySetView):
qs = qs.order_by(
"name"
)
+ return qs
+
+
+class EcoAccountAutocomplete(Select2QuerySetView):
+ def get_queryset(self):
+ if self.request.user.is_anonymous:
+ return EcoAccount.objects.none()
+ qs = EcoAccount.objects.filter(
+ deleted=None,
+ recorded__isnull=False,
+ )
+ if self.q:
+ qs = qs.filter(
+ identifier__icontains=self.q
+ )
+ qs = qs.order_by(
+ "identifier"
+ )
+ return qs
+
+
+class InterventionAutocomplete(Select2QuerySetView):
+ def get_queryset(self):
+ if self.request.user.is_anonymous:
+ return Intervention.objects.none()
+ qs = Intervention.objects.filter(
+ deleted=None,
+ users__in=[self.request.user],
+ )
+ if self.q:
+ qs = qs.filter(
+ identifier__icontains=self.q
+ )
+ qs = qs.order_by(
+ "identifier"
+ )
return qs
\ No newline at end of file
diff --git a/konova/templates/konova/form.html b/konova/templates/konova/form.html
index 8b339f8d..3efd152f 100644
--- a/konova/templates/konova/form.html
+++ b/konova/templates/konova/form.html
@@ -3,6 +3,6 @@
{% block body %}
- {% include 'table/generic_table_form.html' %}
+ {% include 'form/generic_table_form.html' %}
{% endblock %}
\ No newline at end of file
diff --git a/konova/urls.py b/konova/urls.py
index 9d54f9c5..5d20c151 100644
--- a/konova/urls.py
+++ b/konova/urls.py
@@ -18,7 +18,8 @@ from django.contrib import admin
from django.urls import path, include
from simple_sso.sso_client.client import Client
-from konova.autocompletes import OrganisationAutocomplete, NonOfficialOrganisationAutocomplete
+from konova.autocompletes import OrganisationAutocomplete, NonOfficialOrganisationAutocomplete, EcoAccountAutocomplete, \
+ InterventionAutocomplete
from konova.settings import SSO_SERVER, SSO_PUBLIC_KEY, SSO_PRIVATE_KEY, DEBUG
from konova.views import logout_view, home_view, get_document_view, remove_document_view, remove_deadline_view
@@ -45,6 +46,8 @@ urlpatterns = [
# Autocomplete paths
path("atcmplt/orgs", OrganisationAutocomplete.as_view(), name="orgs-autocomplete"),
path("atcmplt/orgs/other", NonOfficialOrganisationAutocomplete.as_view(), name="other-orgs-autocomplete"),
+ path("atcmplt/eco-accounts", EcoAccountAutocomplete.as_view(), name="accounts-autocomplete"),
+ path("atcmplt/interventions", InterventionAutocomplete.as_view(), name="interventions-autocomplete"),
]
if DEBUG:
diff --git a/locale/de/LC_MESSAGES/django.mo b/locale/de/LC_MESSAGES/django.mo
index da217ac5..0c069176 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 85e87190..5c3ad1c5 100644
--- a/locale/de/LC_MESSAGES/django.po
+++ b/locale/de/LC_MESSAGES/django.po
@@ -7,8 +7,8 @@
#: compensation/forms.py:203 compensation/forms.py:271
#: intervention/filters.py:26 intervention/filters.py:40
#: intervention/filters.py:47 intervention/filters.py:48
-#: intervention/forms.py:318 intervention/forms.py:330
-#: intervention/forms.py:342 konova/forms.py:91 konova/forms.py:227
+#: intervention/forms.py:321 intervention/forms.py:333
+#: intervention/forms.py:345 konova/forms.py:91 konova/forms.py:227
#: konova/forms.py:260 konova/forms.py:265 konova/forms.py:277
#: konova/forms.py:289 konova/forms.py:302 user/forms.py:38
#, fuzzy
@@ -16,7 +16,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2021-08-09 15:06+0200\n"
+"POT-Creation-Date: 2021-08-10 10:30+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME \n"
"Language-Team: LANGUAGE \n"
@@ -27,8 +27,8 @@ msgstr ""
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: compensation/forms.py:41 compensation/forms.py:260
-#: compensation/templates/compensation/detail/eco_account/includes/withdraws.html:33
-#: intervention/templates/intervention/detail/includes/withdraws.html:33
+#: compensation/templates/compensation/detail/eco_account/includes/withdraws.html:31
+#: intervention/templates/intervention/detail/includes/withdraws.html:31
msgid "Amount"
msgstr "Menge"
@@ -78,10 +78,11 @@ msgstr "Biotoptyp wählen"
#: compensation/templates/compensation/detail/compensation/includes/states-before.html:36
#: compensation/templates/compensation/detail/eco_account/includes/states-after.html:36
#: compensation/templates/compensation/detail/eco_account/includes/states-before.html:36
+#: intervention/forms.py:449
msgid "Surface"
msgstr "Fläche"
-#: compensation/forms.py:106
+#: compensation/forms.py:106 intervention/forms.py:451
msgid "in m²"
msgstr ""
@@ -112,7 +113,7 @@ msgstr "Fristart wählen"
#: compensation/forms.py:187
#: compensation/templates/compensation/detail/compensation/includes/deadlines.html:31
#: compensation/templates/compensation/detail/eco_account/includes/deadlines.html:31
-#: intervention/forms.py:317
+#: intervention/forms.py:320
msgid "Date"
msgstr "Datum"
@@ -127,7 +128,7 @@ msgstr "Datum wählen"
#: compensation/templates/compensation/detail/eco_account/includes/actions.html:34
#: compensation/templates/compensation/detail/eco_account/includes/deadlines.html:34
#: compensation/templates/compensation/detail/eco_account/includes/documents.html:31
-#: intervention/forms.py:341
+#: intervention/forms.py:344
#: intervention/templates/intervention/detail/includes/documents.html:31
#: intervention/templates/intervention/detail/includes/revocation.html:35
#: konova/forms.py:288
@@ -135,7 +136,7 @@ msgid "Comment"
msgstr "Kommentar"
#: compensation/forms.py:204 compensation/forms.py:272
-#: intervention/forms.py:343 konova/forms.py:290
+#: intervention/forms.py:346 konova/forms.py:290
msgid "Additional comment, maximum {} letters"
msgstr "Zusätzlicher Kommentar, maximal {} Zeichen"
@@ -183,32 +184,32 @@ msgstr "Geben Sie die Daten der neuen Maßnahme ein"
msgid "Added action"
msgstr "Maßnahme hinzugefügt"
-#: compensation/models.py:59
+#: compensation/models.py:60
msgid "cm"
msgstr ""
-#: compensation/models.py:60
+#: compensation/models.py:61
msgid "m"
msgstr ""
-#: compensation/models.py:61
+#: compensation/models.py:62
msgid "km"
msgstr ""
-#: compensation/models.py:62
+#: compensation/models.py:63
msgid "m²"
msgstr ""
-#: compensation/models.py:63
+#: compensation/models.py:64
msgid "ha"
msgstr ""
-#: compensation/models.py:64
+#: compensation/models.py:65
msgid "Pieces"
msgstr "Stück"
#: compensation/tables.py:26 compensation/tables.py:166
-#: intervention/forms.py:28 intervention/tables.py:23
+#: intervention/forms.py:31 intervention/tables.py:23
#: intervention/templates/intervention/detail/includes/compensations.html:30
msgid "Identifier"
msgstr "Kennung"
@@ -218,7 +219,7 @@ msgstr "Kennung"
#: compensation/templates/compensation/detail/compensation/view.html:24
#: compensation/templates/compensation/detail/eco_account/includes/documents.html:28
#: compensation/templates/compensation/detail/eco_account/view.html:24
-#: intervention/forms.py:35 intervention/tables.py:28
+#: intervention/forms.py:38 intervention/tables.py:28
#: intervention/templates/intervention/detail/includes/compensations.html:33
#: intervention/templates/intervention/detail/includes/documents.html:28
#: intervention/templates/intervention/detail/view.html:24 konova/forms.py:259
@@ -309,6 +310,7 @@ msgstr "Ökokonten"
#: compensation/tables.py:224
#: compensation/templates/compensation/detail/eco_account/view.html:12
+#: intervention/forms.py:433 intervention/forms.py:440
#: konova/templates/konova/home.html:88 templates/navbar.html:34
msgid "Eco-account"
msgstr "Ökokonto"
@@ -350,12 +352,12 @@ msgstr "Menge"
#: compensation/templates/compensation/detail/eco_account/includes/documents.html:34
#: compensation/templates/compensation/detail/eco_account/includes/states-after.html:39
#: compensation/templates/compensation/detail/eco_account/includes/states-before.html:39
-#: compensation/templates/compensation/detail/eco_account/includes/withdraws.html:36
+#: compensation/templates/compensation/detail/eco_account/includes/withdraws.html:37
#: intervention/templates/intervention/detail/includes/compensations.html:36
#: intervention/templates/intervention/detail/includes/documents.html:34
#: intervention/templates/intervention/detail/includes/payments.html:37
#: intervention/templates/intervention/detail/includes/revocation.html:41
-#: intervention/templates/intervention/detail/includes/withdraws.html:36
+#: intervention/templates/intervention/detail/includes/withdraws.html:37
#: templates/log.html:10
msgid "Action"
msgstr "Aktionen"
@@ -408,7 +410,7 @@ msgstr "Neue Frist hinzufügen"
#: compensation/templates/compensation/detail/compensation/includes/deadlines.html:28
#: compensation/templates/compensation/detail/eco_account/includes/deadlines.html:28
-#: intervention/forms.py:40
+#: intervention/forms.py:43
msgid "Type"
msgstr "Typ"
@@ -511,7 +513,7 @@ msgstr "Zuletzt bearbeitet"
#: compensation/templates/compensation/detail/compensation/view.html:72
#: compensation/templates/compensation/detail/eco_account/view.html:58
-#: intervention/forms.py:251
+#: intervention/forms.py:254
#: intervention/templates/intervention/detail/view.html:104
msgid "Shared with"
msgstr "Freigegeben für"
@@ -532,17 +534,23 @@ msgstr "Ökokonto Abbuchungen"
msgid "Add new withdraw"
msgstr "Neue Abbuchung hinzufügen"
-#: compensation/templates/compensation/detail/eco_account/includes/withdraws.html:30
+#: compensation/templates/compensation/detail/eco_account/includes/withdraws.html:28
msgid "Intervention Identifier"
msgstr "Eingriffskennung"
-#: compensation/templates/compensation/detail/eco_account/includes/withdraws.html:51
-#: intervention/templates/intervention/detail/includes/withdraws.html:54
+#: compensation/templates/compensation/detail/eco_account/includes/withdraws.html:34
+#: intervention/templates/intervention/detail/includes/withdraws.html:34
+#: user/models.py:50
+msgid "Created"
+msgstr "Erstellt"
+
+#: compensation/templates/compensation/detail/eco_account/includes/withdraws.html:53
+#: intervention/templates/intervention/detail/includes/withdraws.html:56
msgid "Remove Withdraw"
msgstr "Abbuchung entfernen"
#: compensation/views/compensation_views.py:121
-#: compensation/views/eco_account_views.py:184 intervention/views.py:391
+#: compensation/views/eco_account_views.py:185 intervention/views.py:391
msgid "Log"
msgstr "Log"
@@ -551,22 +559,22 @@ msgid "Compensation removed"
msgstr "Kompensation entfernt"
#: compensation/views/compensation_views.py:161
-#: compensation/views/eco_account_views.py:261 intervention/views.py:96
+#: compensation/views/eco_account_views.py:262 intervention/views.py:96
msgid "Document added"
msgstr "Dokument hinzugefügt"
#: compensation/views/compensation_views.py:180
-#: compensation/views/eco_account_views.py:205
+#: compensation/views/eco_account_views.py:206
msgid "State added"
msgstr "Zustand hinzugefügt"
#: compensation/views/compensation_views.py:199
-#: compensation/views/eco_account_views.py:224
+#: compensation/views/eco_account_views.py:225
msgid "Action added"
msgstr "Maßnahme hinzugefügt"
#: compensation/views/compensation_views.py:218
-#: compensation/views/eco_account_views.py:243
+#: compensation/views/eco_account_views.py:244
msgid "Deadline added"
msgstr "Frist hinzugefügt"
@@ -578,14 +586,18 @@ msgstr "Zustand gelöscht"
msgid "Action removed"
msgstr "Maßnahme entfernt"
-#: compensation/views/eco_account_views.py:134
+#: compensation/views/eco_account_views.py:135
msgid "Eco-account removed"
msgstr "Ökokonto entfernt"
-#: compensation/views/eco_account_views.py:161
+#: compensation/views/eco_account_views.py:162
msgid "Withdraw removed"
msgstr "Abbuchung entfernt"
+#: compensation/views/eco_account_views.py:282 intervention/views.py:413
+msgid "Withdraw added"
+msgstr "Abbuchung hinzugefügt"
+
#: compensation/views/payment_views.py:43
msgid "Payment added"
msgstr "Zahlung hinzugefügt"
@@ -610,125 +622,125 @@ msgstr "Gemarkung"
msgid "Search for district"
msgstr "Nach Gemarkung suchen"
-#: intervention/forms.py:31
+#: intervention/forms.py:34
msgid "Generated automatically if none was given"
msgstr "Wird automatisch erzeugt, falls nicht angegeben"
-#: intervention/forms.py:43
+#: intervention/forms.py:46
msgid "Which intervention type is this"
msgstr "Welcher Eingriffstyp"
-#: intervention/forms.py:46
+#: intervention/forms.py:49
#: intervention/templates/intervention/detail/view.html:32
msgid "Law"
msgstr "Gesetz"
-#: intervention/forms.py:49
+#: intervention/forms.py:52
msgid "Based on which law"
msgstr "Basiert auf welchem Recht"
-#: intervention/forms.py:52
+#: intervention/forms.py:55
#: intervention/templates/intervention/detail/view.html:52
msgid "Intervention handler"
msgstr "Eingriffsverursacher"
-#: intervention/forms.py:55
+#: intervention/forms.py:58
msgid "Who performs the intervention"
msgstr "Wer führt den Eingriff durch"
-#: intervention/forms.py:58
+#: intervention/forms.py:61
msgid "Data provider"
msgstr "Datenbereitsteller"
-#: intervention/forms.py:60
+#: intervention/forms.py:63
msgid "Who provides the data for the intervention"
msgstr "Wer stellt die Daten für den Eingriff zur Verfügung"
-#: intervention/forms.py:65
+#: intervention/forms.py:68
msgid "Organization"
msgstr "Organisation"
-#: intervention/forms.py:71
+#: intervention/forms.py:74
msgid "Data provider details"
msgstr "Datenbereitsteller Details"
-#: intervention/forms.py:74
+#: intervention/forms.py:77
msgid "Further details"
msgstr "Weitere Details"
-#: intervention/forms.py:87
+#: intervention/forms.py:90
msgid "Map"
msgstr "Karte"
-#: intervention/forms.py:89
+#: intervention/forms.py:92
msgid "Where does the intervention take place"
msgstr "Wo findet der Eingriff statt"
-#: intervention/forms.py:97
+#: intervention/forms.py:100
msgid "Files"
msgstr "Dateien"
-#: intervention/forms.py:104
+#: intervention/forms.py:107
msgid "New intervention"
msgstr "Neuer Eingriff"
-#: intervention/forms.py:146
+#: intervention/forms.py:149
msgid "Edit intervention"
msgstr "Eingriff bearbeiten"
-#: intervention/forms.py:240
+#: intervention/forms.py:243
msgid "Share link"
msgstr "Freigabelink"
-#: intervention/forms.py:242
+#: intervention/forms.py:245
msgid "Send this link to users who you want to have writing access on the data"
msgstr "Andere Nutzer erhalten über diesen Link Zugriff auf die Daten"
-#: intervention/forms.py:254
+#: intervention/forms.py:257
msgid "Remove check to remove access for this user"
msgstr "Wählen Sie die Nutzer ab, die keinen Zugriff mehr haben sollen"
-#: intervention/forms.py:265
+#: intervention/forms.py:268
#: intervention/templates/intervention/detail/includes/controls.html:15
msgid "Share"
msgstr "Freigabe"
-#: intervention/forms.py:266
+#: intervention/forms.py:269
msgid "Share settings for {}"
msgstr "Freigabe Einstellungen für {}"
-#: intervention/forms.py:319
+#: intervention/forms.py:322
msgid "Date of revocation"
msgstr "Datum des Widerspruchs"
-#: intervention/forms.py:329
+#: intervention/forms.py:332
#: intervention/templates/intervention/detail/includes/revocation.html:38
msgid "Document"
msgstr "Dokument"
-#: intervention/forms.py:331 konova/forms.py:278
+#: intervention/forms.py:334 konova/forms.py:278
msgid "Must be smaller than 15 Mb"
msgstr "Muss kleiner als 15 Mb sein"
-#: intervention/forms.py:354
+#: intervention/forms.py:357
#: intervention/templates/intervention/detail/includes/revocation.html:18
msgid "Add revocation"
msgstr "Widerspruch hinzufügen"
-#: intervention/forms.py:390
+#: intervention/forms.py:393
msgid "Checked intervention data"
msgstr "Eingriffsdaten geprüft"
-#: intervention/forms.py:396
+#: intervention/forms.py:399
msgid "Checked compensations data and payments"
msgstr "Kompensationen und Zahlungen geprüft"
-#: intervention/forms.py:404
+#: intervention/forms.py:407
#: intervention/templates/intervention/detail/includes/controls.html:19
msgid "Run check"
msgstr "Prüfung vornehmen"
-#: intervention/forms.py:405
+#: intervention/forms.py:408
msgid ""
"I, {} {}, confirm that all necessary control steps have been performed by "
"myself."
@@ -736,6 +748,37 @@ msgstr ""
"Ich, {} {}, bestätige, dass die notwendigen Kontrollschritte durchgeführt "
"wurden:"
+#: intervention/forms.py:435
+msgid "Only recorded accounts can be selected for withdraws"
+msgstr ""
+"Nur verzeichnete Ökokonten können für Abbuchungen verwendet werden."
+
+#: intervention/forms.py:454 intervention/forms.py:461
+#: intervention/tables.py:92 intervention/tables.py:172
+#: intervention/templates/intervention/detail/view.html:12
+#: konova/templates/konova/home.html:11 templates/navbar.html:22
+msgid "Intervention"
+msgstr "Eingriff"
+
+#: intervention/forms.py:456
+msgid "Only shared interventions can be selected"
+msgstr "Nur freigegebene Eingriffe können gewählt werden"
+
+#: intervention/forms.py:469
+msgid "New Withdraw"
+msgstr "Neue Abbuchung"
+
+#: intervention/forms.py:470
+msgid "Enter the information for a new withdraw from a chosen eco-account"
+msgstr "Geben Sie die Informationen für eine neue Abbuchung ein."
+
+#: intervention/forms.py:511
+msgid ""
+"The account {} has not enough surface for a withdraw of {} m². There are "
+"only {} m² left"
+msgstr ""
+"Das Ökokonto {} hat für eine Abbuchung von {} m² nicht ausreichend Restfläche. Es stehen noch {} m² zur Verfügung."
+
#: intervention/models.py:203
#: intervention/templates/intervention/detail/view.html:23
#: intervention/templates/intervention/detail/view.html:27
@@ -756,12 +799,6 @@ msgstr "Existiert"
msgid "Interventions"
msgstr "Eingriffe"
-#: intervention/tables.py:92 intervention/tables.py:172
-#: intervention/templates/intervention/detail/view.html:12
-#: konova/templates/konova/home.html:11 templates/navbar.html:22
-msgid "Intervention"
-msgstr "Eingriff"
-
#: intervention/tables.py:179
msgid "Edit {}"
msgstr "Bearbeite {}"
@@ -817,11 +854,11 @@ msgstr "Vom"
msgid "Remove revocation"
msgstr "Widerspruch entfernen"
-#: intervention/templates/intervention/detail/includes/withdraws.html:30
+#: intervention/templates/intervention/detail/includes/withdraws.html:28
msgid "Account Identifier"
msgstr "Ökokonto Kennung"
-#: intervention/templates/intervention/detail/includes/withdraws.html:42
+#: intervention/templates/intervention/detail/includes/withdraws.html:43
msgid "Eco-account deleted! Withdraw invalid!"
msgstr "Ökokonto gelöscht! Abbuchung ungültig!"
@@ -1101,6 +1138,18 @@ msgstr ""
msgid "Contact"
msgstr "Kontakt"
+#: templates/form/generic_table_form.html:23
+msgid "Cancel"
+msgstr "Abbrechen"
+
+#: templates/form/generic_table_form.html:27
+msgid "Save"
+msgstr "Speichern"
+
+#: templates/form/generic_table_form_body.html:21
+msgid "Fields with * are required."
+msgstr "* sind Pflichtfelder."
+
#: templates/generic_index.html:19
msgid "New entry"
msgstr "Neuer Eintrag"
@@ -1185,18 +1234,6 @@ msgstr "Einstellungen"
msgid "Logout"
msgstr "Abmelden"
-#: templates/table/generic_table_form.html:23
-msgid "Cancel"
-msgstr "Abbrechen"
-
-#: templates/table/generic_table_form.html:27
-msgid "Save"
-msgstr "Speichern"
-
-#: templates/table/generic_table_form_body.html:21
-msgid "Fields with * are required."
-msgstr "* sind Pflichtfelder."
-
#: user/forms.py:23
msgid "Notifications"
msgstr "Benachrichtigungen"
@@ -1225,10 +1262,6 @@ msgstr ""
msgid "User contact data"
msgstr "Kontaktdaten"
-#: user/models.py:50
-msgid "Created"
-msgstr "Erstellt"
-
#: user/models.py:51
msgid "Edited"
msgstr "Bearbeitet"
@@ -2599,10 +2632,6 @@ msgstr ""
#~ msgid "Registration document identifier"
#~ msgstr "Aktenzeichen Eintragungsstelle"
-#~ msgid "Enter these basic information for the new process."
-#~ msgstr ""
-#~ "Geben Sie die grundlegenden Informationen für einen neuen Vorgang ein."
-
#~ msgid "Edit process"
#~ msgstr "Vorgang bearbeiten"
diff --git a/requirements.txt b/requirements.txt
index c0e6822e..8fb68dad 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -3,7 +3,7 @@ beautifulsoup4==4.9.3
certifi==2020.11.8
chardet==3.0.4
Django==3.1.3
-django-autocomplete-light==3.8.1
+django-autocomplete-light==3.8.2
django-bootstrap-modal-forms==2.2.0
django-bootstrap4==3.0.1
django-debug-toolbar==3.1.1
diff --git a/templates/base.html b/templates/base.html
index 65487e21..e8b4cb25 100644
--- a/templates/base.html
+++ b/templates/base.html
@@ -9,11 +9,10 @@
{% fontawesome_5_static %}
{% comment %}
- Adds script for modal rendering
+ Adds script for modal rendering. Script depends on Jquery, therefore it needs to be loaded afterwards.
{% endcomment %}
{% block head %}
-
{% endblock %}
diff --git a/templates/footer.html b/templates/footer.html
index eb83bc7d..227f5ac6 100644
--- a/templates/footer.html
+++ b/templates/footer.html
@@ -14,4 +14,15 @@
+ {% comment %}
+ "Why is there a form.media call???"
+ We use modal forms, right?
+ And we use dal (django-autocomplete-light), right?
+ In order to get these nice autocomplete (js triggered) form fields to work, we need to load form.media
+ somewhere. BUT when these fields are called inside a modal form (which we use quiet often), the form.media
+ can not be called properly due to some deprecated functions of jquery regarding synchronous calling.
+ So, we simply call the form.media in here, in case there is any form.media to be loaded.
+ {% endcomment %}
+ {{ form.media }}
+
\ No newline at end of file
diff --git a/templates/table/generic_table_form.html b/templates/form/generic_table_form.html
similarity index 94%
rename from templates/table/generic_table_form.html
rename to templates/form/generic_table_form.html
index 27fa3af6..d5cbef4a 100644
--- a/templates/table/generic_table_form.html
+++ b/templates/form/generic_table_form.html
@@ -16,7 +16,7 @@
{% endif %}
|