diff --git a/compensation/forms.py b/compensation/forms.py index 9d2df376..e755fff4 100644 --- a/compensation/forms.py +++ b/compensation/forms.py @@ -74,6 +74,9 @@ class NewPaymentForm(BaseModalForm): ) ) + # Define w-100 for all form fields + full_width_fields = True + def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.intervention = self.instance diff --git a/intervention/forms.py b/intervention/forms.py index 20ed4034..540e21d3 100644 --- a/intervention/forms.py +++ b/intervention/forms.py @@ -8,23 +8,21 @@ Created on: 02.12.20 from dal import autocomplete from django import forms from django.contrib.auth.models import User -from django.contrib.gis import forms as gis_forms from django.contrib.gis.geos import Polygon from django.db import transaction from django.urls import reverse from django.utils.translation import gettext_lazy as _ from codelist.models import KonovaCode -from codelist.settings import CODELIST_BIOTOPES_ID, CODELIST_PROCESS_TYPE_ID, CODELIST_LAW_ID, \ +from codelist.settings import CODELIST_PROCESS_TYPE_ID, CODELIST_LAW_ID, \ CODELIST_REGISTRATION_OFFICE_ID, CODELIST_CONSERVATION_OFFICE_ID from compensation.models import EcoAccountDeduction, EcoAccount -from intervention.models import Intervention, Revocation, RevocationDocument -from konova.forms import BaseForm, BaseModalForm -from konova.settings import DEFAULT_LAT, DEFAULT_LON, DEFAULT_ZOOM, ZB_GROUP, ETS_GROUP +from intervention.models import Intervention, Revocation, RevocationDocument, LegalData, ResponsibilityData +from konova.forms import BaseForm, BaseModalForm, SimpleGeomForm +from konova.settings import ZB_GROUP, ETS_GROUP from konova.utils.general import format_german_float from konova.utils.messenger import Messenger from konova.utils.user_checks import in_group -from organisation.models import Organisation from user.models import UserActionLogEntry, UserAction @@ -40,10 +38,16 @@ class NewInterventionForm(BaseForm): label_suffix="", help_text=_("An explanatory name"), max_length=255, + widget=forms.TextInput( + attrs={ + "placeholder": _("Construction XY; Location ABC") + } + ) ) type = forms.ModelChoiceField( label=_("Process type"), label_suffix="", + help_text=_(""), required=False, queryset=KonovaCode.objects.filter( is_archived=False, @@ -107,12 +111,22 @@ class NewInterventionForm(BaseForm): label_suffix="", max_length=255, required=False, + widget=forms.TextInput( + attrs={ + "placeholder": _("ZB-123/ABC.456") + } + ) ) conservation_office_file_number = forms.CharField( label=_("Conservation office file number"), label_suffix="", max_length=255, required=False, + widget=forms.TextInput( + attrs={ + "placeholder": _("ETS-123/ABC.456") + } + ) ) handler = forms.CharField( label=_("Intervention handler"), @@ -120,20 +134,45 @@ class NewInterventionForm(BaseForm): max_length=255, required=False, help_text=_("Who performs the intervention"), - ) - geometry = gis_forms.MultiPolygonField( - widget=gis_forms.OSMWidget( + widget=forms.TextInput( attrs={ - "default_lat": DEFAULT_LAT, - "default_lon": DEFAULT_LON, - "default_zoom": DEFAULT_ZOOM, - 'map_width': 800, - 'map_height': 500 + "placeholder": _("Company Mustermann") + } + ) + ) + registration_date = forms.DateField( + label=_("Registration date"), + label_suffix=_(""), + required=False, + widget=forms.DateInput( + attrs={ + "type": "date", }, - ), - label=_("Map"), + format="%d.%m.%Y" + ) + ) + binding_date = forms.DateField( + label=_("Binding on"), + label_suffix=_(""), + required=False, + widget=forms.DateInput( + attrs={ + "type": "date", + }, + format="%d.%m.%Y" + ) + ) + comment = forms.CharField( label_suffix="", - help_text=_("Where does the intervention take place") + label=_("Comment"), + required=False, + help_text=_("Additional comment"), + widget=forms.Textarea( + attrs={ + "rows": 5, + "class": "w-100" + } + ) ) def __init__(self, *args, **kwargs): @@ -142,30 +181,69 @@ class NewInterventionForm(BaseForm): self.action_url = reverse("intervention:new") self.cancel_redirect = reverse("intervention:index") - def save(self, user: User): + tmp_intervention = Intervention() + identifier = tmp_intervention._generate_new_identifier() + self.initialize_form_field("identifier", identifier) + + def save(self, user: User, geom_form: SimpleGeomForm): with transaction.atomic(): + # Fetch data from cleaned POST values identifier = self.cleaned_data.get("identifier", None) title = self.cleaned_data.get("title", None) _type = self.cleaned_data.get("type", None) laws = self.cleaned_data.get("laws", None) handler = self.cleaned_data.get("handler", None) - geometry = self.cleaned_data.get("geometry", Polygon()) + registration_office = self.cleaned_data.get("registration_office", None) + conservation_office = self.cleaned_data.get("conservation_office", None) + conservation_office_file_number = self.cleaned_data.get("conservation_office_file_number", None) + registration_office_file_number = self.cleaned_data.get("registration_office_file_number", None) + binding_date = self.cleaned_data.get("binding_date", None) + registration_date = self.cleaned_data.get("registration_date", None) + comment = self.cleaned_data.get("comment", None) + # Create log entry action = UserActionLogEntry.objects.create( user=user, action=UserAction.CREATED, ) - intervention = Intervention( + + # Create legal data object (without M2M laws first) + legal_data = LegalData.objects.create( + registration_date=registration_date, + binding_date=binding_date, + process_type=_type, + ) + # Then add the M2M laws to the object + legal_data.laws.set(laws) + + # Create responsible data object + responsibility_data = ResponsibilityData.objects.create( + registration_office=registration_office, + conservation_office=conservation_office, + registration_file_number=registration_office_file_number, + conservation_file_number=conservation_office_file_number, + handler=handler, + ) + + # Process the geometry form + geometry = geom_form.save(action) + + # Finally create main object, holding the other objects + intervention = Intervention.objects.create( identifier=identifier, title=title, - type=_type, - laws=laws, - handler=handler, - geometry=geometry, + responsible=responsibility_data, + legal=legal_data, created=action, + geometry=geometry, + comment=comment, ) - intervention.save() + + # Add the log entry to the main objects log list intervention.log.add(action) + + # Add the performing user as the first user having access to the data + intervention.users.add(user) return intervention @@ -384,6 +462,9 @@ class NewRevocationForm(BaseModalForm): ) ) + # Define w-100 for all form fields + full_width_fields = True + def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.form_title = _("Add revocation") @@ -532,6 +613,9 @@ class NewDeductionForm(BaseModalForm): ), ) + # Define w-100 for all form fields + full_width_fields = True + def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.form_title = _("New Deduction") diff --git a/intervention/models.py b/intervention/models.py index f05b0ddb..59cecf64 100644 --- a/intervention/models.py +++ b/intervention/models.py @@ -260,14 +260,41 @@ class Intervention(BaseObject): self.save() def save(self, *args, **kwargs): + """ Custom save functionality + + Performs some pre-save checks: + 1. Checking for existing identifiers + + Args: + *args (): + **kwargs (): + + Returns: + + """ if self.identifier is None or len(self.identifier) == 0: - # Create new identifier - new_id = self._generate_new_identifier() - while Intervention.objects.filter(identifier=new_id).exists(): - new_id = self._generate_new_identifier() - self.identifier = new_id + # No identifier given + self.identifier = self._generate_new_identifier() + + # Before saving, make sure the set identifier is not used, yet + while Intervention.objects.filter(identifier=self.identifier).exists(): + self.identifier = self._generate_new_identifier() super().save(*args, **kwargs) + def delete(self, using=None, keep_parents=False): + to_delete = [ + self.legal, + self.responsible, + self.geometry, + self.log.all() + ] + for entry in to_delete: + try: + entry.delete() + except AttributeError: + pass + super().delete(using, keep_parents) + def quality_check(self) -> list: """ Quality check diff --git a/intervention/templates/intervention/new/view.html b/intervention/templates/intervention/new/view.html index eb37e6b7..d543b7a3 100644 --- a/intervention/templates/intervention/new/view.html +++ b/intervention/templates/intervention/new/view.html @@ -1,6 +1,17 @@ {% extends 'base.html' %} {% load i18n l10n %} +{% block head %} + {% comment %} + dal documentation (django-autocomplete-light) states using form.media for adding needed scripts. + This does not work properly with modal forms, as the scripts are not loaded properly inside the modal. + Therefore the script linkages from form.media have been extracted and put inside dal/scripts.html to ensure + these scripts are loaded when needed. + {% endcomment %} + {% include 'dal/scripts.html' %} +{% endblock %} + {% block body %} +

{{data_form.form_title}}

{% include 'form/main_data_collapse_form.html' %} {% endblock %} \ No newline at end of file diff --git a/intervention/views.py b/intervention/views.py index 4c0d1c9a..1c759810 100644 --- a/intervention/views.py +++ b/intervention/views.py @@ -59,11 +59,18 @@ def new_view(request: HttpRequest): """ template = "intervention/new/view.html" - form = NewInterventionForm(request.POST or None) + data_form = NewInterventionForm(request.POST or None) + geom_form = SimpleGeomForm(request.POST or None, read_only=False) if request.method == "POST": - if form.is_valid(): - intervention = form.save(request.user) - messages.success(request, _("Intervention {} added").format(intervention.title)) + if data_form.is_valid() and geom_form.is_valid(): + generated_identifier = data_form.cleaned_data.get("identifier", None) + intervention = data_form.save(request.user, geom_form) + if generated_identifier != intervention.identifier: + messages.info( + request, + _("The identifier '{}' had to be changed to '{}' since another entry has been added in the meanwhile, which uses this identifier") + ) + messages.success(request, _("Intervention {} added").format(intervention.identifier)) return redirect("intervention:index") else: messages.error(request, _("Invalid input")) @@ -71,7 +78,8 @@ def new_view(request: HttpRequest): # For clarification: nothing in this case pass context = { - "form": form, + "data_form": data_form, + "geom_form": geom_form, } context = BaseContext(request, context).context return render(request, template, context) diff --git a/konova/forms.py b/konova/forms.py index 2b0f18a5..4575ee88 100644 --- a/konova/forms.py +++ b/konova/forms.py @@ -13,8 +13,8 @@ from bootstrap_modal_forms.utils import is_ajax from django import forms from django.contrib import messages from django.contrib.auth.models import User -from django.contrib.gis.forms import GeometryField, OSMWidget -from django.contrib.gis.geos import Polygon +from django.contrib.gis.forms import OSMWidget, MultiPolygonField +from django.contrib.gis.geos import Polygon, MultiPolygon from django.db import transaction from django.http import HttpRequest, HttpResponseRedirect from django.shortcuts import render @@ -25,7 +25,8 @@ from compensation.models import EcoAccount, Compensation, EcoAccountDocument, Co from ema.models import Ema, EmaDocument from intervention.models import Intervention, Revocation, RevocationDocument, InterventionDocument from konova.contexts import BaseContext -from konova.models import BaseObject +from konova.models import BaseObject, Geometry +from konova.settings import DEFAULT_SRID from konova.utils.message_templates import FORM_INVALID from user.models import UserActionLogEntry, UserAction @@ -187,8 +188,7 @@ class BaseModalForm(BaseForm, BSModalForm): full_width_fields = False template = "modal/modal_form.html" - def __init__(self, full_width_fields: bool = True, *args, **kwargs): - self.full_width_fields = full_width_fields + def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) if self.full_width_fields: # Automatically add bootstrap w-100 class for maximum width of form fields in modals @@ -243,18 +243,26 @@ class SimpleGeomForm(BaseForm): """ A geometry form for rendering geometry read-only using a widget """ - geom = GeometryField( + geom = MultiPolygonField( + srid=DEFAULT_SRID, + label=_("Geometry"), + help_text=_(""), + label_suffix="", required=False, - disabled=True, + disabled=False, widget=OSMWidget( attrs={ "map_width": 600, "map_height": 400, + # default_zoom defines the nearest possible zoom level from which the JS automatically + # zooms out if geometry requires a larger view port. So define a larger range for smaller geometries + "default_zoom": 25, } ) ) def __init__(self, *args, **kwargs): + read_only = kwargs.pop("read_only", True) super().__init__(*args, **kwargs) # Initialize geometry @@ -267,8 +275,17 @@ class SimpleGeomForm(BaseForm): geom = Polygon.from_bbox([0, 0, 0, 0]) # Zoom out to a very high level, so the user can see directly that there is no geometry for this entry self.fields["geom"].widget.attrs["default_zoom"] = 1 - self.initialize_form_field("geom", geom) - self.area = geom.area + if read_only: + self.initialize_form_field("geom", geom) + self.area = geom.area + self.fields["geom"].disabled = True + + def save(self, action: UserActionLogEntry): + geometry = Geometry.objects.create( + geom=self.cleaned_data.get("geom", MultiPolygon(srid=DEFAULT_SRID)), + created=action, + ) + return geometry class RemoveModalForm(BaseModalForm): @@ -294,15 +311,7 @@ class RemoveModalForm(BaseModalForm): def save(self): if isinstance(self.instance, BaseObject): - with transaction.atomic(): - action = UserActionLogEntry.objects.create( - user=self.user, - timestamp=timezone.now(), - action=UserAction.DELETED, - ) - self.instance.deleted = action - self.instance.log.add(action) - self.instance.save() + self.instance.mark_as_deleted(self.user) else: # If the class does not provide restorable delete functionality, we must delete the entry finally self.instance.delete() @@ -360,6 +369,9 @@ class NewDocumentForm(BaseModalForm): Ema: EmaDocument, } + # Define w-100 for all form fields + full_width_fields = True + def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.form_title = _("Add new document") diff --git a/konova/models.py b/konova/models.py index 492dcef7..40711259 100644 --- a/konova/models.py +++ b/konova/models.py @@ -9,6 +9,8 @@ import os import uuid from django.contrib.auth.models import User +from django.core.exceptions import ObjectDoesNotExist +from django.utils import timezone from django.utils.timezone import now from django.utils.translation import gettext_lazy as _ from django.contrib.gis.db.models import MultiPolygonField @@ -61,8 +63,20 @@ class BaseResource(UuidModel): abstract = True def delete(self, using=None, keep_parents=False): - if self.created: + """ Base deletin of a resource + + Args: + using (): + keep_parents (): + + Returns: + + """ + try: self.created.delete() + except ObjectDoesNotExist: + # Object does not exist anymore - we can skip this + pass super().delete() @@ -81,14 +95,13 @@ class BaseObject(BaseResource): class Meta: abstract = True - def delete(self, *args, **kwargs): - """ Custom delete functionality + def mark_as_deleted(self, user: User): + """ Mark an entry as deleted Does not delete from database but sets a timestamp for being deleted on and which user deleted the object Args: - *args (): - **kwargs (): + user (User): The performing user Returns: @@ -97,13 +110,14 @@ class BaseObject(BaseResource): # Nothing to do here return - _user = kwargs.get("user", None) with transaction.atomic(): action = UserActionLogEntry.objects.create( - user=_user, - action=UserAction.DELETED + user=user, + action=UserAction.DELETED, + timestamp=timezone.now() ) self.deleted = action + self.log.add(action) self.save() def add_log_entry(self, action: UserAction, user: User, comment: str): diff --git a/konova/static/css/konova.css b/konova/static/css/konova.css index 990b6643..3d04ce33 100644 --- a/konova/static/css/konova.css +++ b/konova/static/css/konova.css @@ -60,8 +60,18 @@ a { color: var(--rlp-red); } -input[type=text] { - width: 100%; +input[type=text], input[type=date] { + border: 1px solid gray; + border-radius: 0.2rem; + padding: 0.3rem 0.5rem; +} + +input:focus, textarea:focus, select:focus{ + outline: none; + border-color: var(--rlp-red); + box-shadow: 0 0 3px var(--rlp-red); + -moz-box-shadow: 0 0 3px var(--rlp-red); + -webkit-box-shadow: 0 0 3px var(--rlp-red); } .body-content{ @@ -137,6 +147,13 @@ input[type=text] { height: 8rem; } +/** +Overwrites bootstrap .btn:focus box shadow color +*/ +.btn:focus{ + box-shadow: 0 0 5px .2rem var(--rlp-gray-light); +} + .btn-default{ color: white; background-color: var(--rlp-red); @@ -175,13 +192,6 @@ input[type=text] { background-color: var(--rlp-gray-light); } -input:focus, textarea:focus, select:focus{ - border-color: var(--rlp-red) !important; - box-shadow: 0 0 3px var(--rlp-red) !important; - -moz-box-shadow: 0 0 3px var(--rlp-red) !important; - -webkit-box-shadow: 0 0 3px var(--rlp-red) !important; -} - .check-star{ color: goldenrod; } @@ -219,4 +229,7 @@ No other approach worked to get the autocomplete fields to full width of parent */ .select2-container{ width: 100% !important; +} +.select2-results__option--highlighted{ + background-color: var(--rlp-red) !important; } \ No newline at end of file diff --git a/locale/de/LC_MESSAGES/django.mo b/locale/de/LC_MESSAGES/django.mo index 3ec4be48..65c85dc8 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 bebb2d53..f153a720 100644 --- a/locale/de/LC_MESSAGES/django.po +++ b/locale/de/LC_MESSAGES/django.po @@ -7,16 +7,17 @@ #: compensation/forms.py:67 compensation/forms.py:264 compensation/forms.py:345 #: intervention/filters.py:26 intervention/filters.py:40 #: intervention/filters.py:47 intervention/filters.py:48 -#: intervention/forms.py:352 intervention/forms.py:364 -#: intervention/forms.py:377 konova/forms.py:139 konova/forms.py:282 -#: konova/forms.py:317 konova/forms.py:322 konova/forms.py:334 -#: konova/forms.py:346 konova/forms.py:366 user/forms.py:38 +#: intervention/forms.py:56 intervention/forms.py:151 intervention/forms.py:162 +#: intervention/forms.py:422 intervention/forms.py:434 +#: intervention/forms.py:447 konova/forms.py:140 konova/forms.py:250 +#: konova/forms.py:296 konova/forms.py:331 konova/forms.py:336 +#: konova/forms.py:348 konova/forms.py:360 konova/forms.py:380 user/forms.py:38 #, fuzzy msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-21 14:24+0200\n" +"POT-Creation-Date: 2021-09-23 12:46+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -53,16 +54,16 @@ msgstr "Zahlung wird an diesem Datum erwartet" #: ema/templates/ema/detail/includes/actions.html:34 #: ema/templates/ema/detail/includes/deadlines.html:34 #: ema/templates/ema/detail/includes/documents.html:31 -#: intervention/forms.py:376 +#: intervention/forms.py:446 #: intervention/templates/intervention/detail/includes/documents.html:31 #: intervention/templates/intervention/detail/includes/payments.html:34 #: intervention/templates/intervention/detail/includes/revocation.html:38 -#: konova/forms.py:345 +#: konova/forms.py:359 msgid "Comment" msgstr "Kommentar" #: compensation/forms.py:68 compensation/forms.py:265 compensation/forms.py:346 -#: intervention/forms.py:378 konova/forms.py:347 +#: intervention/forms.py:448 konova/forms.py:361 msgid "Additional comment, maximum {} letters" msgstr "Zusätzlicher Kommentar, maximal {} Zeichen" @@ -97,11 +98,11 @@ msgstr "Biotoptyp wählen" #: compensation/templates/compensation/detail/eco_account/includes/states-before.html:36 #: ema/templates/ema/detail/includes/states-after.html:36 #: ema/templates/ema/detail/includes/states-before.html:36 -#: intervention/forms.py:517 +#: intervention/forms.py:587 msgid "Surface" msgstr "Fläche" -#: compensation/forms.py:155 intervention/forms.py:519 +#: compensation/forms.py:155 intervention/forms.py:589 msgid "in m²" msgstr "" @@ -117,7 +118,7 @@ msgstr "Geben Sie die Daten des neuen Zustandes ein" msgid "Added state" msgstr "Zustand hinzugefügt" -#: compensation/forms.py:185 konova/forms.py:198 +#: compensation/forms.py:185 konova/forms.py:199 msgid "Object removed" msgstr "Objekt entfernt" @@ -133,7 +134,7 @@ msgstr "Fristart wählen" #: 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 -#: intervention/forms.py:351 +#: intervention/forms.py:421 msgid "Date" msgstr "Datum" @@ -257,7 +258,7 @@ msgstr "" "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:33 intervention/tables.py:23 +#: intervention/forms.py:37 intervention/tables.py:23 #: intervention/templates/intervention/detail/includes/compensations.html:30 msgid "Identifier" msgstr "Kennung" @@ -268,11 +269,11 @@ msgstr "Kennung" #: compensation/templates/compensation/detail/eco_account/includes/documents.html:28 #: compensation/templates/compensation/detail/eco_account/view.html:31 #: ema/tables.py:33 ema/templates/ema/detail/includes/documents.html:28 -#: ema/templates/ema/detail/view.html:24 intervention/forms.py:39 +#: ema/templates/ema/detail/view.html:24 intervention/forms.py:43 #: 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:31 konova/forms.py:316 +#: intervention/templates/intervention/detail/view.html:31 konova/forms.py:330 msgid "Title" msgstr "Bezeichnung" @@ -363,7 +364,7 @@ msgstr "Ökokonten" #: compensation/tables.py:222 #: compensation/templates/compensation/detail/eco_account/view.html:19 -#: intervention/forms.py:501 intervention/forms.py:508 +#: intervention/forms.py:571 intervention/forms.py:578 #: konova/templates/konova/home.html:88 templates/navbar.html:34 msgid "Eco-account" msgstr "Ökokonto" @@ -476,7 +477,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:365 +#: konova/forms.py:379 msgid "Add new document" msgstr "Neues Dokument hinzufügen" @@ -581,7 +582,7 @@ msgstr "Zuletzt bearbeitet" #: compensation/templates/compensation/detail/compensation/view.html:92 #: compensation/templates/compensation/detail/eco_account/view.html:91 -#: ema/templates/ema/detail/view.html:82 intervention/forms.py:285 +#: ema/templates/ema/detail/view.html:82 intervention/forms.py:355 #: intervention/templates/intervention/detail/view.html:116 msgid "Shared with" msgstr "Freigegeben für" @@ -642,19 +643,19 @@ msgid "Missing" msgstr "Fehlt" #: compensation/templates/compensation/detail/eco_account/view.html:58 -#: ema/templates/ema/detail/view.html:42 intervention/forms.py:91 +#: ema/templates/ema/detail/view.html:42 intervention/forms.py:101 #: intervention/templates/intervention/detail/view.html:56 msgid "Conservation office" msgstr "Eintragungsstelle" #: compensation/templates/compensation/detail/eco_account/view.html:62 -#: ema/templates/ema/detail/view.html:46 intervention/forms.py:112 +#: ema/templates/ema/detail/view.html:46 intervention/forms.py:127 #: intervention/templates/intervention/detail/view.html:60 msgid "Conservation office file number" msgstr "Aktenzeichen Eintragungsstelle" #: compensation/templates/compensation/detail/eco_account/view.html:66 -#: ema/templates/ema/detail/view.html:50 intervention/forms.py:118 +#: ema/templates/ema/detail/view.html:50 intervention/forms.py:138 #: intervention/templates/intervention/detail/view.html:64 msgid "Intervention handler" msgstr "Eingriffsverursacher" @@ -666,7 +667,7 @@ msgstr "" #: compensation/views/compensation_views.py:123 #: compensation/views/eco_account_views.py:190 ema/views.py:128 -#: intervention/views.py:391 +#: intervention/views.py:393 msgid "Log" msgstr "Log" @@ -676,7 +677,7 @@ msgstr "Kompensation entfernt" #: compensation/views/compensation_views.py:163 #: compensation/views/eco_account_views.py:289 ema/views.py:250 -#: intervention/views.py:94 +#: intervention/views.py:96 msgid "Document added" msgstr "Dokument hinzugefügt" @@ -712,16 +713,16 @@ msgid "Deduction removed" msgstr "Abbuchung entfernt" #: compensation/views/eco_account_views.py:210 ema/views.py:171 -#: intervention/views.py:431 +#: intervention/views.py:433 msgid "{} unrecorded" msgstr "{} entzeichnet" #: compensation/views/eco_account_views.py:210 ema/views.py:171 -#: intervention/views.py:431 +#: intervention/views.py:433 msgid "{} recorded" msgstr "{} verzeichnet" -#: compensation/views/eco_account_views.py:346 intervention/views.py:413 +#: compensation/views/eco_account_views.py:346 intervention/views.py:415 msgid "Deduction added" msgstr "Abbuchung hinzugefügt" @@ -773,111 +774,129 @@ msgstr "Gemarkung" msgid "Search for district" msgstr "Nach Gemarkung suchen" -#: intervention/forms.py:36 +#: intervention/forms.py:40 msgid "Generated automatically" msgstr "Automatisch generiert" -#: intervention/forms.py:41 +#: intervention/forms.py:45 msgid "An explanatory name" msgstr "Aussagekräftiger Titel" -#: intervention/forms.py:45 +#: intervention/forms.py:49 +msgid "Construction XY; Location ABC" +msgstr "Bauvorhaben XY; Flur ABC" + +#: intervention/forms.py:54 #: intervention/templates/intervention/detail/view.html:35 msgid "Process type" msgstr "Verfahrenstyp" -#: intervention/forms.py:60 +#: intervention/forms.py:70 #: intervention/templates/intervention/detail/view.html:39 msgid "Law" msgstr "Gesetz" -#: intervention/forms.py:62 +#: intervention/forms.py:72 msgid "Multiple selection possible" msgstr "Mehrfachauswahl möglich" -#: intervention/forms.py:76 +#: intervention/forms.py:86 #: intervention/templates/intervention/detail/view.html:48 msgid "Registration office" msgstr "Zulassungsbehörde" -#: intervention/forms.py:106 +#: intervention/forms.py:116 #: intervention/templates/intervention/detail/view.html:52 msgid "Registration office file number" msgstr "Aktenzeichen Zulassungsbehörde" #: intervention/forms.py:122 +msgid "ZB-123/ABC.456" +msgstr "" + +#: intervention/forms.py:133 +msgid "ETS-123/ABC.456" +msgstr "" + +#: intervention/forms.py:142 msgid "Who performs the intervention" msgstr "Wer führt den Eingriff durch" -#: intervention/forms.py:134 -msgid "Map" -msgstr "Karte" +#: intervention/forms.py:145 +msgid "Company Mustermann" +msgstr "Firma Mustermann" -#: intervention/forms.py:136 -msgid "Where does the intervention take place" -msgstr "Wo findet der Eingriff statt" +#: intervention/forms.py:150 +#: intervention/templates/intervention/detail/view.html:96 +msgid "Registration date" +msgstr "Datum Zulassung bzw. Satzungsbeschluss" -#: intervention/forms.py:141 +#: intervention/forms.py:161 +#: intervention/templates/intervention/detail/view.html:100 +msgid "Binding on" +msgstr "Datum Bestandskraft" + +#: intervention/forms.py:174 msgid "New intervention" msgstr "Neuer Eingriff" -#: intervention/forms.py:178 +#: intervention/forms.py:248 msgid "Edit intervention" msgstr "Eingriff bearbeiten" -#: intervention/forms.py:274 +#: intervention/forms.py:344 msgid "Share link" msgstr "Freigabelink" -#: intervention/forms.py:276 +#: intervention/forms.py:346 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:288 +#: intervention/forms.py:358 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:299 +#: intervention/forms.py:369 #: intervention/templates/intervention/detail/includes/controls.html:15 msgid "Share" msgstr "Freigabe" -#: intervention/forms.py:300 +#: intervention/forms.py:370 msgid "Share settings for {}" msgstr "Freigabe Einstellungen für {}" -#: intervention/forms.py:353 +#: intervention/forms.py:423 msgid "Date of revocation" msgstr "Datum des Widerspruchs" -#: intervention/forms.py:363 +#: intervention/forms.py:433 #: intervention/templates/intervention/detail/includes/revocation.html:35 msgid "Document" msgstr "Dokument" -#: intervention/forms.py:366 konova/forms.py:335 +#: intervention/forms.py:436 konova/forms.py:349 msgid "Must be smaller than 15 Mb" msgstr "Muss kleiner als 15 Mb sein" -#: intervention/forms.py:389 +#: intervention/forms.py:459 #: intervention/templates/intervention/detail/includes/revocation.html:18 msgid "Add revocation" msgstr "Widerspruch hinzufügen" -#: intervention/forms.py:429 +#: intervention/forms.py:499 msgid "Checked intervention data" msgstr "Eingriffsdaten geprüft" -#: intervention/forms.py:435 +#: intervention/forms.py:505 msgid "Checked compensations data and payments" msgstr "Kompensationen und Zahlungen geprüft" -#: intervention/forms.py:443 +#: intervention/forms.py:513 #: intervention/templates/intervention/detail/includes/controls.html:19 msgid "Run check" msgstr "Prüfung vornehmen" -#: intervention/forms.py:444 konova/forms.py:419 +#: intervention/forms.py:514 konova/forms.py:433 msgid "" "I, {} {}, confirm that all necessary control steps have been performed by " "myself." @@ -885,30 +904,30 @@ msgstr "" "Ich, {} {}, bestätige, dass die notwendigen Kontrollschritte durchgeführt " "wurden:" -#: intervention/forms.py:503 +#: intervention/forms.py:573 msgid "Only recorded accounts can be selected for deductions" msgstr "Nur verzeichnete Ökokonten können für Abbuchungen verwendet werden." -#: intervention/forms.py:522 intervention/forms.py:529 +#: intervention/forms.py:592 intervention/forms.py:599 #: intervention/tables.py:88 #: intervention/templates/intervention/detail/view.html:19 #: konova/templates/konova/home.html:11 templates/navbar.html:22 msgid "Intervention" msgstr "Eingriff" -#: intervention/forms.py:524 +#: intervention/forms.py:594 msgid "Only shared interventions can be selected" msgstr "Nur freigegebene Eingriffe können gewählt werden" -#: intervention/forms.py:537 +#: intervention/forms.py:607 msgid "New Deduction" msgstr "Neue Abbuchung" -#: intervention/forms.py:538 +#: intervention/forms.py:608 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.py:574 +#: intervention/forms.py:644 msgid "" "Eco-account {} is not recorded yet. You can only deduct from recorded " "accounts." @@ -916,7 +935,7 @@ msgstr "" "Ökokonto {} ist noch nicht verzeichnet. Abbuchungen können nur von " "verzeichneten Ökokonten erfolgen." -#: intervention/forms.py:587 +#: intervention/forms.py:657 msgid "" "The account {} has not enough surface for a deduction of {} m². There are " "only {} m² left" @@ -1017,31 +1036,23 @@ msgstr "Vom" msgid "Remove revocation" msgstr "Widerspruch entfernen" -#: intervention/templates/intervention/detail/view.html:96 -msgid "Registration date" -msgstr "Datum Zulassung bzw. Satzungsbeschluss" - -#: intervention/templates/intervention/detail/view.html:100 -msgid "Binding on" -msgstr "Datum Bestandskraft" - #: intervention/templates/intervention/detail/view.html:103 msgid "Exists" msgstr "vorhanden" -#: intervention/views.py:66 +#: intervention/views.py:67 msgid "Intervention {} added" msgstr "Eingriff {} hinzugefügt" -#: intervention/views.py:69 intervention/views.py:224 +#: intervention/views.py:70 intervention/views.py:226 msgid "Invalid input" msgstr "Eingabe fehlerhaft" -#: intervention/views.py:182 +#: intervention/views.py:184 msgid "This intervention has a revocation from {}" msgstr "Es existiert ein Widerspruch vom {}" -#: intervention/views.py:198 +#: intervention/views.py:200 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 " @@ -1051,43 +1062,43 @@ msgstr "" "bedeutet, dass Sie nur lesenden Zugriff hierauf haben und weder bearbeiten, " "noch Prüfungen durchführen oder verzeichnen können." -#: intervention/views.py:221 +#: intervention/views.py:223 msgid "{} edited" msgstr "{} bearbeitet" -#: intervention/views.py:250 +#: intervention/views.py:252 msgid "{} removed" msgstr "{} entfernt" -#: intervention/views.py:271 +#: intervention/views.py:273 msgid "Revocation removed" msgstr "Widerspruch entfernt" -#: intervention/views.py:297 +#: intervention/views.py:299 msgid "{} has already been shared with you" msgstr "{} wurde bereits für Sie freigegeben" -#: intervention/views.py:302 +#: intervention/views.py:304 msgid "{} has been shared with you" msgstr "{} ist nun für Sie freigegeben" -#: intervention/views.py:309 +#: intervention/views.py:311 msgid "Share link invalid" msgstr "Freigabelink ungültig" -#: intervention/views.py:330 +#: intervention/views.py:332 msgid "Share settings updated" msgstr "Freigabe Einstellungen aktualisiert" -#: intervention/views.py:349 +#: intervention/views.py:351 msgid "Check performed" msgstr "Prüfung durchgeführt" -#: intervention/views.py:369 +#: intervention/views.py:371 msgid "Revocation added" msgstr "Widerspruch hinzugefügt" -#: intervention/views.py:436 +#: intervention/views.py:438 msgid "There are errors on this intervention:" msgstr "Es liegen Fehler in diesem Eingriff vor:" @@ -1112,60 +1123,64 @@ msgstr "" msgid "You need to be part of another user group." msgstr "Hierfür müssen Sie einer anderen Nutzergruppe angehören!" -#: konova/forms.py:68 +#: konova/forms.py:69 msgid "Not editable" msgstr "Nicht editierbar" -#: konova/forms.py:138 konova/forms.py:281 +#: konova/forms.py:139 konova/forms.py:295 msgid "Confirm" msgstr "Bestätige" -#: konova/forms.py:150 konova/forms.py:290 +#: konova/forms.py:151 konova/forms.py:304 msgid "Remove" msgstr "Löschen" -#: konova/forms.py:152 +#: konova/forms.py:153 msgid "You are about to remove {} {}" msgstr "Sie sind dabei {} {} zu löschen" -#: konova/forms.py:291 +#: konova/forms.py:249 templates/form/main_data_collapse_form.html:47 +msgid "Geometry" +msgstr "Geometrie" + +#: konova/forms.py:305 msgid "Are you sure?" msgstr "Sind Sie sicher?" -#: konova/forms.py:321 +#: konova/forms.py:335 msgid "Created on" msgstr "Erstellt" -#: konova/forms.py:323 +#: konova/forms.py:337 msgid "When has this file been created? Important for photos." msgstr "Wann wurde diese Datei erstellt oder das Foto aufgenommen?" -#: konova/forms.py:333 +#: konova/forms.py:347 #: venv/lib/python3.7/site-packages/django/db/models/fields/files.py:231 msgid "File" msgstr "Datei" -#: konova/forms.py:396 +#: konova/forms.py:410 msgid "Added document" msgstr "Dokument hinzugefügt" -#: konova/forms.py:410 +#: konova/forms.py:424 msgid "Confirm record" msgstr "Verzeichnen bestätigen" -#: konova/forms.py:418 +#: konova/forms.py:432 msgid "Record data" msgstr "Daten verzeichnen" -#: konova/forms.py:425 +#: konova/forms.py:439 msgid "Confirm unrecord" msgstr "Entzeichnen bestätigen" -#: konova/forms.py:426 +#: konova/forms.py:440 msgid "Unrecord data" msgstr "Daten entzeichnen" -#: konova/forms.py:427 +#: konova/forms.py:441 msgid "I, {} {}, confirm that this data must be unrecorded." msgstr "" "Ich, {} {}, bestätige, dass diese Daten wieder entzeichnet werden müssen." @@ -1311,12 +1326,12 @@ msgid "Contact" msgstr "Kontakt" #: templates/form/generic_table_form.html:23 -#: templates/form/main_data_collapse_form.html:58 +#: templates/form/main_data_collapse_form.html:61 msgid "Cancel" msgstr "Abbrechen" #: templates/form/generic_table_form.html:27 -#: templates/form/main_data_collapse_form.html:62 +#: templates/form/main_data_collapse_form.html:65 msgid "Save" msgstr "Speichern" @@ -1324,7 +1339,7 @@ msgstr "Speichern" msgid "Fields with * are required." msgstr "* sind Pflichtfelder." -#: templates/form/main_data_collapse_form.html:13 +#: templates/form/main_data_collapse_form.html:14 msgid "" "\n" " First enter the most basic data. Of course you can " @@ -1335,23 +1350,20 @@ msgid "" " " msgstr "" "\n" -"Geben Sie zunächst die grundlegenden Daten ein. Sie können diese später immer noch ändern.\n" -"Alle weiteren Daten, wie Dokumente oder weitere Details, können nach dem Speichern des neuen Eintrags hinzugefügt " -"werden.\n" +"Geben Sie zunächst die grundlegenden Daten ein. Sie können diese später " +"immer noch ändern.\n" +"Alle weiteren Daten, wie Dokumente oder weitere Details, können nach dem " +"Speichern des neuen Eintrags hinzugefügt werden.\n" " " -#: templates/form/main_data_collapse_form.html:19 +#: templates/form/main_data_collapse_form.html:20 msgid "Open the input topic with a simple click." msgstr "Mit einem Linksklick öffnen Sie den jeweiligen Formularbereich." -#: templates/form/main_data_collapse_form.html:29 +#: templates/form/main_data_collapse_form.html:30 msgid "General data" msgstr "Allgemeine Daten" -#: templates/form/main_data_collapse_form.html:44 -msgid "Geometry" -msgstr "Geometrie" - #: templates/generic_index.html:28 msgid "New entry" msgstr "Neuer Eintrag" @@ -2708,6 +2720,12 @@ msgstr "" msgid "A fontawesome icon field" msgstr "" +#~ msgid "Map" +#~ msgstr "Karte" + +#~ msgid "Where does the intervention take place" +#~ msgstr "Wo findet der Eingriff statt" + #~ msgid "Which intervention type is this" #~ msgstr "Welcher Eingriffstyp" diff --git a/templates/form/main_data_collapse_form.html b/templates/form/main_data_collapse_form.html index 08e1bd15..2c783e4c 100644 --- a/templates/form/main_data_collapse_form.html +++ b/templates/form/main_data_collapse_form.html @@ -1,5 +1,6 @@ {% load i18n l10n fontawesome_5 %}
+ {% csrf_token %}

{{form.form_title}}

@@ -31,7 +32,9 @@
- {% include 'form/generic_table_form_body.html' %} + {% with data_form as form %} + {% include 'form/generic_table_form_body.html' %} + {% endwith %}
@@ -44,9 +47,9 @@ {% trans 'Geometry' %} -
+
- ToDo + {% include 'map/geom_form.html' %}