+ {% endif %}
+{% endfor %}
\ No newline at end of file
diff --git a/konova/templates/konova/includes/parcel_table.html b/konova/templates/konova/includes/parcels/parcel_table_frame.html
similarity index 76%
rename from konova/templates/konova/includes/parcel_table.html
rename to konova/templates/konova/includes/parcels/parcel_table_frame.html
index 76503572..e3292004 100644
--- a/konova/templates/konova/includes/parcel_table.html
+++ b/konova/templates/konova/includes/parcels/parcel_table_frame.html
@@ -37,16 +37,7 @@
- {% for parcel in parcels %}
-
\ No newline at end of file
diff --git a/konova/urls.py b/konova/urls.py
index d2458f50..00386a11 100644
--- a/konova/urls.py
+++ b/konova/urls.py
@@ -24,7 +24,7 @@ from konova.autocompletes import EcoAccountAutocomplete, \
ShareTeamAutocomplete, HandlerCodeAutocomplete
from konova.settings import SSO_SERVER, SSO_PUBLIC_KEY, SSO_PRIVATE_KEY, DEBUG
from konova.sso.sso import KonovaSSOClient
-from konova.views import logout_view, home_view, get_geom_parcels
+from konova.views import logout_view, home_view, get_geom_parcels, get_geom_parcels_content
sso_client = KonovaSSOClient(SSO_SERVER, SSO_PUBLIC_KEY, SSO_PRIVATE_KEY)
urlpatterns = [
@@ -40,7 +40,8 @@ urlpatterns = [
path('cl/', include("codelist.urls")),
path('analysis/', include("analysis.urls")),
path('api/', include("api.urls")),
- path('geom//parcels', get_geom_parcels, name="geometry-parcels"),
+ path('geom//parcels/', get_geom_parcels, name="geometry-parcels"),
+ path('geom//parcels/', get_geom_parcels_content, name="geometry-parcels-content"),
# Autocomplete paths for all apps
path("atcmplt/eco-accounts", EcoAccountAutocomplete.as_view(), name="accounts-autocomplete"),
diff --git a/konova/utils/message_templates.py b/konova/utils/message_templates.py
index 64b7eab1..e062005a 100644
--- a/konova/utils/message_templates.py
+++ b/konova/utils/message_templates.py
@@ -17,6 +17,7 @@ IDENTIFIER_REPLACED = _("The identifier '{}' had to be changed to '{}' since ano
ENTRY_REMOVE_MISSING_PERMISSION = _("Only conservation or registration office users are allowed to remove entries.")
MISSING_GROUP_PERMISSION = _("You need to be part of another user group.")
CHECKED_RECORDED_RESET = _("Status of Checked and Recorded reseted")
+RECORDED_BLOCKS_EDIT = _("Entry is recorded. To edit data, the entry first needs to be unrecorded.")
# SHARE
DATA_UNSHARED = _("This data is not shared with you")
diff --git a/konova/utils/wfs/spatial.py b/konova/utils/wfs/spatial.py
index 8a7bf360..2f1452d6 100644
--- a/konova/utils/wfs/spatial.py
+++ b/konova/utils/wfs/spatial.py
@@ -5,11 +5,12 @@ Contact: michel.peltriaux@sgdnord.rlp.de
Created on: 17.12.21
"""
+import json
from abc import abstractmethod
+from json import JSONDecodeError
from time import sleep
import requests
-import xmltodict
from django.contrib.gis.db.models.functions import AsGML, Transform
from requests.auth import HTTPDigestAuth
@@ -115,7 +116,7 @@ class ParcelWFSFetcher(AbstractWFSFetcher):
geometry_operation,
filter_srid
)
- _filter = f'{spatial_filter}'
+ _filter = f'{spatial_filter}'
return _filter
def get_features(self,
@@ -139,7 +140,7 @@ class ParcelWFSFetcher(AbstractWFSFetcher):
Returns:
features (list): A list of returned features
"""
- features = []
+ found_features = []
while start_index is not None:
post_body = self._create_post_data(
spatial_operator,
@@ -155,19 +156,11 @@ class ParcelWFSFetcher(AbstractWFSFetcher):
)
content = response.content.decode("utf-8")
- content = xmltodict.parse(content)
- collection = content.get(
- "wfs:FeatureCollection",
- {},
- )
-
- # Check if collection is an exception and does not contain the requested data
- if len(collection) == 0:
- exception = content.get(
- "ows:ExceptionReport",
- {}
- )
- if len(exception) > 0 and rerun_on_exception:
+ try:
+ # Check if collection is an exception and does not contain the requested data
+ content = json.loads(content)
+ except JSONDecodeError as e:
+ if rerun_on_exception:
# Wait a second before another try
sleep(1)
self.get_features(
@@ -177,22 +170,21 @@ class ParcelWFSFetcher(AbstractWFSFetcher):
start_index,
rerun_on_exception=False
)
-
- members = collection.get(
- "wfs:member",
- None,
- )
- if members is not None:
- if len(members) > 1:
- # extend feature list with found list of new feature members
- features += members
else:
- # convert single found feature member into list and extent feature list
- features += [members]
+ e.msg += content
+ raise e
+ fetched_features = content.get(
+ "features",
+ {},
+ )
- if collection.get("@next", None) is not None:
- start_index += self.count
- else:
+ found_features += fetched_features
+
+ if len(fetched_features) < self.count:
+ # The response was not 'full', so we got everything to fetch
start_index = None
+ else:
+ # If a 'full' response returned, there might be more to fetch. Increase the start_index!
+ start_index += self.count
- return features
+ return found_features
diff --git a/konova/views.py b/konova/views.py
index 2fd5ff91..97cb7d82 100644
--- a/konova/views.py
+++ b/konova/views.py
@@ -110,12 +110,12 @@ def get_geom_parcels(request: HttpRequest, id: str):
id (str): The geometry's id
Returns:
-
+ A rendered piece of HTML
"""
# HTTP code 286 states that the HTMX should stop polling for updates
# https://htmx.org/docs/#polling
status_code = 286
- template = "konova/includes/parcel_table.html"
+ template = "konova/includes/parcels/parcel_table_frame.html"
geom = get_object_or_404(Geometry, id=id)
parcels = geom.get_underlying_parcels()
geos_geom = geom.geom
@@ -133,9 +133,18 @@ def get_geom_parcels(request: HttpRequest, id: str):
parcels = parcels.order_by("-municipal", "flr", "flrstck_zhlr", "flrstck_nnr")
municipals = parcels.order_by("municipal").distinct("municipal").values("municipal__id")
municipals = Municipal.objects.filter(id__in=municipals)
+
+ rpp = 100
+ parcels = parcels[:rpp]
+ next_page = 1
+ if len(parcels) < rpp:
+ next_page = None
+
context = {
"parcels": parcels,
"municipals": municipals,
+ "geom_id": str(id),
+ "next_page": next_page,
}
html = render_to_string(template, context, request)
return HttpResponse(html, status=status_code)
@@ -143,6 +152,49 @@ def get_geom_parcels(request: HttpRequest, id: str):
return HttpResponse(None, status=404)
+@login_required
+def get_geom_parcels_content(request: HttpRequest, id: str, page: int):
+ """ Getter for infinite scroll of HTMX
+
+ Returns parcels of a specific page/slice of the found parcel set.
+ Implementation of infinite scroll htmx example: https://htmx.org/examples/infinite-scroll/
+
+ Args:
+ request (HttpRequest): The incoming request
+ id (str): The geometry's id
+ page (int): The requested page number
+
+ Returns:
+ A rendered piece of HTML
+ """
+ if page < 0:
+ raise AssertionError("Parcel page can not be negative")
+
+ # HTTP code 286 states that the HTMX should stop polling for updates
+ # https://htmx.org/docs/#polling
+ status_code = 286
+ template = "konova/includes/parcels/parcel_table_content.html"
+ geom = get_object_or_404(Geometry, id=id)
+ parcels = geom.get_underlying_parcels()
+
+ parcels = parcels.order_by("-municipal", "flr", "flrstck_zhlr", "flrstck_nnr")
+ rpp = 100
+ from_p = rpp * (page-1)
+ to_p = rpp * (page)
+ next_page = page + 1
+ parcels = parcels[from_p:to_p]
+ if len(parcels) < rpp:
+ next_page = None
+
+ context = {
+ "parcels": parcels,
+ "geom_id": str(id),
+ "next_page": next_page,
+ }
+ html = render_to_string(template, context, request)
+ return HttpResponse(html, status=status_code)
+
+
def get_404_view(request: HttpRequest, exception=None):
""" Returns a 404 handling view
diff --git a/locale/de/LC_MESSAGES/django.mo b/locale/de/LC_MESSAGES/django.mo
index 6459128e..45575064 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 1cb4871a..35ee2c5c 100644
--- a/locale/de/LC_MESSAGES/django.po
+++ b/locale/de/LC_MESSAGES/django.po
@@ -18,15 +18,15 @@
#: konova/filters/mixins.py:277 konova/filters/mixins.py:323
#: konova/filters/mixins.py:361 konova/filters/mixins.py:362
#: konova/filters/mixins.py:393 konova/filters/mixins.py:394
-#: konova/forms.py:143 konova/forms.py:244 konova/forms.py:315
-#: konova/forms.py:359 konova/forms.py:369 konova/forms.py:382
-#: konova/forms.py:394 konova/forms.py:412 user/forms.py:42
+#: konova/forms.py:177 konova/forms.py:278 konova/forms.py:349
+#: konova/forms.py:393 konova/forms.py:403 konova/forms.py:416
+#: konova/forms.py:428 konova/forms.py:446 user/forms.py:42
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2022-04-12 10:28+0200\n"
+"POT-Creation-Date: 2022-04-21 14:16+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME \n"
"Language-Team: LANGUAGE \n"
@@ -77,7 +77,7 @@ msgstr "Bericht generieren"
msgid "Select a timespan and the desired conservation office"
msgstr "Wählen Sie die Zeitspanne und die gewünschte Eintragungsstelle"
-#: analysis/forms.py:69 konova/forms.py:191
+#: analysis/forms.py:69 konova/forms.py:225
msgid "Continue"
msgstr "Weiter"
@@ -154,7 +154,7 @@ msgstr "Geprüft"
#: analysis/templates/analysis/reports/includes/intervention/compensated_by.html:9
#: analysis/templates/analysis/reports/includes/intervention/laws.html:20
#: analysis/templates/analysis/reports/includes/old_data/amount.html:18
-#: compensation/tables.py:46 compensation/tables.py:222
+#: compensation/tables.py:46 compensation/tables.py:220
#: compensation/templates/compensation/detail/compensation/view.html:78
#: compensation/templates/compensation/detail/eco_account/includes/deductions.html:31
#: compensation/templates/compensation/detail/eco_account/view.html:45
@@ -294,7 +294,7 @@ msgid "Intervention"
msgstr "Eingriff"
#: analysis/templates/analysis/reports/includes/old_data/amount.html:34
-#: compensation/tables.py:266
+#: compensation/tables.py:264
#: compensation/templates/compensation/detail/eco_account/view.html:20
#: intervention/forms/modalForms.py:348 intervention/forms/modalForms.py:355
#: konova/templates/konova/includes/quickstart/ecoaccounts.html:4
@@ -315,7 +315,7 @@ msgid "Show only unrecorded"
msgstr "Nur unverzeichnete anzeigen"
#: compensation/forms/forms.py:32 compensation/tables.py:25
-#: compensation/tables.py:197 ema/tables.py:29 intervention/forms/forms.py:28
+#: compensation/tables.py:195 ema/tables.py:29 intervention/forms/forms.py:28
#: intervention/tables.py:24
#: intervention/templates/intervention/detail/includes/compensations.html:30
msgid "Identifier"
@@ -327,7 +327,7 @@ msgid "Generated automatically"
msgstr "Automatisch generiert"
#: compensation/forms/forms.py:44 compensation/tables.py:30
-#: compensation/tables.py:202
+#: compensation/tables.py:200
#: compensation/templates/compensation/detail/compensation/includes/documents.html:28
#: compensation/templates/compensation/detail/compensation/view.html:32
#: compensation/templates/compensation/detail/eco_account/includes/documents.html:28
@@ -342,7 +342,7 @@ msgstr "Automatisch generiert"
#: intervention/templates/intervention/detail/includes/documents.html:28
#: intervention/templates/intervention/detail/view.html:31
#: intervention/templates/intervention/report/report.html:12
-#: konova/forms.py:358
+#: konova/forms.py:392
msgid "Title"
msgstr "Bezeichnung"
@@ -369,7 +369,7 @@ msgstr "Kompensation XY; Flur ABC"
#: intervention/templates/intervention/detail/includes/documents.html:34
#: intervention/templates/intervention/detail/includes/payments.html:34
#: intervention/templates/intervention/detail/includes/revocation.html:38
-#: konova/forms.py:393 konova/templates/konova/includes/comment_card.html:16
+#: konova/forms.py:427 konova/templates/konova/includes/comment_card.html:16
msgid "Comment"
msgstr "Kommentar"
@@ -441,7 +441,7 @@ msgstr "kompensiert Eingriff"
msgid "Select the intervention for which this compensation compensates"
msgstr "Wählen Sie den Eingriff, für den diese Kompensation bestimmt ist"
-#: compensation/forms/forms.py:202 compensation/views/compensation.py:96
+#: compensation/forms/forms.py:202 compensation/views/compensation.py:110
msgid "New compensation"
msgstr "Neue Kompensation"
@@ -467,7 +467,7 @@ msgstr "Vereinbarungsdatum"
msgid "When did the parties agree on this?"
msgstr "Wann wurde dieses Ökokonto offiziell vereinbart?"
-#: compensation/forms/forms.py:373 compensation/views/eco_account.py:107
+#: compensation/forms/forms.py:373 compensation/views/eco_account.py:108
msgid "New Eco-Account"
msgstr "Neues Ökokonto"
@@ -493,7 +493,7 @@ msgid "Due on which date"
msgstr "Zahlung wird an diesem Datum erwartet"
#: compensation/forms/modalForms.py:64 compensation/forms/modalForms.py:359
-#: intervention/forms/modalForms.py:177 konova/forms.py:395
+#: intervention/forms/modalForms.py:177 konova/forms.py:429
msgid "Additional comment, maximum {} letters"
msgstr "Zusätzlicher Kommentar, maximal {} Zeichen"
@@ -538,7 +538,7 @@ msgstr "Neuer Zustand"
msgid "Insert data for the new state"
msgstr "Geben Sie die Daten des neuen Zustandes ein"
-#: compensation/forms/modalForms.py:217 konova/forms.py:193
+#: compensation/forms/modalForms.py:217 konova/forms.py:227
msgid "Object removed"
msgstr "Objekt entfernt"
@@ -675,22 +675,22 @@ msgstr ""
"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:35 compensation/tables.py:207 ema/tables.py:39
+#: compensation/tables.py:35 compensation/tables.py:205 ema/tables.py:39
#: intervention/tables.py:34 konova/filters/mixins.py:98
msgid "Parcel gmrkng"
msgstr "Gemarkung"
-#: compensation/tables.py:52 compensation/tables.py:228 ema/tables.py:50
+#: compensation/tables.py:52 compensation/tables.py:226 ema/tables.py:50
#: intervention/tables.py:51
msgid "Editable"
msgstr "Freigegeben"
-#: compensation/tables.py:58 compensation/tables.py:234 ema/tables.py:56
+#: compensation/tables.py:58 compensation/tables.py:232 ema/tables.py:56
#: intervention/tables.py:57
msgid "Last edit"
msgstr "Zuletzt bearbeitet"
-#: compensation/tables.py:89 compensation/tables.py:266 ema/tables.py:89
+#: compensation/tables.py:89 compensation/tables.py:264 ema/tables.py:89
#: intervention/tables.py:88
msgid "Open {}"
msgstr "Öffne {}"
@@ -713,32 +713,32 @@ msgstr "Am {} von {} geprüft worden"
msgid "Not recorded yet"
msgstr "Noch nicht verzeichnet"
-#: compensation/tables.py:165 compensation/tables.py:326 ema/tables.py:136
+#: compensation/tables.py:165 compensation/tables.py:324 ema/tables.py:136
#: intervention/tables.py:162
msgid "Recorded on {} by {}"
msgstr "Am {} von {} verzeichnet worden"
-#: compensation/tables.py:189 compensation/tables.py:348 ema/tables.py:159
-#: intervention/tables.py:185
+#: compensation/tables.py:187 compensation/tables.py:346 ema/tables.py:157
+#: intervention/tables.py:183
msgid "Full access granted"
msgstr "Für Sie freigegeben - Datensatz kann bearbeitet werden"
-#: compensation/tables.py:189 compensation/tables.py:348 ema/tables.py:159
-#: intervention/tables.py:185
+#: compensation/tables.py:187 compensation/tables.py:346 ema/tables.py:157
+#: intervention/tables.py:183
msgid "Access not granted"
msgstr "Nicht freigegeben - Datensatz nur lesbar"
-#: compensation/tables.py:212
+#: compensation/tables.py:210
#: compensation/templates/compensation/detail/eco_account/view.html:36
#: konova/templates/konova/widgets/progressbar.html:3
msgid "Available"
msgstr "Verfügbar"
-#: compensation/tables.py:243
+#: compensation/tables.py:241
msgid "Eco Accounts"
msgstr "Ökokonten"
-#: compensation/tables.py:321
+#: compensation/tables.py:319
msgid "Not recorded yet. Can not be used for deductions, yet."
msgstr ""
"Noch nicht verzeichnet. Kann noch nicht für Abbuchungen genutzt werden."
@@ -871,7 +871,7 @@ msgstr "Dokumente"
#: compensation/templates/compensation/detail/eco_account/includes/documents.html:14
#: ema/templates/ema/detail/includes/documents.html:14
#: intervention/templates/intervention/detail/includes/documents.html:14
-#: konova/forms.py:411
+#: konova/forms.py:445
msgid "Add new document"
msgstr "Neues Dokument hinzufügen"
@@ -879,7 +879,7 @@ msgstr "Neues Dokument hinzufügen"
#: compensation/templates/compensation/detail/eco_account/includes/documents.html:31
#: ema/templates/ema/detail/includes/documents.html:31
#: intervention/templates/intervention/detail/includes/documents.html:31
-#: konova/forms.py:368
+#: konova/forms.py:402
msgid "Created on"
msgstr "Erstellt"
@@ -887,7 +887,7 @@ msgstr "Erstellt"
#: compensation/templates/compensation/detail/eco_account/includes/documents.html:61
#: ema/templates/ema/detail/includes/documents.html:61
#: intervention/templates/intervention/detail/includes/documents.html:65
-#: konova/forms.py:474
+#: konova/forms.py:507
msgid "Edit document"
msgstr "Dokument bearbeiten"
@@ -1067,7 +1067,7 @@ msgid "Recorded on"
msgstr "Verzeichnet am"
#: compensation/templates/compensation/detail/eco_account/includes/deductions.html:65
-#: intervention/forms/modalForms.py:481
+#: intervention/forms/modalForms.py:490
#: intervention/templates/intervention/detail/includes/deductions.html:60
msgid "Edit Deduction"
msgstr "Abbuchung bearbeiten"
@@ -1112,20 +1112,6 @@ msgstr "Maßnahmenträger"
msgid "Report"
msgstr "Bericht"
-#: compensation/templates/compensation/report/compensation/report.html:45
-#: compensation/templates/compensation/report/eco_account/report.html:58
-#: ema/templates/ema/report/report.html:45
-#: intervention/templates/intervention/report/report.html:104
-msgid "Open in browser"
-msgstr "Im Browser öffnen"
-
-#: compensation/templates/compensation/report/compensation/report.html:49
-#: compensation/templates/compensation/report/eco_account/report.html:62
-#: ema/templates/ema/report/report.html:49
-#: intervention/templates/intervention/report/report.html:108
-msgid "View in LANIS"
-msgstr "In LANIS öffnen"
-
#: compensation/templates/compensation/report/eco_account/report.html:24
msgid "Deductions for"
msgstr "Abbuchungen für"
@@ -1155,72 +1141,72 @@ msgstr ""
msgid "Responsible data"
msgstr "Daten zu den verantwortlichen Stellen"
-#: compensation/views/compensation.py:52
+#: compensation/views/compensation.py:53
msgid "Compensations - Overview"
msgstr "Kompensationen - Übersicht"
-#: compensation/views/compensation.py:151 konova/utils/message_templates.py:35
+#: compensation/views/compensation.py:172 konova/utils/message_templates.py:36
msgid "Compensation {} edited"
msgstr "Kompensation {} bearbeitet"
-#: compensation/views/compensation.py:161 compensation/views/eco_account.py:165
-#: ema/views.py:233 intervention/views.py:327
+#: compensation/views/compensation.py:182 compensation/views/eco_account.py:173
+#: ema/views.py:240 intervention/views.py:335
msgid "Edit {}"
msgstr "Bearbeite {}"
-#: compensation/views/compensation.py:240 compensation/views/eco_account.py:351
-#: ema/views.py:194 intervention/views.py:531
+#: compensation/views/compensation.py:261 compensation/views/eco_account.py:359
+#: ema/views.py:194 intervention/views.py:539
msgid "Log"
msgstr "Log"
-#: compensation/views/compensation.py:584 compensation/views/eco_account.py:719
-#: ema/views.py:551 intervention/views.py:677
+#: compensation/views/compensation.py:605 compensation/views/eco_account.py:727
+#: ema/views.py:558 intervention/views.py:685
msgid "Report {}"
msgstr "Bericht {}"
-#: compensation/views/eco_account.py:64
+#: compensation/views/eco_account.py:65
msgid "Eco-account - Overview"
msgstr "Ökokonten - Übersicht"
-#: compensation/views/eco_account.py:97
+#: compensation/views/eco_account.py:98
msgid "Eco-Account {} added"
msgstr "Ökokonto {} hinzugefügt"
-#: compensation/views/eco_account.py:155
+#: compensation/views/eco_account.py:163
msgid "Eco-Account {} edited"
msgstr "Ökokonto {} bearbeitet"
-#: compensation/views/eco_account.py:268
+#: compensation/views/eco_account.py:276
msgid "Eco-account removed"
msgstr "Ökokonto entfernt"
-#: compensation/views/eco_account.py:372 ema/views.py:275
-#: intervention/views.py:630
+#: compensation/views/eco_account.py:380 ema/views.py:282
+#: intervention/views.py:638
msgid "{} unrecorded"
msgstr "{} entzeichnet"
-#: compensation/views/eco_account.py:372 ema/views.py:275
-#: intervention/views.py:630
+#: compensation/views/eco_account.py:380 ema/views.py:282
+#: intervention/views.py:638
msgid "{} recorded"
msgstr "{} verzeichnet"
-#: compensation/views/eco_account.py:792 ema/views.py:617
-#: intervention/views.py:428
+#: compensation/views/eco_account.py:804 ema/views.py:628
+#: intervention/views.py:436
msgid "{} has already been shared with you"
msgstr "{} wurde bereits für Sie freigegeben"
-#: compensation/views/eco_account.py:797 ema/views.py:622
-#: intervention/views.py:433
+#: compensation/views/eco_account.py:809 ema/views.py:633
+#: intervention/views.py:441
msgid "{} has been shared with you"
msgstr "{} ist nun für Sie freigegeben"
-#: compensation/views/eco_account.py:804 ema/views.py:629
-#: intervention/views.py:440
+#: compensation/views/eco_account.py:816 ema/views.py:640
+#: intervention/views.py:448
msgid "Share link invalid"
msgstr "Freigabelink ungültig"
-#: compensation/views/eco_account.py:827 ema/views.py:652
-#: intervention/views.py:463
+#: compensation/views/eco_account.py:839 ema/views.py:663
+#: intervention/views.py:471
msgid "Share settings updated"
msgstr "Freigabe Einstellungen aktualisiert"
@@ -1260,11 +1246,11 @@ msgstr "EMAs - Übersicht"
msgid "EMA {} added"
msgstr "EMA {} hinzugefügt"
-#: ema/views.py:223
+#: ema/views.py:230
msgid "EMA {} edited"
msgstr "EMA {} bearbeitet"
-#: ema/views.py:256
+#: ema/views.py:263
msgid "EMA removed"
msgstr "EMA entfernt"
@@ -1326,7 +1312,7 @@ msgstr "Datum Zulassung bzw. Satzungsbeschluss"
msgid "Binding on"
msgstr "Datum Bestandskraft"
-#: intervention/forms/forms.py:211 intervention/views.py:94
+#: intervention/forms/forms.py:211 intervention/views.py:95
msgid "New intervention"
msgstr "Neuer Eingriff"
@@ -1406,7 +1392,7 @@ msgstr "Kompensationen und Zahlungen geprüft"
msgid "Run check"
msgstr "Prüfung vornehmen"
-#: intervention/forms/modalForms.py:264 konova/forms.py:515
+#: intervention/forms/modalForms.py:264 konova/forms.py:548
msgid ""
"I, {} {}, confirm that all necessary control steps have been performed by "
"myself."
@@ -1430,7 +1416,7 @@ msgstr "Neue Abbuchung"
msgid "Enter the information for a new deduction from a chosen eco-account"
msgstr "Geben Sie die Informationen für eine neue Abbuchung ein."
-#: intervention/forms/modalForms.py:434
+#: intervention/forms/modalForms.py:436
msgid ""
"Eco-account {} is not recorded yet. You can only deduct from recorded "
"accounts."
@@ -1438,7 +1424,15 @@ msgstr ""
"Ökokonto {} ist noch nicht verzeichnet. Abbuchungen können nur von "
"verzeichneten Ökokonten erfolgen."
-#: intervention/forms/modalForms.py:444
+#: intervention/forms/modalForms.py:443
+msgid ""
+"Intervention {} is currently recorded. To change any data on it, the entry "
+"must be unrecorded."
+msgstr ""
+"Eingriff {} ist verzeichnet. Der Eintrag muss erst entzeichnet werden um "
+"fortfahren zu können."
+
+#: intervention/forms/modalForms.py:453
msgid ""
"The account {} has not enough surface for a deduction of {} m². There are "
"only {} m² left"
@@ -1538,27 +1532,27 @@ msgstr ""
"Kein Ausgleich jeglicher Art gefunden (Kompensation, Ersatzzahlung, "
"Abbuchung)"
-#: intervention/views.py:51
+#: intervention/views.py:52
msgid "Interventions - Overview"
msgstr "Eingriffe - Übersicht"
-#: intervention/views.py:84
+#: intervention/views.py:85
msgid "Intervention {} added"
msgstr "Eingriff {} hinzugefügt"
-#: intervention/views.py:315
+#: intervention/views.py:323
msgid "Intervention {} edited"
msgstr "Eingriff {} bearbeitet"
-#: intervention/views.py:351
+#: intervention/views.py:359
msgid "{} removed"
msgstr "{} entfernt"
-#: intervention/views.py:484
+#: intervention/views.py:492
msgid "Check performed"
msgstr "Prüfung durchgeführt"
-#: intervention/views.py:635
+#: intervention/views.py:643
msgid "There are errors on this intervention:"
msgstr "Es liegen Fehler in diesem Eingriff vor:"
@@ -1588,7 +1582,7 @@ msgid "Search for file number"
msgstr "Nach Aktenzeichen suchen"
#: konova/filters/mixins.py:85
-#: konova/templates/konova/includes/parcel_table.html:13
+#: konova/templates/konova/includes/parcels/parcel_table_frame.html:13
msgid "District"
msgstr "Kreis"
@@ -1601,7 +1595,7 @@ msgid "Search for parcel gmrkng"
msgstr "Nach Gemarkung suchen"
#: konova/filters/mixins.py:111
-#: konova/templates/konova/includes/parcel_table.html:34
+#: konova/templates/konova/includes/parcels/parcel_table_frame.html:34
msgid "Parcel"
msgstr "Flur"
@@ -1610,7 +1604,7 @@ msgid "Search for parcel"
msgstr "Nach Flur suchen"
#: konova/filters/mixins.py:124
-#: konova/templates/konova/includes/parcel_table.html:35
+#: konova/templates/konova/includes/parcels/parcel_table_frame.html:35
msgid "Parcel counter"
msgstr "Flurstückzähler"
@@ -1619,7 +1613,7 @@ msgid "Search for parcel counter"
msgstr "Nach Flurstückzähler suchen"
#: konova/filters/mixins.py:138
-#: konova/templates/konova/includes/parcel_table.html:36
+#: konova/templates/konova/includes/parcels/parcel_table_frame.html:36
msgid "Parcel number"
msgstr "Flurstücknenner"
@@ -1647,65 +1641,65 @@ msgstr "Nch Eintragungsstelle suchen"
msgid "Save"
msgstr "Speichern"
-#: konova/forms.py:71
+#: konova/forms.py:73
msgid "Not editable"
msgstr "Nicht editierbar"
-#: konova/forms.py:142 konova/forms.py:314
+#: konova/forms.py:176 konova/forms.py:348
msgid "Confirm"
msgstr "Bestätige"
-#: konova/forms.py:154 konova/forms.py:323
+#: konova/forms.py:188 konova/forms.py:357
msgid "Remove"
msgstr "Löschen"
-#: konova/forms.py:156
+#: konova/forms.py:190
msgid "You are about to remove {} {}"
msgstr "Sie sind dabei {} {} zu löschen"
-#: konova/forms.py:243 konova/utils/quality.py:44 konova/utils/quality.py:46
+#: konova/forms.py:277 konova/utils/quality.py:44 konova/utils/quality.py:46
#: templates/form/collapsable/form.html:45
msgid "Geometry"
msgstr "Geometrie"
-#: konova/forms.py:324
+#: konova/forms.py:358
msgid "Are you sure?"
msgstr "Sind Sie sicher?"
-#: konova/forms.py:370
+#: konova/forms.py:404
msgid "When has this file been created? Important for photos."
msgstr "Wann wurde diese Datei erstellt oder das Foto aufgenommen?"
-#: konova/forms.py:381
+#: konova/forms.py:415
#: venv/lib/python3.7/site-packages/django/db/models/fields/files.py:231
msgid "File"
msgstr "Datei"
-#: konova/forms.py:383
+#: konova/forms.py:417
msgid "Allowed formats: pdf, jpg, png. Max size 15 MB."
msgstr "Formate: pdf, jpg, png. Maximal 15 MB."
-#: konova/forms.py:449
+#: konova/forms.py:482
msgid "Added document"
msgstr "Dokument hinzugefügt"
-#: konova/forms.py:506
+#: konova/forms.py:539
msgid "Confirm record"
msgstr "Verzeichnen bestätigen"
-#: konova/forms.py:514
+#: konova/forms.py:547
msgid "Record data"
msgstr "Daten verzeichnen"
-#: konova/forms.py:521
+#: konova/forms.py:554
msgid "Confirm unrecord"
msgstr "Entzeichnen bestätigen"
-#: konova/forms.py:522
+#: konova/forms.py:555
msgid "Unrecord data"
msgstr "Daten entzeichnen"
-#: konova/forms.py:523
+#: konova/forms.py:556
msgid "I, {} {}, confirm that this data must be unrecorded."
msgstr ""
"Ich, {} {}, bestätige, dass diese Daten wieder entzeichnet werden müssen."
@@ -1754,33 +1748,37 @@ msgstr ""
msgid "English"
msgstr ""
-#: konova/templates/konova/includes/parcel_table.html:5
+#: konova/templates/konova/includes/parcels/parcel_table_content.html:18
+msgid "Show more..."
+msgstr "Mehr anzeigen..."
+
+#: konova/templates/konova/includes/parcels/parcel_table_frame.html:5
msgid "Parcels can not be calculated, since no geometry is given."
msgstr ""
"Flurstücke können nicht berechnet werden, da keine Geometrie eingegeben "
"wurde."
-#: konova/templates/konova/includes/parcel_table.html:11
+#: konova/templates/konova/includes/parcels/parcel_table_frame.html:11
msgid "Municipal"
msgstr "Gemeinde"
-#: konova/templates/konova/includes/parcel_table.html:12
+#: konova/templates/konova/includes/parcels/parcel_table_frame.html:12
msgid "Municipal key"
msgstr "Gemeindeschlüssel"
-#: konova/templates/konova/includes/parcel_table.html:14
+#: konova/templates/konova/includes/parcels/parcel_table_frame.html:14
msgid "District key"
msgstr "Kreisschlüssel"
-#: konova/templates/konova/includes/parcel_table.html:32
+#: konova/templates/konova/includes/parcels/parcel_table_frame.html:32
msgid "Parcel group"
msgstr "Gemarkung"
-#: konova/templates/konova/includes/parcel_table.html:33
+#: konova/templates/konova/includes/parcels/parcel_table_frame.html:33
msgid "Parcel group key"
msgstr "Gemarkungsschlüssel"
-#: konova/templates/konova/includes/parcels.html:7
+#: konova/templates/konova/includes/parcels/parcels.html:7
msgid "Spatial reference"
msgstr "Raumreferenz"
@@ -1802,6 +1800,14 @@ msgstr "Neu"
msgid "Show"
msgstr "Anzeigen"
+#: konova/templates/konova/includes/report/qrcodes.html:7
+msgid "Open in browser"
+msgstr "Im Browser öffnen"
+
+#: konova/templates/konova/includes/report/qrcodes.html:15
+msgid "View in LANIS"
+msgstr "In LANIS öffnen"
+
#: konova/templates/konova/widgets/checkbox-tree-select.html:4
#: templates/generic_index.html:56
msgid "Search"
@@ -1895,11 +1901,18 @@ msgstr "Hierfür müssen Sie einer anderen Nutzergruppe angehören!"
msgid "Status of Checked and Recorded reseted"
msgstr "'Geprüft'/'Verzeichnet' wurde zurückgesetzt"
-#: konova/utils/message_templates.py:22
+#: konova/utils/message_templates.py:20
+msgid ""
+"Entry is recorded. To edit data, the entry first needs to be unrecorded."
+msgstr ""
+"Eintrag ist verzeichnet. Um Daten zu bearbeiten, muss der Eintrag erst "
+"entzeichnet werden."
+
+#: konova/utils/message_templates.py:23
msgid "This data is not shared with you"
msgstr "Diese Daten sind für Sie nicht freigegeben"
-#: konova/utils/message_templates.py:23
+#: konova/utils/message_templates.py:24
msgid ""
"Remember: This data has not been shared with you, yet. This means you can "
"only read but can not edit or perform any actions like running a check or "
@@ -1909,15 +1922,15 @@ msgstr ""
"bedeutet, dass Sie nur lesenden Zugriff hierauf haben und weder bearbeiten, "
"noch Prüfungen durchführen oder verzeichnen können."
-#: konova/utils/message_templates.py:26
+#: konova/utils/message_templates.py:27
msgid "Unsupported file type"
msgstr "Dateiformat nicht unterstützt"
-#: konova/utils/message_templates.py:27
+#: konova/utils/message_templates.py:28
msgid "File too large"
msgstr "Datei zu groß"
-#: konova/utils/message_templates.py:30
+#: konova/utils/message_templates.py:31
msgid ""
"Action canceled. Eco account is recorded or deductions exist. Only "
"conservation office member can perform this action."
@@ -1925,119 +1938,119 @@ msgstr ""
"Aktion abgebrochen. Ökokonto ist bereits verzeichnet oder Abbuchungen liegen "
"vor. Nur Eintragungsstellennutzer können diese Aktion jetzt durchführen."
-#: konova/utils/message_templates.py:33
+#: konova/utils/message_templates.py:34
msgid "Compensation {} added"
msgstr "Kompensation {} hinzugefügt"
-#: konova/utils/message_templates.py:34
+#: konova/utils/message_templates.py:35
msgid "Compensation {} removed"
msgstr "Kompensation {} entfernt"
-#: konova/utils/message_templates.py:36
+#: konova/utils/message_templates.py:37
msgid "Added compensation action"
msgstr "Maßnahme hinzugefügt"
-#: konova/utils/message_templates.py:37
+#: konova/utils/message_templates.py:38
msgid "Added compensation state"
msgstr "Zustand hinzugefügt"
-#: konova/utils/message_templates.py:40
+#: konova/utils/message_templates.py:41
msgid "State removed"
msgstr "Zustand gelöscht"
-#: konova/utils/message_templates.py:41
+#: konova/utils/message_templates.py:42
msgid "State edited"
msgstr "Zustand bearbeitet"
-#: konova/utils/message_templates.py:42
+#: konova/utils/message_templates.py:43
msgid "State added"
msgstr "Zustand hinzugefügt"
-#: konova/utils/message_templates.py:45
+#: konova/utils/message_templates.py:46
msgid "Action added"
msgstr "Maßnahme hinzugefügt"
-#: konova/utils/message_templates.py:46
+#: konova/utils/message_templates.py:47
msgid "Action edited"
msgstr "Maßnahme bearbeitet"
-#: konova/utils/message_templates.py:47
+#: konova/utils/message_templates.py:48
msgid "Action removed"
msgstr "Maßnahme entfernt"
-#: konova/utils/message_templates.py:50
+#: konova/utils/message_templates.py:51
msgid "Deduction added"
msgstr "Abbuchung hinzugefügt"
-#: konova/utils/message_templates.py:51
+#: konova/utils/message_templates.py:52
msgid "Deduction edited"
msgstr "Abbuchung bearbeitet"
-#: konova/utils/message_templates.py:52
+#: konova/utils/message_templates.py:53
msgid "Deduction removed"
msgstr "Abbuchung entfernt"
-#: konova/utils/message_templates.py:55
+#: konova/utils/message_templates.py:56
msgid "Deadline added"
msgstr "Frist/Termin hinzugefügt"
-#: konova/utils/message_templates.py:56
+#: konova/utils/message_templates.py:57
msgid "Deadline edited"
msgstr "Frist/Termin bearbeitet"
-#: konova/utils/message_templates.py:57
+#: konova/utils/message_templates.py:58
msgid "Deadline removed"
msgstr "Frist/Termin gelöscht"
-#: konova/utils/message_templates.py:60
+#: konova/utils/message_templates.py:61
msgid "Payment added"
msgstr "Zahlung hinzugefügt"
-#: konova/utils/message_templates.py:61
+#: konova/utils/message_templates.py:62
msgid "Payment edited"
msgstr "Zahlung bearbeitet"
-#: konova/utils/message_templates.py:62
+#: konova/utils/message_templates.py:63
msgid "Payment removed"
msgstr "Zahlung gelöscht"
-#: konova/utils/message_templates.py:65
+#: konova/utils/message_templates.py:66
msgid "Revocation added"
msgstr "Widerspruch hinzugefügt"
-#: konova/utils/message_templates.py:66
+#: konova/utils/message_templates.py:67
msgid "Revocation edited"
msgstr "Widerspruch bearbeitet"
-#: konova/utils/message_templates.py:67
+#: konova/utils/message_templates.py:68
msgid "Revocation removed"
msgstr "Widerspruch entfernt"
-#: konova/utils/message_templates.py:70
+#: konova/utils/message_templates.py:71
msgid "Document '{}' deleted"
msgstr "Dokument '{}' gelöscht"
-#: konova/utils/message_templates.py:71
+#: konova/utils/message_templates.py:72
msgid "Document added"
msgstr "Dokument hinzugefügt"
-#: konova/utils/message_templates.py:72
+#: konova/utils/message_templates.py:73
msgid "Document edited"
msgstr "Dokument bearbeitet"
-#: konova/utils/message_templates.py:75
+#: konova/utils/message_templates.py:76
msgid "Edited general data"
msgstr "Allgemeine Daten bearbeitet"
-#: konova/utils/message_templates.py:76
+#: konova/utils/message_templates.py:77
msgid "Added deadline"
msgstr "Frist/Termin hinzugefügt"
-#: konova/utils/message_templates.py:79
+#: konova/utils/message_templates.py:80
msgid "Geometry conflict detected with {}"
msgstr "Geometriekonflikt mit folgenden Einträgen erkannt: {}"
-#: konova/utils/message_templates.py:82
+#: konova/utils/message_templates.py:83
msgid "This intervention has {} revocations"
msgstr "Dem Eingriff liegen {} Widersprüche vor"
@@ -2364,6 +2377,25 @@ msgstr "Allgemeine Daten"
msgid "Cancel"
msgstr "Abbrechen"
+#: templates/form/recorded_no_edit.html:9
+msgid "This data is recorded"
+msgstr "Daten sind verzeichnet"
+
+#: templates/form/recorded_no_edit.html:14
+msgid ""
+"\n"
+" Whilst recorded the data is published publicly. If you wish to edit "
+"any information on this data, the data needs\n"
+" to be unrecorded first. Do not forget to record it afterwards, "
+"again.\n"
+" "
+msgstr ""
+"\n"
+"Verzeichnete Daten sind öffentlich einsehbar. Wenn Sie Informationen "
+"überarbeiten möchten muss dieser Datensatz zunächst entzeichnet werden. "
+"Vergessen Sie nicht ihn anschließend wieder zu verzeichnen.\n"
+" "
+
#: templates/form/table/generic_table_form_body.html:24
msgid "Fields with * are required."
msgstr "* sind Pflichtfelder."
@@ -2451,9 +2483,9 @@ msgid ""
" "
msgstr ""
"\n"
-" Diese Daten sind noch nicht veröffentlicht und/oder haben das Bestandskraftdatum noch nicht erreicht. "
-"Sie können daher aktuell nicht eingesehen werden. Schauen Sie zu einem späteren Zeitpunkt "
-"wieder vorbei. \n"
+" Diese Daten sind noch nicht veröffentlicht und/oder haben das "
+"Bestandskraftdatum noch nicht erreicht. Sie können daher aktuell nicht "
+"eingesehen werden. Schauen Sie zu einem späteren Zeitpunkt wieder vorbei. \n"
" "
#: templates/table/gmrkng_col.html:6
@@ -2504,11 +2536,11 @@ msgstr "Neuen Token generieren"
msgid "A new token needs to be validated by an administrator!"
msgstr "Neue Tokens müssen durch Administratoren freigeschaltet werden!"
-#: user/forms.py:168 user/forms.py:172 user/forms.py:323 user/forms.py:328
+#: user/forms.py:168 user/forms.py:172 user/forms.py:332 user/forms.py:337
msgid "Team name"
msgstr "Team Name"
-#: user/forms.py:179 user/forms.py:336 user/templates/user/team/index.html:30
+#: user/forms.py:179 user/forms.py:345 user/templates/user/team/index.html:30
msgid "Description"
msgstr "Beschreibung"
@@ -2552,11 +2584,15 @@ msgstr "Administratoren verwalten die Teamdaten und Mitglieder"
msgid "Selected admin ({}) needs to be a member of this team."
msgstr "Gewählter Administrator ({}) muss ein Mitglied des Teams sein."
-#: user/forms.py:291 user/templates/user/team/index.html:51
+#: user/forms.py:291 user/templates/user/team/index.html:54
msgid "Edit team"
msgstr "Team bearbeiten"
-#: user/forms.py:347
+#: user/forms.py:323 user/templates/user/team/index.html:50
+msgid "Leave team"
+msgstr "Team verlassen"
+
+#: user/forms.py:356
msgid "Team"
msgstr "Team"
@@ -2642,7 +2678,7 @@ msgstr "Neues Team hinzufügen"
msgid "Members"
msgstr "Mitglieder"
-#: user/templates/user/team/index.html:54
+#: user/templates/user/team/index.html:57
msgid "Remove team"
msgstr "Team entfernen"
@@ -2702,6 +2738,14 @@ msgstr "Team bearbeitet"
msgid "Team removed"
msgstr "Team gelöscht"
+#: user/views.py:218
+msgid "You are not a member of this team"
+msgstr "Sie sind kein Mitglied dieses Teams"
+
+#: user/views.py:225
+msgid "Left Team"
+msgstr "Team verlassen"
+
#: venv/lib/python3.7/site-packages/bootstrap4/components.py:17
#: venv/lib/python3.7/site-packages/bootstrap4/templates/bootstrap4/form_errors.html:3
#: venv/lib/python3.7/site-packages/bootstrap4/templates/bootstrap4/messages.html:4
diff --git a/templates/form/recorded_no_edit.html b/templates/form/recorded_no_edit.html
new file mode 100644
index 00000000..45fd08df
--- /dev/null
+++ b/templates/form/recorded_no_edit.html
@@ -0,0 +1,19 @@
+{% load i18n fontawesome_5 %}
+
+
+
+
+ {% fa5_icon 'bookmark' %}
+
+
+ {% trans 'This data is recorded' %}
+
+
+
+
+ {% blocktrans %}
+ Whilst recorded the data is published publicly. If you wish to edit any information on this data, the data needs
+ to be unrecorded first. Do not forget to record it afterwards, again.
+ {% endblocktrans %}
+
+
\ No newline at end of file
diff --git a/user/admin.py b/user/admin.py
index 1aeacee3..f4ef9fce 100644
--- a/user/admin.py
+++ b/user/admin.py
@@ -74,6 +74,15 @@ class TeamAdmin(admin.ModelAdmin):
"name",
"description",
]
+ filter_horizontal = [
+ "users"
+ ]
+
+ def formfield_for_foreignkey(self, db_field, request, **kwargs):
+ if db_field.name == "admin":
+ team_id = request.resolver_match.kwargs.get("object_id", None)
+ kwargs["queryset"] = User.objects.filter(teams__id__in=[team_id])
+ return super().formfield_for_foreignkey(db_field, request, **kwargs)
admin.site.register(User, UserAdmin)
diff --git a/user/forms.py b/user/forms.py
index 34c8fab9..4a657afb 100644
--- a/user/forms.py
+++ b/user/forms.py
@@ -317,6 +317,15 @@ class RemoveTeamModalForm(RemoveModalForm):
pass
+class LeaveTeamModalForm(RemoveModalForm):
+ def __init__(self, *args, **kwargs):
+ super().__init__(*args, **kwargs)
+ self.form_title = _("Leave team")
+
+ def save(self):
+ self.instance.remove_user(self.user)
+
+
class TeamDataForm(BaseModalForm):
name = forms.CharField(
label_suffix="",
diff --git a/user/models/team.py b/user/models/team.py
index e36c95b4..f14c7e0f 100644
--- a/user/models/team.py
+++ b/user/models/team.py
@@ -93,3 +93,17 @@ class Team(UuidModel):
"""
mailer = Mailer()
mailer.send_mail_shared_data_deleted_team(obj_identifier, obj_title, self)
+
+ def remove_user(self, user):
+ """ Removes a user from the team
+
+ Args:
+ user (User): The user to be removed
+
+ Returns:
+
+ """
+ self.users.remove(user)
+ if self.admin == user:
+ self.admin = self.users.first()
+ self.save()
diff --git a/user/templates/user/team/index.html b/user/templates/user/team/index.html
index d2040a35..3cd08e74 100644
--- a/user/templates/user/team/index.html
+++ b/user/templates/user/team/index.html
@@ -46,6 +46,9 @@
{% endfor %}