From af0fe655b35dde628984446179dbe3a4436dff39 Mon Sep 17 00:00:00 2001 From: mpeltriaux Date: Wed, 13 Oct 2021 09:26:46 +0200 Subject: [PATCH 1/8] Intervention template adjustments * renames intervention variable to obj to match other template style * renames open routes to detail routes --- compensation/account_urls.py | 2 +- compensation/comp_urls.py | 2 +- compensation/forms/forms.py | 6 +- compensation/tables.py | 4 +- .../detail/compensation/view.html | 2 +- .../eco_account/includes/deductions.html | 2 +- compensation/views/compensation_views.py | 6 +- compensation/views/eco_account_views.py | 6 +- ema/forms.py | 2 +- ema/tables.py | 2 +- ema/urls.py | 2 +- ema/views.py | 6 +- intervention/forms/forms.py | 2 +- intervention/tables.py | 2 +- .../intervention/detail/includes/comment.html | 4 +- .../detail/includes/compensations.html | 4 +- .../detail/includes/controls.html | 16 ++--- .../detail/includes/deductions.html | 8 +-- .../detail/includes/documents.html | 6 +- .../detail/includes/payments.html | 6 +- .../detail/includes/revocation.html | 10 ++-- .../templates/intervention/detail/view.html | 60 +++++++++---------- intervention/urls.py | 4 +- intervention/views.py | 10 ++-- 24 files changed, 87 insertions(+), 87 deletions(-) diff --git a/compensation/account_urls.py b/compensation/account_urls.py index 158e148a..47a178e2 100644 --- a/compensation/account_urls.py +++ b/compensation/account_urls.py @@ -12,7 +12,7 @@ urlpatterns = [ path("", index_view, name="acc-index"), path('new/', new_view, name='acc-new'), path('new/id', new_id_view, name='acc-new-id'), - path('', open_view, name='acc-open'), + path('', detail_view, name='acc-detail'), path('/log', log_view, name='acc-log'), path('/record', record_view, name='acc-record'), path('/edit', edit_view, name='acc-edit'), diff --git a/compensation/comp_urls.py b/compensation/comp_urls.py index 5ec578b3..cc025e86 100644 --- a/compensation/comp_urls.py +++ b/compensation/comp_urls.py @@ -14,7 +14,7 @@ urlpatterns = [ path('new/id', new_id_view, name='new-id'), path('new/', new_view, name='new'), path('new', new_view, name='new'), - path('', open_view, name='open'), + path('', detail_view, name='detail'), path('/log', log_view, name='log'), path('/edit', edit_view, name='edit'), path('/remove', remove_view, name='remove'), diff --git a/compensation/forms/forms.py b/compensation/forms/forms.py index 000cea2b..fd747ef5 100644 --- a/compensation/forms/forms.py +++ b/compensation/forms/forms.py @@ -179,7 +179,7 @@ class NewCompensationForm(AbstractCompensationForm): self.initialize_form_field("intervention", intervention_id) self.disable_form_field("intervention") self.action_url = reverse("compensation:new", args=(intervention_id,)) - self.cancel_redirect = reverse("intervention:open", args=(intervention_id,)) + self.cancel_redirect = reverse("intervention:detail", args=(intervention_id,)) else: self.action_url = reverse("compensation:new") self.cancel_redirect = reverse("compensation:index") @@ -230,7 +230,7 @@ class EditCompensationForm(NewCompensationForm): super().__init__(*args, **kwargs) self.form_title = _("Edit compensation") self.action_url = reverse("compensation:edit", args=(self.instance.id,)) - self.cancel_redirect = reverse("compensation:open", args=(self.instance.id,)) + self.cancel_redirect = reverse("compensation:detail", args=(self.instance.id,)) # Initialize form data form_data = { @@ -384,7 +384,7 @@ class EditEcoAccountForm(NewEcoAccountForm): self.form_title = _("Edit Eco-Account") self.action_url = reverse("compensation:acc-edit", args=(self.instance.id,)) - self.cancel_redirect = reverse("compensation:acc-open", args=(self.instance.id,)) + self.cancel_redirect = reverse("compensation:acc-detail", args=(self.instance.id,)) # Initialize form data form_data = { diff --git a/compensation/tables.py b/compensation/tables.py index 5f9f6e7c..278db13d 100644 --- a/compensation/tables.py +++ b/compensation/tables.py @@ -82,7 +82,7 @@ class CompensationTable(BaseTable): html = "" html += self.render_link( tooltip=_("Open {}").format(_("Compensation")), - href=reverse("compensation:open", args=(record.id,)), + href=reverse("compensation:detail", args=(record.id,)), txt=value, new_tab=False, ) @@ -223,7 +223,7 @@ class EcoAccountTable(BaseTable): html = "" html += self.render_link( tooltip=_("Open {}").format(_("Eco-account")), - href=reverse("compensation:acc-open", args=(record.id,)), + href=reverse("compensation:acc-detail", args=(record.id,)), txt=value, new_tab=False, ) diff --git a/compensation/templates/compensation/detail/compensation/view.html b/compensation/templates/compensation/detail/compensation/view.html index 487f2742..80b70613 100644 --- a/compensation/templates/compensation/detail/compensation/view.html +++ b/compensation/templates/compensation/detail/compensation/view.html @@ -33,7 +33,7 @@ {% trans 'compensates intervention' %} - + {{obj.intervention.identifier}} diff --git a/compensation/templates/compensation/detail/eco_account/includes/deductions.html b/compensation/templates/compensation/detail/eco_account/includes/deductions.html index 53061939..94d31da0 100644 --- a/compensation/templates/compensation/detail/eco_account/includes/deductions.html +++ b/compensation/templates/compensation/detail/eco_account/includes/deductions.html @@ -45,7 +45,7 @@ {% for deduction in deductions %} - + {{ deduction.intervention.identifier }} diff --git a/compensation/views/compensation_views.py b/compensation/views/compensation_views.py index 0d56d817..f4dc3921 100644 --- a/compensation/views/compensation_views.py +++ b/compensation/views/compensation_views.py @@ -74,7 +74,7 @@ def new_view(request: HttpRequest, intervention_id: str = None): ) ) messages.success(request, _("Compensation {} added").format(comp.identifier)) - return redirect("compensation:open", id=comp.id) + return redirect("compensation:detail", id=comp.id) else: messages.error(request, FORM_INVALID) else: @@ -129,7 +129,7 @@ def edit_view(request: HttpRequest, id: str): # The data form takes the geom form for processing, as well as the performing user comp = data_form.save(request.user, geom_form) messages.success(request, _("Compensation {} edited").format(comp.identifier)) - return redirect("compensation:open", id=comp.id) + return redirect("compensation:detail", id=comp.id) else: messages.error(request, FORM_INVALID) else: @@ -145,7 +145,7 @@ def edit_view(request: HttpRequest, id: str): @login_required @any_group_check -def open_view(request: HttpRequest, id: str): +def detail_view(request: HttpRequest, id: str): """ Renders a detail view for a compensation Args: diff --git a/compensation/views/eco_account_views.py b/compensation/views/eco_account_views.py index 476bd977..eab48da1 100644 --- a/compensation/views/eco_account_views.py +++ b/compensation/views/eco_account_views.py @@ -84,7 +84,7 @@ def new_view(request: HttpRequest): ) ) messages.success(request, _("Eco-Account {} added").format(acc.identifier)) - return redirect("compensation:acc-open", id=acc.id) + return redirect("compensation:acc-detail", id=acc.id) else: messages.error(request, FORM_INVALID) else: @@ -139,7 +139,7 @@ def edit_view(request: HttpRequest, id: str): # The data form takes the geom form for processing, as well as the performing user acc = data_form.save(request.user, geom_form) messages.success(request, _("Eco-Account {} edited").format(acc.identifier)) - return redirect("compensation:acc-open", id=acc.id) + return redirect("compensation:acc-detail", id=acc.id) else: messages.error(request, FORM_INVALID) else: @@ -155,7 +155,7 @@ def edit_view(request: HttpRequest, id: str): @login_required @any_group_check -def open_view(request: HttpRequest, id: str): +def detail_view(request: HttpRequest, id: str): """ Renders a detail view for a compensation Args: diff --git a/ema/forms.py b/ema/forms.py index d516259a..7fd42a51 100644 --- a/ema/forms.py +++ b/ema/forms.py @@ -99,7 +99,7 @@ class EditEmaForm(NewEmaForm): self.form_title = _("Edit EMA") self.action_url = reverse("ema:edit", args=(self.instance.id,)) - self.cancel_redirect = reverse("ema:open", args=(self.instance.id,)) + self.cancel_redirect = reverse("ema:detail", args=(self.instance.id,)) self.fields["identifier"].widget.attrs["url"] = reverse_lazy("ema:new-id") self.fields["title"].widget.attrs["placeholder"] = _("Compensation XY; Location ABC") diff --git a/ema/tables.py b/ema/tables.py index 5771307b..aeeece2f 100644 --- a/ema/tables.py +++ b/ema/tables.py @@ -80,7 +80,7 @@ class EmaTable(BaseTable): html = "" html += self.render_link( tooltip=_("Open {}").format(_("EMA")), - href=reverse("ema:open", args=(record.id,)), + href=reverse("ema:detail", args=(record.id,)), txt=value, new_tab=False, ) diff --git a/ema/urls.py b/ema/urls.py index 404cdf53..ac3bc1f8 100644 --- a/ema/urls.py +++ b/ema/urls.py @@ -13,7 +13,7 @@ urlpatterns = [ path("", index_view, name="index"), path("new/", new_view, name="new"), path("new/id", new_id_view, name="new-id"), - path("", open_view, name="open"), + path("", detail_view, name="detail"), path('/log', log_view, name='log'), path('/edit', edit_view, name='edit'), path('/remove', remove_view, name='remove'), diff --git a/ema/views.py b/ema/views.py index e479c17b..2d9a7f60 100644 --- a/ema/views.py +++ b/ema/views.py @@ -75,7 +75,7 @@ def new_view(request: HttpRequest): ) ) messages.success(request, _("EMA {} added").format(ema.identifier)) - return redirect("ema:open", id=ema.id) + return redirect("ema:detail", id=ema.id) else: messages.error(request, FORM_INVALID) else: @@ -108,7 +108,7 @@ def new_id_view(request: HttpRequest): @login_required -def open_view(request: HttpRequest, id: str): +def detail_view(request: HttpRequest, id: str): """ Renders the detail view of an EMA Args: @@ -199,7 +199,7 @@ def edit_view(request: HttpRequest, id: str): # The data form takes the geom form for processing, as well as the performing user ema = data_form.save(request.user, geom_form) messages.success(request, _("EMA {} edited").format(ema.identifier)) - return redirect("ema:open", id=ema.id) + return redirect("ema:detail", id=ema.id) else: messages.error(request, FORM_INVALID) else: diff --git a/intervention/forms/forms.py b/intervention/forms/forms.py index 27e2acf5..22364589 100644 --- a/intervention/forms/forms.py +++ b/intervention/forms/forms.py @@ -269,7 +269,7 @@ class EditInterventionForm(NewInterventionForm): super().__init__(*args, **kwargs) if self.instance is not None: self.action_url = reverse("intervention:edit", args=(self.instance.id,)) - self.cancel_redirect = reverse("intervention:open", args=(self.instance.id,)) + self.cancel_redirect = reverse("intervention:detail", args=(self.instance.id,)) self.form_title = _("Edit intervention") self.form_caption = "" diff --git a/intervention/tables.py b/intervention/tables.py index 1b9bc855..bf0e718d 100644 --- a/intervention/tables.py +++ b/intervention/tables.py @@ -86,7 +86,7 @@ class InterventionTable(BaseTable): html = "" html += self.render_link( tooltip=_("Open {}").format(_("Intervention")), - href=reverse("intervention:open", args=(record.id,)), + href=reverse("intervention:detail", args=(record.id,)), txt=value, new_tab=False, ) diff --git a/intervention/templates/intervention/detail/includes/comment.html b/intervention/templates/intervention/detail/includes/comment.html index 2f253568..aff3dec8 100644 --- a/intervention/templates/intervention/detail/includes/comment.html +++ b/intervention/templates/intervention/detail/includes/comment.html @@ -1,6 +1,6 @@ {% load i18n fontawesome_5 %} -{% if intervention.comment %} +{% if obj.comment %}
@@ -15,7 +15,7 @@
- {{intervention.comment}} + {{obj.comment}}
diff --git a/intervention/templates/intervention/detail/includes/compensations.html b/intervention/templates/intervention/detail/includes/compensations.html index 894c96af..c54c974f 100644 --- a/intervention/templates/intervention/detail/includes/compensations.html +++ b/intervention/templates/intervention/detail/includes/compensations.html @@ -11,7 +11,7 @@
{% if is_default_member and has_access %} - + {% if has_access %} - {% if is_zb_member %} - {% endif %} {% if is_ets_member %} - {% if intervention.recorded %} - {% else %} - {% endif %} {% endif %} {% if is_default_member %} - + - - {% endif %} diff --git a/intervention/templates/intervention/detail/includes/deductions.html b/intervention/templates/intervention/detail/includes/deductions.html index bfbfa367..be509998 100644 --- a/intervention/templates/intervention/detail/includes/deductions.html +++ b/intervention/templates/intervention/detail/includes/deductions.html @@ -4,14 +4,14 @@
- {{intervention.deductions.count}} + {{obj.deductions.count}} {% trans 'Eco Account Deductions' %}
{% if is_default_member and has_access %} - @@ -39,10 +39,10 @@ - {% for deduction in intervention.deductions.all %} + {% for deduction in obj.deductions.all %} - + {% if deduction.account.deleted or not deduction.account.recorded %} {% fa5_icon 'exclamation-triangle' %} {% endif %} diff --git a/intervention/templates/intervention/detail/includes/documents.html b/intervention/templates/intervention/detail/includes/documents.html index 54972bf5..1365edae 100644 --- a/intervention/templates/intervention/detail/includes/documents.html +++ b/intervention/templates/intervention/detail/includes/documents.html @@ -4,14 +4,14 @@
- {{intervention.documents.count}} + {{obj.documents.count}} {% trans 'Documents' %}
{% if is_default_member and has_access %} - @@ -36,7 +36,7 @@ - {% for doc in intervention.documents.all %} + {% for doc in obj.documents.all %} diff --git a/intervention/templates/intervention/detail/includes/payments.html b/intervention/templates/intervention/detail/includes/payments.html index 8177371a..b6b61d96 100644 --- a/intervention/templates/intervention/detail/includes/payments.html +++ b/intervention/templates/intervention/detail/includes/payments.html @@ -4,14 +4,14 @@
- {{intervention.payments.count}} + {{obj.payments.count}} {% trans 'Payments' %}
{% if is_default_member and has_access %} - @@ -39,7 +39,7 @@ - {% for pay in intervention.payments.all %} + {% for pay in obj.payments.all %} {{ pay.amount|floatformat:2 }} € diff --git a/intervention/templates/intervention/detail/includes/revocation.html b/intervention/templates/intervention/detail/includes/revocation.html index 10a4c44e..6699f016 100644 --- a/intervention/templates/intervention/detail/includes/revocation.html +++ b/intervention/templates/intervention/detail/includes/revocation.html @@ -4,7 +4,7 @@
- {% if intervention.legal.revocation %}1{% else %}0{% endif %} + {% if obj.legal.revocation %}1{% else %}0{% endif %} {% trans 'Revocation' %}
@@ -13,8 +13,8 @@ {% comment %} Only show add-button if no revocation exists, yet. {% endcomment %} - {% if is_default_member and has_access and not intervention.legal.revocation %} - @@ -42,8 +42,8 @@ - {% if intervention.legal.revocation %} - {% with intervention.legal.revocation as rev %} + {% if obj.legal.revocation %} + {% with obj.legal.revocation as rev %} {{ rev.date }} diff --git a/intervention/templates/intervention/detail/view.html b/intervention/templates/intervention/detail/view.html index 525182d5..7d2788e3 100644 --- a/intervention/templates/intervention/detail/view.html +++ b/intervention/templates/intervention/detail/view.html @@ -15,7 +15,7 @@
-

{% trans 'Intervention' %}
{{intervention.identifier}}

+

{% trans 'Intervention' %}
{{obj.identifier}}

{% include 'intervention/detail/includes/controls.html' %} @@ -26,52 +26,52 @@
- + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + diff --git a/intervention/urls.py b/intervention/urls.py index ac96d628..03c7c1d3 100644 --- a/intervention/urls.py +++ b/intervention/urls.py @@ -7,7 +7,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, \ +from intervention.views import index_view, new_view, detail_view, edit_view, remove_view, new_document_view, share_view, \ create_share_view, remove_revocation_view, new_revocation_view, run_check_view, log_view, new_deduction_view, \ record_view, remove_document_view, get_document_view, get_revocation_view, new_id_view @@ -16,7 +16,7 @@ urlpatterns = [ path("", index_view, name="index"), path('new/', new_view, name='new'), path('new/id', new_id_view, name='new-id'), - path('', open_view, name='open'), + path('', detail_view, name='detail'), path('/log', log_view, name='log'), path('/edit', edit_view, name='edit'), path('/remove', remove_view, name='remove'), diff --git a/intervention/views.py b/intervention/views.py index 8c9679f1..a5c7e928 100644 --- a/intervention/views.py +++ b/intervention/views.py @@ -74,7 +74,7 @@ def new_view(request: HttpRequest): ) ) messages.success(request, _("Intervention {} added").format(intervention.identifier)) - return redirect("intervention:open", id=intervention.id) + return redirect("intervention:detail", id=intervention.id) else: messages.error(request, FORM_INVALID) else: @@ -180,7 +180,7 @@ def remove_document_view(request: HttpRequest, doc_id: str): @login_required @any_group_check -def open_view(request: HttpRequest, id: str): +def detail_view(request: HttpRequest, id: str): """ Renders a detail view for viewing an intervention's data Args: @@ -213,7 +213,7 @@ def open_view(request: HttpRequest, id: str): ) context = { - "intervention": intervention, + "obj": intervention, "compensations": compensations, "has_access": is_data_shared, "geom_form": geom_form, @@ -252,7 +252,7 @@ def edit_view(request: HttpRequest, id: str): # The data form takes the geom form for processing, as well as the performing user intervention = data_form.save(request.user, geom_form) messages.success(request, _("Intervention {} edited").format(intervention.identifier)) - return redirect("intervention:open", id=intervention.id) + return redirect("intervention:detail", id=intervention.id) else: messages.error(request, FORM_INVALID) else: @@ -338,7 +338,7 @@ def share_view(request: HttpRequest, id: str, token: str): _("{} has been shared with you").format(intervention.identifier) ) intervention.users.add(user) - return redirect("intervention:open", id=id) + return redirect("intervention:detail", id=id) else: messages.error( request, From ac17d953c62dac0f243d9d109eed0a05f6f45442 Mon Sep 17 00:00:00 2001 From: mpeltriaux Date: Wed, 13 Oct 2021 14:03:34 +0200 Subject: [PATCH 2/8] #25 Public reports * adds public report rendering for intervention model * adds new routes for report * adds new public_base.html and public_navbar.html * adds lookup table for zoom levels for lanis link generating * moves qr code generating into utils/generators.py --- intervention/models.py | 10 +- .../detail/includes/controls.html | 2 +- .../templates/intervention/report/report.html | 119 +++++++++++++++ intervention/urls.py | 3 +- intervention/views.py | 44 +++++- konova/settings.py | 11 ++ konova/utils/generators.py | 25 ++++ locale/de/LC_MESSAGES/django.mo | Bin 22476 -> 23072 bytes locale/de/LC_MESSAGES/django.po | 139 ++++++++++++------ templates/base.html | 2 +- templates/{ => navbars}/navbar.html | 0 templates/navbars/public_navbar.html | 8 + templates/public_base.html | 44 ++++++ templates/report/unavailable.html | 14 ++ 14 files changed, 367 insertions(+), 54 deletions(-) create mode 100644 intervention/templates/intervention/report/report.html rename templates/{ => navbars}/navbar.html (100%) create mode 100644 templates/navbars/public_navbar.html create mode 100644 templates/public_base.html create mode 100644 templates/report/unavailable.html diff --git a/intervention/models.py b/intervention/models.py index 6b1fda72..e2a6c44e 100644 --- a/intervention/models.py +++ b/intervention/models.py @@ -18,7 +18,7 @@ from codelist.settings import CODELIST_REGISTRATION_OFFICE_ID, CODELIST_CONSERVA CODELIST_PROCESS_TYPE_ID from konova.models import BaseObject, Geometry, UuidModel, BaseResource, AbstractDocument, \ generate_document_file_upload_path -from konova.settings import DEFAULT_SRID_RLP, LANIS_LINK_TEMPLATE +from konova.settings import DEFAULT_SRID_RLP, LANIS_LINK_TEMPLATE, LANIS_ZOOM_LUT from konova.sub_settings.django_settings import DEFAULT_DATE_TIME_FORMAT from konova.utils import generators from user.models import UserActionLogEntry @@ -361,7 +361,13 @@ class Intervention(BaseObject): geom = self.geometry.geom.transform(DEFAULT_SRID_RLP, clone=True) x = geom.centroid.x y = geom.centroid.y - zoom_lvl = 16 + area = int(geom.envelope.area) + z_l = 16 + for k_area, v_zoom in LANIS_ZOOM_LUT.items(): + if k_area < area: + z_l = v_zoom + break + zoom_lvl = z_l except AttributeError: # If no geometry has been added, yet. x = 1 diff --git a/intervention/templates/intervention/detail/includes/controls.html b/intervention/templates/intervention/detail/includes/controls.html index 176d743b..4a64e5fb 100644 --- a/intervention/templates/intervention/detail/includes/controls.html +++ b/intervention/templates/intervention/detail/includes/controls.html @@ -6,7 +6,7 @@ LANIS - + diff --git a/intervention/templates/intervention/report/report.html b/intervention/templates/intervention/report/report.html new file mode 100644 index 00000000..7eac63f7 --- /dev/null +++ b/intervention/templates/intervention/report/report.html @@ -0,0 +1,119 @@ +{% extends 'public_base.html' %} +{% load i18n fontawesome_5 humanize %} + +{% block body %} +
+
+

{{obj.identifier}}

+
+
{% trans 'Title' %}{{intervention.title|default_if_none:""}}{{obj.title|default_if_none:""}}
{% trans 'Process type' %}{{intervention.legal.process_type|default_if_none:""}}{{obj.legal.process_type|default_if_none:""}}
{% trans 'Law' %} - {% for law in intervention.legal.laws.all %} + {% for law in obj.legal.laws.all %}
{{law.short_name}} - {{law.long_name}}

{% endfor %}
{% trans 'Registration office' %}{{intervention.responsible.registration_office.str_as_office|default_if_none:""}}{{obj.responsible.registration_office.str_as_office|default_if_none:""}}
{% trans 'Registration office file number' %}{{intervention.responsible.registration_file_number|default_if_none:""}}{{obj.responsible.registration_file_number|default_if_none:""}}
{% trans 'Conservation office' %}{{intervention.responsible.conservation_office.str_as_office|default_if_none:""}}{{obj.responsible.conservation_office.str_as_office|default_if_none:""}}
{% trans 'Conservation office file number' %}{{intervention.responsible.conservation_file_number|default_if_none:""}}{{obj.responsible.conservation_file_number|default_if_none:""}}
{% trans 'Intervention handler' %}{{intervention.responsible.handler|default_if_none:""}}{{obj.responsible.handler|default_if_none:""}}
{% trans 'Checked' %} - {% if intervention.checked is None %} + {% if obj.checked is None %} {% fa5_icon 'star' 'far' %} {% else %} - + {% fa5_icon 'star' %} {% endif %} @@ -80,41 +80,41 @@
{% trans 'Recorded' %} - {% if intervention.recorded is None %} + {% if obj.recorded is None %} {% fa5_icon 'bookmark' 'far' %} {% else %} - + {% fa5_icon 'bookmark' %} {% endif %}
{% trans 'Registration date' %}{{intervention.legal.registration_date|default_if_none:""}}{{obj.legal.registration_date|default_if_none:""}}
{% trans 'Binding on' %}{{intervention.legal.binding_date|default_if_none:""}}{{obj.legal.binding_date|default_if_none:""}}
{% trans 'Revocation' %}{{intervention.legal.revocation.date|naturalday|default_if_none:""}}{{obj.legal.revocation.date|naturalday|default_if_none:""}}
{% trans 'Last modified' %} - {{intervention.created.timestamp|default_if_none:""|naturalday}} + {{obj.created.timestamp|default_if_none:""|naturalday}}
- {{intervention.created.user.username}} + {{obj.created.user.username}}
{% trans 'Shared with' %} - {% for user in intervention.users.all %} + {% for user in obj.users.all %} {% include 'user/includes/contact_modal_button.html' %} {% endfor %}
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{% trans 'Title' %}{{obj.title|default_if_none:""}}
{% trans 'Process type' %}{{obj.legal.process_type|default_if_none:""}}
{% trans 'Law' %} + {% for law in obj.legal.laws.all %} +
{{law.short_name}} - {{law.long_name}}
+
+ {% endfor %} +
{% trans 'Registration office' %}{{obj.responsible.registration_office.str_as_office|default_if_none:""}}
{% trans 'Registration office file number' %}{{obj.responsible.registration_file_number|default_if_none:""}}
{% trans 'Conservation office' %}{{obj.responsible.conservation_office.str_as_office|default_if_none:""}}
{% trans 'Conservation office file number' %}{{obj.responsible.conservation_file_number|default_if_none:""}}
{% trans 'Intervention handler' %}{{obj.responsible.handler|default_if_none:""}}
{% trans 'Compensations' %} + {% for comp in obj.compensations.all %} + + {{comp.identifier}} + +
+ {% empty %} + {% trans 'None' %} + {% endfor %} +
{% trans 'Deductions of eco-accounts' %} + {% for deduction in deductions %} + + {{deduction.account.identifier}} + +
+ {% endfor %} +
{% trans 'Payments' %} + {% if obj.payments.all %} + {% trans 'Exist' %} + {% else %} + {% trans 'None' %} + {% endif %} +
{% trans 'Registration date' %}{{obj.legal.registration_date|default_if_none:""}}
{% trans 'Binding on' %}{{obj.legal.binding_date|default_if_none:""}}
{% trans 'Last modified' %} + {{obj.created.timestamp|default_if_none:""|naturalday}} +
+
+
+
+
+ {% include 'map/geom_form.html' %} +
+
+ {% include 'intervention/detail/includes/comment.html' %} +
+
+
+

{% trans 'Open in browser' %}

+ {{ qrcode|safe }} +
+
+

{% trans 'View in LANIS' %}

+ {{ qrcode_lanis|safe }} +
+
+ +
+
+ +{% endblock %} \ No newline at end of file diff --git a/intervention/urls.py b/intervention/urls.py index 03c7c1d3..022c3c9f 100644 --- a/intervention/urls.py +++ b/intervention/urls.py @@ -9,7 +9,7 @@ from django.urls import path from intervention.views import index_view, new_view, detail_view, edit_view, remove_view, new_document_view, share_view, \ create_share_view, remove_revocation_view, new_revocation_view, run_check_view, log_view, new_deduction_view, \ - record_view, remove_document_view, get_document_view, get_revocation_view, new_id_view + record_view, remove_document_view, get_document_view, get_revocation_view, new_id_view, report_view app_name = "intervention" urlpatterns = [ @@ -24,6 +24,7 @@ urlpatterns = [ path('/share', create_share_view, name='share-create'), path('/check', run_check_view, name='run-check'), path('/record', record_view, name='record'), + path('/report', report_view, name='report'), # Documents path('/document/new/', new_document_view, name='new-doc'), diff --git a/intervention/views.py b/intervention/views.py index a5c7e928..7449085d 100644 --- a/intervention/views.py +++ b/intervention/views.py @@ -1,7 +1,7 @@ from django.contrib.auth.decorators import login_required from django.utils.translation import gettext_lazy as _ from django.http import HttpRequest, JsonResponse -from django.shortcuts import render, get_object_or_404 +from django.shortcuts import render from intervention.forms.forms import NewInterventionForm, EditInterventionForm from intervention.forms.modalForms import ShareInterventionModalForm, NewRevocationModalForm, \ @@ -13,6 +13,7 @@ from konova.decorators import * from konova.forms import SimpleGeomForm, NewDocumentForm, RemoveModalForm, RecordModalForm from konova.sub_settings.django_settings import DEFAULT_DATE_FORMAT from konova.utils.documents import remove_document, get_document +from konova.utils.generators import generate_qr_code from konova.utils.message_templates import INTERVENTION_INVALID, FORM_INVALID, IDENTIFIER_REPLACED from konova.utils.user_checks import in_group @@ -470,4 +471,43 @@ def record_view(request: HttpRequest, id: str): request, msg_succ, msg_error=_("There are errors on this intervention:") - ) \ No newline at end of file + ) + + +def report_view(request:HttpRequest, id: str): + """ Renders the public report view + + Args: + request (HttpRequest): The incoming request + id (str): The id of the intervention + + Returns: + + """ + template = "intervention/report/report.html" + intervention = get_object_or_404(Intervention, id=id) + + # If intervention is not recorded (yet or currently) we need to render another template without any data + if not intervention.recorded: + template = "report/unavailable.html" + return render(request, template, {}) + + distinct_deductions = intervention.deductions.all().distinct( + "account" + ) + qrcode_img = generate_qr_code( + request.build_absolute_uri(reverse("intervention:report", args=(id,))), + 10 + ) + qrcode_img_lanis = generate_qr_code( + intervention.get_LANIS_link(), + 7 + ) + context = { + "obj": intervention, + "deductions": distinct_deductions, + "qrcode": qrcode_img, + "qrcode_lanis": qrcode_img_lanis, + } + context = BaseContext(request, context).context + return render(request, template, context) diff --git a/konova/settings.py b/konova/settings.py index 33f44d92..05e3c71a 100644 --- a/konova/settings.py +++ b/konova/settings.py @@ -69,3 +69,14 @@ ETS_GROUP = "Conservation office" # Needed to redirect to LANIS ## Values to be inserted are [zoom_level, x_coord, y_coord] LANIS_LINK_TEMPLATE = "https://geodaten.naturschutz.rlp.de/kartendienste_naturschutz/index.php?lang=de&zl={}&x={}&y={}&bl=tk_rlp_tms_grau&bo=1&lo=0.8,0.8,0.8,0.6,0.8,0.8,0.8,0.8,0.8&layers=eiv_f,eiv_l,eiv_p,kom_f,kom_l,kom_p,oek_f,ema_f,mae&service=kartendienste_naturschutz" +## This look up table (LUT) defines different zoom levels on the size of the calculate area of a geometry. +LANIS_ZOOM_LUT = { + 1000000000: 6, + 100000000: 10, + 10000000: 17, + 1000000: 20, + 100000: 25, + 10000: 28, + 1000: 30, + 500: 31, +} diff --git a/konova/utils/generators.py b/konova/utils/generators.py index dfae78f7..e8cc9d2d 100644 --- a/konova/utils/generators.py +++ b/konova/utils/generators.py @@ -7,6 +7,10 @@ Created on: 09.11.20 """ import random import string +import qrcode +import qrcode.image.svg + +from io import BytesIO def generate_random_string(length: int, use_numbers: bool = False, use_letters_lc: bool = False, use_letters_uc: bool = False) -> str: @@ -24,3 +28,24 @@ def generate_random_string(length: int, use_numbers: bool = False, use_letters_l elements = "".join(elements) ret_val = "".join(random.choice(elements) for i in range(length)) return ret_val + + +def generate_qr_code(content: str, size: int = 20) -> str: + """ Generates a qr code from given content + + Args: + content (str): The content for the qr code + size (int): The image size + + Returns: + qrcode_svg (str): The qr code as svg + """ + qrcode_factory = qrcode.image.svg.SvgImage + qrcode_img = qrcode.make( + content, + image_factory=qrcode_factory, + box_size=size + ) + stream = BytesIO() + qrcode_img.save(stream) + return stream.getvalue().decode() diff --git a/locale/de/LC_MESSAGES/django.mo b/locale/de/LC_MESSAGES/django.mo index 4e29c29e207850952a47a5c54773fbf929cc8259..dfe0ba3576672c728362f509ded257a490bda07c 100644 GIT binary patch delta 7376 zcmYk=2XqwG9>?(;2q8Trp@%Y|2M7cbkQfm{2Qh%5t7ytXmL$8F>=MMsTNOn_Q6Ux{ z(i96IDhL)p5g#guA{M{`Vxw45c@JzndEej8jfXks&*$DdGq?Qb&TJ0vJR7lQYeeW+ zO5_8EiUJKj#r`v z+Gy+Bta~wm_K#2#I)N!BWXvxVI?)i>)|mR(4K?$gr~&$-Ivj=SU=qfl2Q@K2k~DJ* zDg$?;u3v54i0W?}X5ubvho>taqWVUyT~@Nz{Pb zQJL6-y8bAVRP!^cJu%&wCfFXEVlIZXqOlaz;WShVr=wCIM0K!bjVae-%#9pwyg34IJ6Q9WWJjV{25$ z9Z&=HMLn8fsMKGDn)r37)K=Q|+fZ-S64WDj1~txZ)cv1?C@7^TP$^63XiRrZN7V~( z3>IS~K8Kp{i>S=(LQU*_>({7Ep2hGZ>EtdT83)te92?*@wmno#fmhmiQ3KqLx^WR| z0=1~rKWW=HV|cS!_h2*5AGGIxz$ofxQT?5_MzG3p)T1y5CnI|xWENBCOT#kcO*9A4 z!PBTsmej>=BGkYGPy>!erL+{4(i>5!zZdl=o30WQMzm5>St(31;FT)Cy;zG8jZ{x+SQAHlil72^->0)ZTd$wfhfaBfbA$ zQqX{BFa|H^1jclA>n%|ObwI5=1J!XpYUN{49eYsy1X1_jipp#)>biZX`@TSB?lgw9 z+v|682TDPuuoddrXQMtu!?8IQ+4FNz6Ip_Na6K|-^EqmO7}BJAGt|oSQJZe0t&c%n zH>o?%U#auZpx5LU)Jj&N9>p^lhcBWY(Qb^#eW(sTvh@?F^Jh@k|Bkx9L8g0sB5K8H zsJA5xwXi{%GpeH;+dj~?7ufpM zsMLD#YP#!akLQV8z)T2Cx%E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wJf&A)1dj zDfA)&IJd635tk5G6KjZji2&ju!k_ETp^lw|KDRoqAWnEo{DH$;_56PzjuSrIiD*Y#nmz4(={r#81L-|p<#!sf5TmiV{7)4To#D*K2L)br<_jwi<|nCg`m~wll{1rW tET38KZJAa+b$s1(-FN%fT)m8TW(XXzubU?)Ny<-yVejbzN`zHqqz7hZc diff --git a/locale/de/LC_MESSAGES/django.po b/locale/de/LC_MESSAGES/django.po index d50cd07e..ec0217f0 100644 --- a/locale/de/LC_MESSAGES/django.po +++ b/locale/de/LC_MESSAGES/django.po @@ -19,7 +19,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-10-13 08:46+0200\n" +"POT-Creation-Date: 2021-10-13 13:55+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -55,7 +55,9 @@ msgstr "Automatisch generiert" #: 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:336 +#: intervention/templates/intervention/detail/view.html:31 +#: intervention/templates/intervention/report/report.html:11 +#: konova/forms.py:336 msgid "Title" msgstr "Bezeichnung" @@ -112,6 +114,7 @@ msgstr "Zusätzlicher Kommentar" #: compensation/templates/compensation/detail/eco_account/view.html:58 #: ema/templates/ema/detail/view.html:42 intervention/forms/forms.py:101 #: intervention/templates/intervention/detail/view.html:56 +#: intervention/templates/intervention/report/report.html:36 msgid "Conservation office" msgstr "Eintragungsstelle" @@ -123,6 +126,7 @@ msgstr "Verantwortliche Stelle" #: compensation/templates/compensation/detail/eco_account/view.html:62 #: ema/templates/ema/detail/view.html:46 intervention/forms/forms.py:129 #: intervention/templates/intervention/detail/view.html:60 +#: intervention/templates/intervention/report/report.html:40 msgid "Conservation office file number" msgstr "Aktenzeichen Eintragungsstelle" @@ -373,14 +377,14 @@ msgstr "" msgid "Pieces" msgstr "Stück" -#: compensation/models.py:312 +#: compensation/models.py:311 msgid "" "Deductable surface can not be larger than existing surfaces in after states" msgstr "" "Die abbuchbare Fläche darf die Gesamtfläche der Zielzustände nicht " "überschreiten" -#: compensation/models.py:319 +#: compensation/models.py:318 msgid "" "Deductable surface can not be smaller than the sum of already existing " "deductions. Please contact the responsible users for the deductions!" @@ -417,6 +421,7 @@ msgstr "Zuletzt bearbeitet" #: compensation/tables.py:62 #: intervention/templates/intervention/detail/includes/compensations.html:8 +#: intervention/templates/intervention/report/report.html:48 msgid "Compensations" msgstr "Kompensationen" @@ -427,7 +432,7 @@ msgstr "Öffne {}" #: compensation/tables.py:84 #: compensation/templates/compensation/detail/compensation/view.html:19 -#: konova/templates/konova/home.html:49 templates/navbar.html:28 +#: konova/templates/konova/home.html:49 templates/navbars/navbar.html:28 msgid "Compensation" msgstr "Kompensation" @@ -443,13 +448,13 @@ msgstr "Am {} von {} geprüft worden" #: compensation/templates/compensation/detail/compensation/view.html:60 #: compensation/templates/compensation/detail/eco_account/view.html:47 #: ema/tables.py:101 ema/templates/ema/detail/view.html:31 -#: intervention/models.py:379 intervention/tables.py:131 +#: intervention/models.py:385 intervention/tables.py:131 #: intervention/templates/intervention/detail/view.html:85 msgid "Not recorded yet" msgstr "Noch nicht verzeichnet" #: compensation/tables.py:134 compensation/tables.py:263 ema/tables.py:106 -#: intervention/models.py:384 intervention/tables.py:136 +#: intervention/models.py:390 intervention/tables.py:136 msgid "Recorded on {} by {}" msgstr "Am {} von {} verzeichnet worden" @@ -476,7 +481,7 @@ msgstr "Ökokonten" #: compensation/tables.py:225 #: compensation/templates/compensation/detail/eco_account/view.html:19 #: intervention/forms/modalForms.py:258 intervention/forms/modalForms.py:265 -#: konova/templates/konova/home.html:88 templates/navbar.html:34 +#: konova/templates/konova/home.html:88 templates/navbars/navbar.html:34 msgid "Eco-account" msgstr "Ökokonto" @@ -683,6 +688,8 @@ msgstr "Gefördert mit" #: compensation/templates/compensation/detail/compensation/view.html:79 #: compensation/templates/compensation/detail/eco_account/view.html:78 #: ema/templates/ema/detail/view.html:62 +#: intervention/templates/intervention/report/report.html:56 +#: intervention/templates/intervention/report/report.html:77 msgid "None" msgstr "" @@ -690,6 +697,7 @@ msgstr "" #: compensation/templates/compensation/detail/eco_account/view.html:83 #: ema/templates/ema/detail/view.html:67 #: intervention/templates/intervention/detail/view.html:108 +#: intervention/templates/intervention/report/report.html:90 msgid "Last modified" msgstr "Zuletzt bearbeitet" @@ -762,6 +770,7 @@ msgstr "Fehlt" #: compensation/templates/compensation/detail/eco_account/view.html:66 #: ema/templates/ema/detail/view.html:50 intervention/forms/forms.py:141 #: intervention/templates/intervention/detail/view.html:64 +#: intervention/templates/intervention/report/report.html:44 msgid "Intervention handler" msgstr "Eingriffsverursacher" @@ -775,7 +784,7 @@ msgstr "Kompensation {} bearbeitet" #: compensation/views/compensation_views.py:210 #: compensation/views/eco_account_views.py:277 ema/views.py:174 -#: intervention/views.py:427 +#: intervention/views.py:428 msgid "Log" msgstr "Log" @@ -785,7 +794,7 @@ msgstr "Kompensation entfernt" #: compensation/views/compensation_views.py:250 #: compensation/views/eco_account_views.py:376 ema/views.py:327 -#: intervention/views.py:123 +#: intervention/views.py:124 msgid "Document added" msgstr "Dokument hinzugefügt" @@ -829,16 +838,16 @@ msgid "Deduction removed" msgstr "Abbuchung entfernt" #: compensation/views/eco_account_views.py:297 ema/views.py:248 -#: intervention/views.py:467 +#: intervention/views.py:468 msgid "{} unrecorded" msgstr "{} entzeichnet" #: compensation/views/eco_account_views.py:297 ema/views.py:248 -#: intervention/views.py:467 +#: intervention/views.py:468 msgid "{} recorded" msgstr "{} verzeichnet" -#: compensation/views/eco_account_views.py:433 intervention/views.py:449 +#: compensation/views/eco_account_views.py:433 intervention/views.py:450 msgid "Deduction added" msgstr "Abbuchung hinzugefügt" @@ -858,7 +867,7 @@ msgstr "Neue EMA hinzufügen" msgid "Edit EMA" msgstr "Bearbeite EMA" -#: ema/tables.py:59 templates/navbar.html:43 +#: ema/tables.py:59 templates/navbars/navbar.html:43 msgid "Payment funded compensations" msgstr "Ersatzzahlungsmaßnahmen (EMA)" @@ -870,7 +879,7 @@ msgstr "" "Maßnahmen aus Ersatzzahlungen, die nach 2015 rechtskräftig wurden, werden " "durch die Stiftung Natur und Umwelt verwaltet." -#: ema/tables.py:82 templates/navbar.html:43 +#: ema/tables.py:82 templates/navbars/navbar.html:43 msgid "EMA" msgstr "" @@ -912,11 +921,13 @@ msgstr "Bauvorhaben XY; Flur ABC" #: intervention/forms/forms.py:51 #: intervention/templates/intervention/detail/view.html:35 +#: intervention/templates/intervention/report/report.html:15 msgid "Process type" msgstr "Verfahrenstyp" #: intervention/forms/forms.py:68 #: intervention/templates/intervention/detail/view.html:39 +#: intervention/templates/intervention/report/report.html:19 msgid "Law" msgstr "Gesetz" @@ -926,11 +937,13 @@ msgstr "Mehrfachauswahl möglich" #: intervention/forms/forms.py:85 #: intervention/templates/intervention/detail/view.html:48 +#: intervention/templates/intervention/report/report.html:28 msgid "Registration office" msgstr "Zulassungsbehörde" #: intervention/forms/forms.py:117 #: intervention/templates/intervention/detail/view.html:52 +#: intervention/templates/intervention/report/report.html:32 msgid "Registration office file number" msgstr "Aktenzeichen Zulassungsbehörde" @@ -944,11 +957,13 @@ msgstr "Wer führt den Eingriff durch" #: intervention/forms/forms.py:154 #: intervention/templates/intervention/detail/view.html:96 +#: intervention/templates/intervention/report/report.html:82 msgid "Registration date" msgstr "Datum Zulassung bzw. Satzungsbeschluss" #: intervention/forms/forms.py:166 #: intervention/templates/intervention/detail/view.html:100 +#: intervention/templates/intervention/report/report.html:86 msgid "Binding on" msgstr "Datum Bestandskraft" @@ -1027,7 +1042,7 @@ msgstr "Nur verzeichnete Ökokonten können für Abbuchungen verwendet werden." #: intervention/forms/modalForms.py:285 intervention/forms/modalForms.py:292 #: intervention/tables.py:88 #: intervention/templates/intervention/detail/view.html:19 -#: konova/templates/konova/home.html:11 templates/navbar.html:22 +#: konova/templates/konova/home.html:11 templates/navbars/navbar.html:22 msgid "Intervention" msgstr "Eingriff" @@ -1127,6 +1142,7 @@ msgid "Eco-account not recorded! Deduction invalid!" msgstr "Ökokonto nicht verzeichnet! Abbuchung ungültig!" #: intervention/templates/intervention/detail/includes/payments.html:8 +#: intervention/templates/intervention/report/report.html:72 msgid "Payments" msgstr "Ersatzzahlungen" @@ -1156,15 +1172,47 @@ msgstr "Widerspruch entfernen" msgid "Exists" msgstr "vorhanden" -#: intervention/views.py:76 +#: intervention/templates/intervention/report/report.html:61 +msgid "Deductions of eco-accounts" +msgstr "Abbuchungen von Ökokonten" + +#: intervention/templates/intervention/report/report.html:75 +msgid "Exist" +msgstr "Vorhanden" + +#: intervention/templates/intervention/report/report.html:107 +msgid "Open in browser" +msgstr "" + +#: intervention/templates/intervention/report/report.html:111 +msgid "View in LANIS" +msgstr "In LANIS öffnen" + +#: intervention/templates/intervention/report/unavailable.html:6 +msgid "Unrecorded data" +msgstr "Daten nicht veröffentlicht" + +#: intervention/templates/intervention/report/unavailable.html:9 +msgid "" +"\n" +" The data you want to see is not recorded and might still be work " +"in progress. Please come back another time.\n" +" " +msgstr "" +"\n" +" Die Daten, die Sie einsehen möchten, sind in Bearbeitung und daher aktuell nicht öffentlich einsehbar. " +"Schauen Sie zu einem späteren Zeitpunkt wieder vorbei. \n" +" " + +#: intervention/views.py:77 msgid "Intervention {} added" msgstr "Eingriff {} hinzugefügt" -#: intervention/views.py:211 +#: intervention/views.py:212 msgid "This intervention has a revocation from {}" msgstr "Es existiert ein Widerspruch vom {}" -#: intervention/views.py:227 +#: intervention/views.py:228 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 " @@ -1174,43 +1222,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:254 +#: intervention/views.py:255 msgid "Intervention {} edited" msgstr "Eingriff {} bearbeitet" -#: intervention/views.py:286 +#: intervention/views.py:287 msgid "{} removed" msgstr "{} entfernt" -#: intervention/views.py:307 +#: intervention/views.py:308 msgid "Revocation removed" msgstr "Widerspruch entfernt" -#: intervention/views.py:333 +#: intervention/views.py:334 msgid "{} has already been shared with you" msgstr "{} wurde bereits für Sie freigegeben" -#: intervention/views.py:338 +#: intervention/views.py:339 msgid "{} has been shared with you" msgstr "{} ist nun für Sie freigegeben" -#: intervention/views.py:345 +#: intervention/views.py:346 msgid "Share link invalid" msgstr "Freigabelink ungültig" -#: intervention/views.py:366 +#: intervention/views.py:367 msgid "Share settings updated" msgstr "Freigabe Einstellungen aktualisiert" -#: intervention/views.py:385 +#: intervention/views.py:386 msgid "Check performed" msgstr "Prüfung durchgeführt" -#: intervention/views.py:405 +#: intervention/views.py:406 msgid "Revocation added" msgstr "Widerspruch hinzugefügt" -#: intervention/views.py:472 +#: intervention/views.py:473 msgid "There are errors on this intervention:" msgstr "Es liegen Fehler in diesem Eingriff vor:" @@ -1293,27 +1341,27 @@ msgid "I, {} {}, confirm that this data must be unrecorded." msgstr "" "Ich, {} {}, bestätige, dass diese Daten wieder entzeichnet werden müssen." -#: konova/management/commands/setup_data.py:41 +#: konova/management/commands/setup_data.py:26 msgid "On new related data" msgstr "Wenn neue Daten für mich angelegt werden" -#: konova/management/commands/setup_data.py:42 +#: konova/management/commands/setup_data.py:27 msgid "On disabled share link" msgstr "Wenn ein Freigabelink deaktiviert wird" -#: konova/management/commands/setup_data.py:43 +#: konova/management/commands/setup_data.py:28 msgid "On shared access removed" msgstr "Wenn mir eine Freigabe zu Daten entzogen wird" -#: konova/management/commands/setup_data.py:44 +#: konova/management/commands/setup_data.py:29 msgid "On shared data recorded" msgstr "Wenn meine freigegebenen Daten verzeichnet wurden" -#: konova/management/commands/setup_data.py:45 +#: konova/management/commands/setup_data.py:30 msgid "On shared data deleted" msgstr "Wenn meine freigegebenen Daten gelöscht wurden" -#: konova/management/commands/setup_data.py:46 +#: konova/management/commands/setup_data.py:31 msgid "On registered data edited" msgstr "Wenn meine freigegebenen Daten bearbeitet wurden" @@ -1540,39 +1588,39 @@ msgstr "Keine Geometrie vorhanden" msgid "Continue" msgstr "Weiter" -#: templates/navbar.html:4 +#: templates/navbars/navbar.html:4 msgid "Kompensationsverzeichnis Service Portal" msgstr "" -#: templates/navbar.html:5 +#: templates/navbars/navbar.html:5 msgid "KSP" msgstr "" -#: templates/navbar.html:16 +#: templates/navbars/navbar.html:16 msgid "Home" msgstr "Home" -#: templates/navbar.html:40 +#: templates/navbars/navbar.html:40 msgid "More" msgstr "Mehr" -#: templates/navbar.html:44 +#: templates/navbars/navbar.html:44 msgid "Import..." msgstr "" -#: templates/navbar.html:45 +#: templates/navbars/navbar.html:45 msgid "Export..." msgstr "" -#: templates/navbar.html:46 +#: templates/navbars/navbar.html:46 msgid "Reports" msgstr "Berichte" -#: templates/navbar.html:58 user/templates/user/index.html:31 +#: templates/navbars/navbar.html:58 user/templates/user/index.html:31 msgid "Settings" msgstr "Einstellungen" -#: templates/navbar.html:59 +#: templates/navbars/navbar.html:59 msgid "Logout" msgstr "Abmelden" @@ -2953,9 +3001,6 @@ msgstr "" #~ msgid "Show eco-accounts" #~ msgstr "Zeige Ökokonten" -#~ msgid "Deduct from eco-account" -#~ msgstr "Von Konto abbuchen" - #~ msgid "You are currently working as " #~ msgstr "Sie arbeiten gerade als " diff --git a/templates/base.html b/templates/base.html index 1816e05a..e728405a 100644 --- a/templates/base.html +++ b/templates/base.html @@ -20,7 +20,7 @@
{% block header %} - {% include 'navbar.html' %} + {% include 'navbars/navbar.html' %} {% endblock %}
diff --git a/templates/navbar.html b/templates/navbars/navbar.html similarity index 100% rename from templates/navbar.html rename to templates/navbars/navbar.html diff --git a/templates/navbars/public_navbar.html b/templates/navbars/public_navbar.html new file mode 100644 index 00000000..ec6db7c6 --- /dev/null +++ b/templates/navbars/public_navbar.html @@ -0,0 +1,8 @@ + + \ No newline at end of file diff --git a/templates/public_base.html b/templates/public_base.html new file mode 100644 index 00000000..d09d74b8 --- /dev/null +++ b/templates/public_base.html @@ -0,0 +1,44 @@ + +{% load static i18n l10n fontawesome_5 bootstrap4 %} + + + + + {{ base_frontend_title }} + + {% bootstrap_css %} + {% bootstrap_javascript jquery='full' %} + {% fontawesome_5_static %} + + + {% block head %} + {% endblock %} + + + +
+ {% block header %} + {% include 'navbars/public_navbar.html' %} + {% endblock %} +
+
+
+ {% for message in messages %} +
+ {{ message }} +
+ {% endfor %} +
+ + {% block body %} + + {% endblock %} +
+ + {% block footer %} + + {% endblock %} + + + + \ No newline at end of file diff --git a/templates/report/unavailable.html b/templates/report/unavailable.html new file mode 100644 index 00000000..87b1ecb9 --- /dev/null +++ b/templates/report/unavailable.html @@ -0,0 +1,14 @@ +{% extends 'public_base.html' %} +{% load i18n %} + +{% block body %} +
+

{% trans 'Unrecorded data' %}

+
+

+ {% blocktrans %} + The data you want to see is not recorded and might still be work in progress. Please come back another time. + {% endblocktrans %} +

+
+{% endblock %} \ No newline at end of file From c4a205908ad2f2b73c487771ca8f4e2486a32b5a Mon Sep 17 00:00:00 2001 From: mpeltriaux Date: Wed, 13 Oct 2021 16:15:26 +0200 Subject: [PATCH 3/8] #25 Public reports * adds/updates translation --- locale/de/LC_MESSAGES/django.mo | Bin 23072 -> 23123 bytes locale/de/LC_MESSAGES/django.po | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/locale/de/LC_MESSAGES/django.mo b/locale/de/LC_MESSAGES/django.mo index dfe0ba3576672c728362f509ded257a490bda07c..f8927af69bcf373051e08806e7b97fc39b8eef90 100644 GIT binary patch delta 6362 zcmYk=30PKD9>?+XDu^J+;tMZ`EP{v#Xb3JuxGSPHZe*EdsgEf=ij!vQSiP0nh|A+R zH*4DNVC-*PNU*b4d+tw3zw+-g}&<`#guwIp^Mc&j0?;xfgWB z7SE9_9{-t`phbqGi^rH|=nXSw1NCsPdX3rJ)R;)x`_Q3%J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pJp%>4N!%8pc=DrBi7@) zsK{53^iup!Yc2MrzaEw9s8QZTS*QSttQDw0$J+LE)OZeNFu$p`H#VVGum^Q0>rjX4 zC~AOnn2*1p4pXPwy})~;Qalosp$Vwx??L?n&O&8uIcjUy+52_q#L{t=N^87`I!yXV zwW0x7h!ZddpTa)48a3c))Jnd_NNh&EcOA8rNq2bv;3z?jKOPnMR19R`4)PyIM>QQ9 zU=`}~*@#-fLEHYs-oK0q^tT-2r8pUtvCgOfyQ6+j2I6cSj@_^hSKu$$3EewAU%!+5 zXVB3|M;?ZZ^&;+uO6i@b3GTM-X{fDv6gANtdw)JElTX|BI@CgHP+M{cwZLN-j%QFA zx!_RIKv%FQnsJ_GsPFSp%)n<+k?+JZY(VX0oAF*i<*0!xP#GGD8g~jRfa$1(Jc2sh zf5EPpyPk?p{VCLEavAkt@C2_Ni~O-O|8-*%$_f*xD(+_}M=5y}etGnJYu=*h(%(j1 z-6^Nsxe0z>g!^1V*Zj|Dmr!*5OkrRXYM)g|gDAQtQa*5hOz>BBB5Q!UtszQVQwQbu-?BJ1Gm* z!L^K%Xzw4Oo!(^ql{ zB+5!k9`BY=et)f}QDFOCrT&e(#qUokrl$q199(4|Z%e(*J?rm~eTbgJlz&r-==~UV zm?Np{nnn5A%}!3QjH5^2-8o7UMc0oWf&Xr?^=;UjXZztU3cn+!CGBj=i_~?!PtnOg zOX)=aFL>kn$=#Bi9(;*rYxj6^YGO0BSM1I2F_q`rxW1Hh-(@#5CAFl^-V1y>)PJ+> z|6njBi*gG^zX`e$DM9YclpKBYfqxrGUAc^W1(WbAcV|kv)1I2HFFXQYZ6s(|xbMG$vl9Eil7F*%Fn1wNTl5*o3Or?d-Obz^!Zl@8?Lp> Date: Wed, 13 Oct 2021 17:35:11 +0200 Subject: [PATCH 4/8] #25 Public reports * adds public report for compensations * adds/updates translations * prepares EMA and eco account reports --- compensation/account_urls.py | 1 + compensation/comp_urls.py | 1 + .../detail/compensation/includes/actions.html | 2 + .../compensation/includes/controls.html | 2 +- .../compensation/includes/states-after.html | 2 + .../compensation/includes/states-before.html | 2 + .../detail/eco_account/includes/controls.html | 2 +- .../report/compensation/report.html | 66 +++++++ compensation/views/compensation_views.py | 48 +++++ compensation/views/eco_account_views.py | 37 ++++ .../ema/detail/includes/controls.html | 2 +- ema/urls.py | 1 + ema/views.py | 36 ++++ .../templates/intervention/report/report.html | 7 +- intervention/views.py | 6 + locale/de/LC_MESSAGES/django.mo | Bin 23123 -> 23154 bytes locale/de/LC_MESSAGES/django.po | 176 ++++++++++-------- 17 files changed, 303 insertions(+), 88 deletions(-) create mode 100644 compensation/templates/compensation/report/compensation/report.html diff --git a/compensation/account_urls.py b/compensation/account_urls.py index 47a178e2..d29c827b 100644 --- a/compensation/account_urls.py +++ b/compensation/account_urls.py @@ -15,6 +15,7 @@ urlpatterns = [ path('', detail_view, name='acc-detail'), path('/log', log_view, name='acc-log'), path('/record', record_view, name='acc-record'), + path('/report', report_view, name='acc-report'), path('/edit', edit_view, name='acc-edit'), path('/remove', remove_view, name='acc-remove'), path('/state/new', state_new_view, name='acc-new-state'), diff --git a/compensation/comp_urls.py b/compensation/comp_urls.py index cc025e86..a63a6903 100644 --- a/compensation/comp_urls.py +++ b/compensation/comp_urls.py @@ -21,6 +21,7 @@ urlpatterns = [ path('/state/new', state_new_view, name='new-state'), path('/action/new', action_new_view, name='new-action'), path('/deadline/new', deadline_new_view, name="new-deadline"), + path('/report', report_view, name='report'), # Documents path('/document/new/', new_document_view, name='new-doc'), diff --git a/compensation/templates/compensation/detail/compensation/includes/actions.html b/compensation/templates/compensation/detail/compensation/includes/actions.html index c4b7fb40..a1c77f21 100644 --- a/compensation/templates/compensation/detail/compensation/includes/actions.html +++ b/compensation/templates/compensation/detail/compensation/includes/actions.html @@ -33,9 +33,11 @@ {% trans 'Comment' %} + {% if is_default_member and has_access %} {% trans 'Action' %} + {% endif %} diff --git a/compensation/templates/compensation/detail/compensation/includes/controls.html b/compensation/templates/compensation/detail/compensation/includes/controls.html index 5d6f61be..a9c68c29 100644 --- a/compensation/templates/compensation/detail/compensation/includes/controls.html +++ b/compensation/templates/compensation/detail/compensation/includes/controls.html @@ -6,7 +6,7 @@ LANIS - + diff --git a/compensation/templates/compensation/detail/compensation/includes/states-after.html b/compensation/templates/compensation/detail/compensation/includes/states-after.html index 585d5390..6b372974 100644 --- a/compensation/templates/compensation/detail/compensation/includes/states-after.html +++ b/compensation/templates/compensation/detail/compensation/includes/states-after.html @@ -35,9 +35,11 @@ {% trans 'Surface' %} + {% if is_default_member and has_access %} {% trans 'Action' %} + {% endif %} diff --git a/compensation/templates/compensation/detail/compensation/includes/states-before.html b/compensation/templates/compensation/detail/compensation/includes/states-before.html index fe6e4347..a8d20251 100644 --- a/compensation/templates/compensation/detail/compensation/includes/states-before.html +++ b/compensation/templates/compensation/detail/compensation/includes/states-before.html @@ -35,9 +35,11 @@ {% trans 'Surface' %} + {% if is_default_member and has_access %} {% trans 'Action' %} + {% endif %} diff --git a/compensation/templates/compensation/detail/eco_account/includes/controls.html b/compensation/templates/compensation/detail/eco_account/includes/controls.html index 76e3b2b9..dca0823f 100644 --- a/compensation/templates/compensation/detail/eco_account/includes/controls.html +++ b/compensation/templates/compensation/detail/eco_account/includes/controls.html @@ -6,7 +6,7 @@ LANIS - + diff --git a/compensation/templates/compensation/report/compensation/report.html b/compensation/templates/compensation/report/compensation/report.html new file mode 100644 index 00000000..fad5573f --- /dev/null +++ b/compensation/templates/compensation/report/compensation/report.html @@ -0,0 +1,66 @@ +{% extends 'public_base.html' %} +{% load i18n fontawesome_5 humanize %} + +{% block body %} +
+
+

{% trans 'Report' %}

+

{{obj.identifier}}

+
+ + + + + + + + + + + + + + + + + +
{% trans 'Title' %}{{obj.title|default_if_none:""}}
{% trans 'compensates intervention' %} + + {{obj.intervention.identifier}} + +
{% trans 'Funded by' %} + {% for funding in obj.fundings.all %} +
{{funding.short_name}}
+
+ {% endfor %} +
{% trans 'Last modified' %} + {{obj.modified.timestamp|default_if_none:""|naturalday}} +
+
+ + {% include 'compensation/detail/compensation/includes/states-before.html' %} + {% include 'compensation/detail/compensation/includes/states-after.html' %} + {% include 'compensation/detail/compensation/includes/actions.html' %} +
+
+
+ {% include 'map/geom_form.html' %} +
+
+ {% include 'intervention/detail/includes/comment.html' %} +
+
+
+

{% trans 'Open in browser' %}

+ {{ qrcode|safe }} +
+
+

{% trans 'View in LANIS' %}

+ {{ qrcode_lanis|safe }} +
+
+ +
+
+ +{% endblock %} \ No newline at end of file diff --git a/compensation/views/compensation_views.py b/compensation/views/compensation_views.py index f4dc3921..3ab84c27 100644 --- a/compensation/views/compensation_views.py +++ b/compensation/views/compensation_views.py @@ -13,6 +13,7 @@ from konova.contexts import BaseContext from konova.decorators import * from konova.forms import RemoveModalForm, SimpleGeomForm, NewDocumentForm from konova.utils.documents import get_document, remove_document +from konova.utils.generators import generate_qr_code from konova.utils.message_templates import FORM_INVALID, IDENTIFIER_REPLACED from konova.utils.user_checks import in_group @@ -381,3 +382,50 @@ def action_remove_view(request: HttpRequest, id: str): request, msg_success=_("Action removed") ) + + +def report_view(request:HttpRequest, id: str): + """ Renders the public report view + + Args: + request (HttpRequest): The incoming request + id (str): The id of the intervention + + Returns: + + """ + # Reuse the compensation report template since compensations are structurally identical + template = "compensation/report/compensation/report.html" + comp = get_object_or_404(Compensation, id=id) + + # If intervention is not recorded (yet or currently) we need to render another template without any data + if not comp.intervention.recorded: + template = "report/unavailable.html" + return render(request, template, {}) + + # Prepare data for map viewer + geom_form = SimpleGeomForm( + instance=comp + ) + qrcode_img = generate_qr_code( + request.build_absolute_uri(reverse("compensation:report", args=(id,))), + 10 + ) + qrcode_img_lanis = generate_qr_code( + comp.get_LANIS_link(), + 7 + ) + # Order states by surface + before_states = comp.before_states.all().order_by("-surface") + after_states = comp.after_states.all().order_by("-surface") + context = { + "obj": comp, + "qrcode": qrcode_img, + "qrcode_lanis": qrcode_img_lanis, + "has_access": False, # disables action buttons during rendering + "before_states": before_states, + "after_states": after_states, + "geom_form": geom_form, + } + context = BaseContext(request, context).context + return render(request, template, context) diff --git a/compensation/views/eco_account_views.py b/compensation/views/eco_account_views.py index eab48da1..5f2ede3b 100644 --- a/compensation/views/eco_account_views.py +++ b/compensation/views/eco_account_views.py @@ -24,6 +24,7 @@ from konova.decorators import any_group_check, default_group_required, conservat from konova.forms import RemoveModalForm, SimpleGeomForm, NewDocumentForm, RecordModalForm from konova.settings import DEFAULT_GROUP, ZB_GROUP, ETS_GROUP from konova.utils.documents import get_document, remove_document +from konova.utils.generators import generate_qr_code from konova.utils.message_templates import IDENTIFIER_REPLACED, FORM_INVALID from konova.utils.user_checks import in_group @@ -432,3 +433,39 @@ def new_deduction_view(request: HttpRequest, id: str): request, msg_success=_("Deduction added") ) + + +def report_view(request:HttpRequest, id: str): + """ Renders the public report view + + Args: + request (HttpRequest): The incoming request + id (str): The id of the intervention + + Returns: + + """ + # Reuse the compensation report template since EcoAccounts are structurally identical + template = "compensation/report/report.html" + acc = get_object_or_404(EcoAccount, id=id) + + # If intervention is not recorded (yet or currently) we need to render another template without any data + if not acc.recorded: + template = "report/unavailable.html" + return render(request, template, {}) + + qrcode_img = generate_qr_code( + request.build_absolute_uri(reverse("compensation:acc-report", args=(id,))), + 10 + ) + qrcode_img_lanis = generate_qr_code( + acc.get_LANIS_link(), + 7 + ) + context = { + "obj": acc, + "qrcode": qrcode_img, + "qrcode_lanis": qrcode_img_lanis, + } + context = BaseContext(request, context).context + return render(request, template, context) diff --git a/ema/templates/ema/detail/includes/controls.html b/ema/templates/ema/detail/includes/controls.html index 8b24f66e..88a112ff 100644 --- a/ema/templates/ema/detail/includes/controls.html +++ b/ema/templates/ema/detail/includes/controls.html @@ -6,7 +6,7 @@ LANIS
- + diff --git a/ema/urls.py b/ema/urls.py index ac3bc1f8..ad926d05 100644 --- a/ema/urls.py +++ b/ema/urls.py @@ -18,6 +18,7 @@ urlpatterns = [ path('/edit', edit_view, name='edit'), path('/remove', remove_view, name='remove'), path('/record', record_view, name='record'), + path('/report', report_view, name='report'), path('/state/new', state_new_view, name='new-state'), path('/action/new', action_new_view, name='new-action'), path('/deadline/new', deadline_new_view, name="new-deadline"), diff --git a/ema/views.py b/ema/views.py index 2d9a7f60..5fd9372a 100644 --- a/ema/views.py +++ b/ema/views.py @@ -16,6 +16,7 @@ from ema.models import Ema, EmaDocument from konova.forms import RemoveModalForm, NewDocumentForm, SimpleGeomForm, RecordModalForm from konova.settings import DEFAULT_GROUP, ZB_GROUP, ETS_GROUP from konova.utils.documents import get_document, remove_document +from konova.utils.generators import generate_qr_code from konova.utils.message_templates import IDENTIFIER_REPLACED, FORM_INVALID from konova.utils.user_checks import in_group @@ -399,3 +400,38 @@ def action_remove_view(request: HttpRequest, id: str): id ) + +def report_view(request:HttpRequest, id: str): + """ Renders the public report view + + Args: + request (HttpRequest): The incoming request + id (str): The id of the intervention + + Returns: + + """ + # Reuse the compensation report template since EMAs are structurally identical + template = "compensation/report/report.html" + ema = get_object_or_404(Ema, id=id) + + # If intervention is not recorded (yet or currently) we need to render another template without any data + if not ema.recorded: + template = "report/unavailable.html" + return render(request, template, {}) + + qrcode_img = generate_qr_code( + request.build_absolute_uri(reverse("ema:report", args=(id,))), + 10 + ) + qrcode_img_lanis = generate_qr_code( + ema.get_LANIS_link(), + 7 + ) + context = { + "obj": ema, + "qrcode": qrcode_img, + "qrcode_lanis": qrcode_img_lanis, + } + context = BaseContext(request, context).context + return render(request, template, context) \ No newline at end of file diff --git a/intervention/templates/intervention/report/report.html b/intervention/templates/intervention/report/report.html index 7eac63f7..4813582e 100644 --- a/intervention/templates/intervention/report/report.html +++ b/intervention/templates/intervention/report/report.html @@ -4,7 +4,8 @@ {% block body %}
-

{{obj.identifier}}

+

{% trans 'Report' %}

+

{{obj.identifier}}

@@ -48,7 +49,7 @@ - {% for action in obj.actions.all %} + {% for action in actions %} - + {% if is_default_member and has_access %} + + {% endif %} diff --git a/compensation/templates/compensation/detail/compensation/includes/documents.html b/compensation/templates/compensation/detail/compensation/includes/documents.html index 3548e940..7e958f6d 100644 --- a/compensation/templates/compensation/detail/compensation/includes/documents.html +++ b/compensation/templates/compensation/detail/compensation/includes/documents.html @@ -30,9 +30,11 @@ - + {% if is_default_member and has_access %} + + {% endif %} diff --git a/compensation/templates/compensation/detail/compensation/includes/states-before.html b/compensation/templates/compensation/detail/compensation/includes/states-before.html index a8d20251..a0c541ae 100644 --- a/compensation/templates/compensation/detail/compensation/includes/states-before.html +++ b/compensation/templates/compensation/detail/compensation/includes/states-before.html @@ -4,7 +4,7 @@
- {{obj.before_states.count}} + {{before_states.count}} {% trans 'States before' %}
diff --git a/compensation/templates/compensation/report/compensation/report.html b/compensation/templates/compensation/report/compensation/report.html index fad5573f..de8ddd15 100644 --- a/compensation/templates/compensation/report/compensation/report.html +++ b/compensation/templates/compensation/report/compensation/report.html @@ -23,10 +23,14 @@
diff --git a/compensation/views/compensation_views.py b/compensation/views/compensation_views.py index 3ab84c27..994e9647 100644 --- a/compensation/views/compensation_views.py +++ b/compensation/views/compensation_views.py @@ -163,8 +163,9 @@ def detail_view(request: HttpRequest, id: str): is_data_shared = comp.intervention.is_shared_with(_user) # Order states according to surface - before_states = comp.before_states.all().order_by("-surface") - after_states = comp.after_states.all().order_by("-surface") + before_states = comp.before_states.all().prefetch_related("biotope_type").order_by("-surface") + after_states = comp.after_states.all().prefetch_related("biotope_type").order_by("-surface") + actions = comp.actions.all().prefetch_related("action_type") # Precalculate logical errors between before- and after-states # Sum() returns None in case of no states, so we catch that and replace it with 0 for easier handling @@ -176,6 +177,7 @@ def detail_view(request: HttpRequest, id: str): "obj": comp, "geom_form": geom_form, "has_access": is_data_shared, + "actions": actions, "before_states": before_states, "after_states": after_states, "sum_before_states": sum_before_states, @@ -416,8 +418,10 @@ def report_view(request:HttpRequest, id: str): 7 ) # Order states by surface - before_states = comp.before_states.all().order_by("-surface") - after_states = comp.after_states.all().order_by("-surface") + before_states = comp.before_states.all().order_by("-surface").prefetch_related("biotope_type") + after_states = comp.after_states.all().order_by("-surface").prefetch_related("biotope_type") + actions = comp.actions.all().prefetch_related("action_type") + context = { "obj": comp, "qrcode": qrcode_img, @@ -426,6 +430,7 @@ def report_view(request:HttpRequest, id: str): "before_states": before_states, "after_states": after_states, "geom_form": geom_form, + "actions": actions, } context = BaseContext(request, context).context return render(request, template, context) diff --git a/intervention/templates/intervention/detail/includes/compensations.html b/intervention/templates/intervention/detail/includes/compensations.html index c54c974f..79fcaa09 100644 --- a/intervention/templates/intervention/detail/includes/compensations.html +++ b/intervention/templates/intervention/detail/includes/compensations.html @@ -32,9 +32,11 @@ - + {% if is_default_member and has_access %} + + {% endif %} diff --git a/intervention/templates/intervention/detail/includes/deductions.html b/intervention/templates/intervention/detail/includes/deductions.html index be509998..cb2f8179 100644 --- a/intervention/templates/intervention/detail/includes/deductions.html +++ b/intervention/templates/intervention/detail/includes/deductions.html @@ -33,9 +33,11 @@ - + {% if is_default_member and has_access %} + + {% endif %} diff --git a/intervention/templates/intervention/detail/includes/documents.html b/intervention/templates/intervention/detail/includes/documents.html index 1365edae..cc0c9a17 100644 --- a/intervention/templates/intervention/detail/includes/documents.html +++ b/intervention/templates/intervention/detail/includes/documents.html @@ -30,9 +30,11 @@ - + {% if is_default_member and has_access %} + + {% endif %} diff --git a/intervention/templates/intervention/detail/includes/payments.html b/intervention/templates/intervention/detail/includes/payments.html index b6b61d96..c3ab7568 100644 --- a/intervention/templates/intervention/detail/includes/payments.html +++ b/intervention/templates/intervention/detail/includes/payments.html @@ -33,9 +33,11 @@ - + {% if is_default_member and has_access %} + + {% endif %} diff --git a/intervention/templates/intervention/detail/includes/revocation.html b/intervention/templates/intervention/detail/includes/revocation.html index 6699f016..c9d821ff 100644 --- a/intervention/templates/intervention/detail/includes/revocation.html +++ b/intervention/templates/intervention/detail/includes/revocation.html @@ -36,9 +36,11 @@ - + {% if is_default_member and has_access %} + + {% endif %} From f5f08b979b81178d01dfa4cc9e508c070be9e440 Mon Sep 17 00:00:00 2001 From: mpeltriaux Date: Thu, 14 Oct 2021 08:49:32 +0200 Subject: [PATCH 6/8] #25 Public reports * adds fully functional EMA report * adds/updates translations --- .../compensation/detail/eco_account/view.html | 2 +- ema/templates/ema/detail/view.html | 2 +- ema/templates/ema/report/report.html | 74 +++++++++++++++ ema/views.py | 16 +++- locale/de/LC_MESSAGES/django.mo | Bin 23154 -> 23203 bytes locale/de/LC_MESSAGES/django.po | 88 ++++++++++-------- 6 files changed, 142 insertions(+), 40 deletions(-) create mode 100644 ema/templates/ema/report/report.html diff --git a/compensation/templates/compensation/detail/eco_account/view.html b/compensation/templates/compensation/detail/eco_account/view.html index efe44bb1..429c4f4d 100644 --- a/compensation/templates/compensation/detail/eco_account/view.html +++ b/compensation/templates/compensation/detail/eco_account/view.html @@ -62,7 +62,7 @@ - + diff --git a/ema/templates/ema/detail/view.html b/ema/templates/ema/detail/view.html index 941e47c1..757ee64d 100644 --- a/ema/templates/ema/detail/view.html +++ b/ema/templates/ema/detail/view.html @@ -47,7 +47,7 @@ - + diff --git a/ema/templates/ema/report/report.html b/ema/templates/ema/report/report.html new file mode 100644 index 00000000..756b6573 --- /dev/null +++ b/ema/templates/ema/report/report.html @@ -0,0 +1,74 @@ +{% extends 'public_base.html' %} +{% load i18n fontawesome_5 humanize %} + +{% block body %} +
+
+

{% trans 'Report' %}

+

{{obj.identifier}}

+
+
{% trans 'Compensations' %} {% for comp in obj.compensations.all %} - + {{comp.identifier}}
@@ -61,7 +62,7 @@
{% trans 'Deductions of eco-accounts' %} {% for deduction in deductions %} - + {{deduction.account.identifier}}
diff --git a/intervention/views.py b/intervention/views.py index 7449085d..49b363cf 100644 --- a/intervention/views.py +++ b/intervention/views.py @@ -492,6 +492,11 @@ def report_view(request:HttpRequest, id: str): template = "report/unavailable.html" return render(request, template, {}) + # Prepare data for map viewer + geom_form = SimpleGeomForm( + instance=intervention + ) + distinct_deductions = intervention.deductions.all().distinct( "account" ) @@ -508,6 +513,7 @@ def report_view(request:HttpRequest, id: str): "deductions": distinct_deductions, "qrcode": qrcode_img, "qrcode_lanis": qrcode_img_lanis, + "geom_form": geom_form, } context = BaseContext(request, context).context return render(request, template, context) diff --git a/locale/de/LC_MESSAGES/django.mo b/locale/de/LC_MESSAGES/django.mo index f8927af69bcf373051e08806e7b97fc39b8eef90..8da5e14e205cd793e8e43d657a9746e4b89d5970 100644 GIT binary patch delta 5988 zcmYk=3viBC9>?+XN+JnK5P9?Fl|&*}A#dVNgi1o);(oVgT-q5Ft75xbwd$P~)hbne z*0Q?0Ze43sn26n~R>Q0*x@g_DWT(oyc1ztab=~jpeU6!Zr;pD$=XuUK|MNfRdEZQr zZTH;V?g^fb4_|Khlz5Cu!IXN&Y*jfyt;U>eVoU?-r_iDPL$Wb%;p;p+AH!3P;Xm^Z z|HR{8tvj(U^+Q-6k7Ep;!8p9?wg=543Yj!SHFa;~qvkHghByct;RIX%6*izg9~ zQ3LltO*8_vH4{;(pNR@Qh)V4e+x`*it*Sz8&0*9QoI~~hSsj$ph-^1y0nDdfYU|T+ zAoVvf9FL*`{uY&)GpN9BSi^GMOnNc2C8!0o#_re&BXEvw557r(SK7RTn&2;}j+;<> zSdGfWKHGi-Lx;_J34PqZZSTjhn!41zsPR&)&2TXF9BhZPkTVc8l@vPAumgED%{5HN zxaRI5D@3iZKWgG}s0pW`QaT@%(m$Y5zZJC=U!np(ZtJHpjQSPSS-T#pv;SdvZp4uo z#f>=BL_S;3!bs`?)Yi1e0KR});rplzE=L`@D%3;=QGtAe>VFz_b}ph$|6OdT_utdP zoiHAwsi&d#HqX{OqbBNsT6rJTz!Oj_e;GCK0#xA3QT^AUGFy#$?!Tyhrlp&?I1K8v zXHw9_ZBQxfg4+9`s4t>Pn1pZG`>RlaRAGBOfGoy5MNN=LniNn+RC_N}1}ad8?=@Qw z=Cl9mu#kpO3NiG$pawXM+LF^)A1|Q}*DZ{}2dMs$0k`f&-OoThpNHz--rj!>b!N&@ zXKH+a{A-0XY0!!nV;ZhO&Y{_jf5ywGffp9IseKP)sjo&B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hrFW?VZPW1(S4+yjY&z6zl6O<@{Ml)nP7Ykw@PFZ|jzItb diff --git a/locale/de/LC_MESSAGES/django.po b/locale/de/LC_MESSAGES/django.po index 1e650b8b..391c4d24 100644 --- a/locale/de/LC_MESSAGES/django.po +++ b/locale/de/LC_MESSAGES/django.po @@ -19,7 +19,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-10-13 13:55+0200\n" +"POT-Creation-Date: 2021-10-13 17:26+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -50,13 +50,14 @@ msgstr "Automatisch generiert" #: compensation/templates/compensation/detail/compensation/view.html:31 #: compensation/templates/compensation/detail/eco_account/includes/documents.html:28 #: compensation/templates/compensation/detail/eco_account/view.html:31 +#: compensation/templates/compensation/report/compensation/report.html:12 #: ema/tables.py:33 ema/templates/ema/detail/includes/documents.html:28 #: ema/templates/ema/detail/view.html:24 intervention/forms/forms.py:39 #: 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 -#: intervention/templates/intervention/report/report.html:11 +#: intervention/templates/intervention/report/report.html:12 #: konova/forms.py:336 msgid "Title" msgstr "Bezeichnung" @@ -114,7 +115,7 @@ msgstr "Zusätzlicher Kommentar" #: compensation/templates/compensation/detail/eco_account/view.html:58 #: ema/templates/ema/detail/view.html:42 intervention/forms/forms.py:101 #: intervention/templates/intervention/detail/view.html:56 -#: intervention/templates/intervention/report/report.html:36 +#: intervention/templates/intervention/report/report.html:37 msgid "Conservation office" msgstr "Eintragungsstelle" @@ -126,7 +127,7 @@ msgstr "Verantwortliche Stelle" #: compensation/templates/compensation/detail/eco_account/view.html:62 #: ema/templates/ema/detail/view.html:46 intervention/forms/forms.py:129 #: intervention/templates/intervention/detail/view.html:60 -#: intervention/templates/intervention/report/report.html:40 +#: intervention/templates/intervention/report/report.html:41 msgid "Conservation office file number" msgstr "Aktenzeichen Eintragungsstelle" @@ -148,6 +149,7 @@ msgstr "Firma Mustermann" #: compensation/forms/forms.py:146 #: compensation/templates/compensation/detail/compensation/view.html:35 +#: compensation/templates/compensation/report/compensation/report.html:16 msgid "compensates intervention" msgstr "kompensiert Eingriff" @@ -298,11 +300,11 @@ msgid "Select the action type" msgstr "Maßnahmentyp wählen" #: compensation/forms/modalForms.py:334 -#: compensation/templates/compensation/detail/compensation/includes/actions.html:37 +#: compensation/templates/compensation/detail/compensation/includes/actions.html:38 #: compensation/templates/compensation/detail/compensation/includes/deadlines.html:37 #: compensation/templates/compensation/detail/compensation/includes/documents.html:34 -#: compensation/templates/compensation/detail/compensation/includes/states-after.html:39 -#: compensation/templates/compensation/detail/compensation/includes/states-before.html:39 +#: compensation/templates/compensation/detail/compensation/includes/states-after.html:40 +#: compensation/templates/compensation/detail/compensation/includes/states-before.html:40 #: compensation/templates/compensation/detail/eco_account/includes/actions.html:37 #: compensation/templates/compensation/detail/eco_account/includes/deadlines.html:37 #: compensation/templates/compensation/detail/eco_account/includes/deductions.html:40 @@ -421,7 +423,7 @@ msgstr "Zuletzt bearbeitet" #: compensation/tables.py:62 #: intervention/templates/intervention/detail/includes/compensations.html:8 -#: intervention/templates/intervention/report/report.html:48 +#: intervention/templates/intervention/report/report.html:49 msgid "Compensations" msgstr "Kompensationen" @@ -448,13 +450,13 @@ msgstr "Am {} von {} geprüft worden" #: compensation/templates/compensation/detail/compensation/view.html:60 #: compensation/templates/compensation/detail/eco_account/view.html:47 #: ema/tables.py:101 ema/templates/ema/detail/view.html:31 -#: intervention/models.py:385 intervention/tables.py:131 +#: intervention/models.py:384 intervention/tables.py:131 #: intervention/templates/intervention/detail/view.html:85 msgid "Not recorded yet" msgstr "Noch nicht verzeichnet" #: compensation/tables.py:134 compensation/tables.py:263 ema/tables.py:106 -#: intervention/models.py:390 intervention/tables.py:136 +#: intervention/models.py:389 intervention/tables.py:136 msgid "Recorded on {} by {}" msgstr "Am {} von {} verzeichnet worden" @@ -516,7 +518,7 @@ msgctxt "Compensation" msgid "Amount" msgstr "Menge" -#: compensation/templates/compensation/detail/compensation/includes/actions.html:51 +#: compensation/templates/compensation/detail/compensation/includes/actions.html:53 #: compensation/templates/compensation/detail/eco_account/includes/actions.html:51 #: ema/templates/ema/detail/includes/actions.html:51 msgid "Remove action" @@ -631,8 +633,8 @@ msgstr "Fehlende Flächenmengen laut Ausgangszustand: " msgid "Biotope type" msgstr "Biotoptyp" -#: compensation/templates/compensation/detail/compensation/includes/states-after.html:52 -#: compensation/templates/compensation/detail/compensation/includes/states-before.html:52 +#: compensation/templates/compensation/detail/compensation/includes/states-after.html:54 +#: compensation/templates/compensation/detail/compensation/includes/states-before.html:54 #: compensation/templates/compensation/detail/eco_account/includes/states-after.html:52 #: compensation/templates/compensation/detail/eco_account/includes/states-before.html:52 #: ema/templates/ema/detail/includes/states-after.html:52 @@ -681,6 +683,7 @@ msgstr "Verzeichnet am" #: compensation/templates/compensation/detail/compensation/view.html:71 #: compensation/templates/compensation/detail/eco_account/view.html:70 +#: compensation/templates/compensation/report/compensation/report.html:24 #: ema/templates/ema/detail/view.html:54 msgid "Funded by" msgstr "Gefördert mit" @@ -688,16 +691,17 @@ msgstr "Gefördert mit" #: compensation/templates/compensation/detail/compensation/view.html:79 #: compensation/templates/compensation/detail/eco_account/view.html:78 #: ema/templates/ema/detail/view.html:62 -#: intervention/templates/intervention/report/report.html:56 -#: intervention/templates/intervention/report/report.html:77 +#: intervention/templates/intervention/report/report.html:57 +#: intervention/templates/intervention/report/report.html:78 msgid "None" msgstr "" #: compensation/templates/compensation/detail/compensation/view.html:84 #: compensation/templates/compensation/detail/eco_account/view.html:83 +#: compensation/templates/compensation/report/compensation/report.html:33 #: ema/templates/ema/detail/view.html:67 #: intervention/templates/intervention/detail/view.html:108 -#: intervention/templates/intervention/report/report.html:90 +#: intervention/templates/intervention/report/report.html:91 msgid "Last modified" msgstr "Zuletzt bearbeitet" @@ -770,84 +774,99 @@ msgstr "Fehlt" #: compensation/templates/compensation/detail/eco_account/view.html:66 #: ema/templates/ema/detail/view.html:50 intervention/forms/forms.py:141 #: intervention/templates/intervention/detail/view.html:64 -#: intervention/templates/intervention/report/report.html:44 +#: intervention/templates/intervention/report/report.html:45 msgid "Intervention handler" msgstr "Eingriffsverursacher" -#: compensation/views/compensation_views.py:76 +#: compensation/templates/compensation/report/compensation/report.html:7 +#: intervention/templates/intervention/report/report.html:7 +msgid "Report" +msgstr "Bericht" + +#: compensation/templates/compensation/report/compensation/report.html:54 +#: intervention/templates/intervention/report/report.html:108 +msgid "Open in browser" +msgstr "Im Browser öffnen" + +#: compensation/templates/compensation/report/compensation/report.html:58 +#: intervention/templates/intervention/report/report.html:112 +msgid "View in LANIS" +msgstr "In LANIS öffnen" + +#: compensation/views/compensation_views.py:77 msgid "Compensation {} added" msgstr "Kompensation {} hinzugefügt" -#: compensation/views/compensation_views.py:131 +#: compensation/views/compensation_views.py:132 msgid "Compensation {} edited" msgstr "Kompensation {} bearbeitet" -#: compensation/views/compensation_views.py:210 -#: compensation/views/eco_account_views.py:277 ema/views.py:174 +#: compensation/views/compensation_views.py:211 +#: compensation/views/eco_account_views.py:278 ema/views.py:175 #: intervention/views.py:428 msgid "Log" msgstr "Log" -#: compensation/views/compensation_views.py:231 +#: compensation/views/compensation_views.py:232 msgid "Compensation removed" msgstr "Kompensation entfernt" -#: compensation/views/compensation_views.py:250 -#: compensation/views/eco_account_views.py:376 ema/views.py:327 +#: compensation/views/compensation_views.py:251 +#: compensation/views/eco_account_views.py:377 ema/views.py:328 #: intervention/views.py:124 msgid "Document added" msgstr "Dokument hinzugefügt" -#: compensation/views/compensation_views.py:306 -#: compensation/views/eco_account_views.py:320 ema/views.py:271 +#: compensation/views/compensation_views.py:307 +#: compensation/views/eco_account_views.py:321 ema/views.py:272 msgid "State added" msgstr "Zustand hinzugefügt" -#: compensation/views/compensation_views.py:325 -#: compensation/views/eco_account_views.py:339 ema/views.py:290 +#: compensation/views/compensation_views.py:326 +#: compensation/views/eco_account_views.py:340 ema/views.py:291 msgid "Action added" msgstr "Maßnahme hinzugefügt" -#: compensation/views/compensation_views.py:344 -#: compensation/views/eco_account_views.py:358 ema/views.py:309 +#: compensation/views/compensation_views.py:345 +#: compensation/views/eco_account_views.py:359 ema/views.py:310 msgid "Deadline added" msgstr "Frist/Termin hinzugefügt" -#: compensation/views/compensation_views.py:363 +#: compensation/views/compensation_views.py:364 msgid "State removed" msgstr "Zustand gelöscht" -#: compensation/views/compensation_views.py:382 +#: compensation/views/compensation_views.py:383 msgid "Action removed" msgstr "Maßnahme entfernt" -#: compensation/views/eco_account_views.py:86 +#: compensation/views/eco_account_views.py:87 msgid "Eco-Account {} added" msgstr "Ökokonto {} hinzugefügt" -#: compensation/views/eco_account_views.py:141 +#: compensation/views/eco_account_views.py:142 msgid "Eco-Account {} edited" msgstr "Ökokonto {} bearbeitet" -#: compensation/views/eco_account_views.py:227 +#: compensation/views/eco_account_views.py:228 msgid "Eco-account removed" msgstr "Ökokonto entfernt" -#: compensation/views/eco_account_views.py:254 +#: compensation/views/eco_account_views.py:255 msgid "Deduction removed" msgstr "Abbuchung entfernt" -#: compensation/views/eco_account_views.py:297 ema/views.py:248 +#: compensation/views/eco_account_views.py:298 ema/views.py:249 #: intervention/views.py:468 msgid "{} unrecorded" msgstr "{} entzeichnet" -#: compensation/views/eco_account_views.py:297 ema/views.py:248 +#: compensation/views/eco_account_views.py:298 ema/views.py:249 #: intervention/views.py:468 msgid "{} recorded" msgstr "{} verzeichnet" -#: compensation/views/eco_account_views.py:433 intervention/views.py:450 +#: compensation/views/eco_account_views.py:434 intervention/views.py:450 msgid "Deduction added" msgstr "Abbuchung hinzugefügt" @@ -887,15 +906,15 @@ msgstr "" msgid "Payment funded compensation" msgstr "Ersatzzahlungsmaßnahme" -#: ema/views.py:77 +#: ema/views.py:78 msgid "EMA {} added" msgstr "EMA {} hinzugefügt" -#: ema/views.py:201 +#: ema/views.py:202 msgid "EMA {} edited" msgstr "EMA {} bearbeitet" -#: ema/views.py:231 +#: ema/views.py:232 msgid "EMA removed" msgstr "EMA entfernt" @@ -921,13 +940,13 @@ msgstr "Bauvorhaben XY; Flur ABC" #: intervention/forms/forms.py:51 #: intervention/templates/intervention/detail/view.html:35 -#: intervention/templates/intervention/report/report.html:15 +#: intervention/templates/intervention/report/report.html:16 msgid "Process type" msgstr "Verfahrenstyp" #: intervention/forms/forms.py:68 #: intervention/templates/intervention/detail/view.html:39 -#: intervention/templates/intervention/report/report.html:19 +#: intervention/templates/intervention/report/report.html:20 msgid "Law" msgstr "Gesetz" @@ -937,13 +956,13 @@ msgstr "Mehrfachauswahl möglich" #: intervention/forms/forms.py:85 #: intervention/templates/intervention/detail/view.html:48 -#: intervention/templates/intervention/report/report.html:28 +#: intervention/templates/intervention/report/report.html:29 msgid "Registration office" msgstr "Zulassungsbehörde" #: intervention/forms/forms.py:117 #: intervention/templates/intervention/detail/view.html:52 -#: intervention/templates/intervention/report/report.html:32 +#: intervention/templates/intervention/report/report.html:33 msgid "Registration office file number" msgstr "Aktenzeichen Zulassungsbehörde" @@ -957,13 +976,13 @@ msgstr "Wer führt den Eingriff durch" #: intervention/forms/forms.py:154 #: intervention/templates/intervention/detail/view.html:96 -#: intervention/templates/intervention/report/report.html:82 +#: intervention/templates/intervention/report/report.html:83 msgid "Registration date" msgstr "Datum Zulassung bzw. Satzungsbeschluss" #: intervention/forms/forms.py:166 #: intervention/templates/intervention/detail/view.html:100 -#: intervention/templates/intervention/report/report.html:86 +#: intervention/templates/intervention/report/report.html:87 msgid "Binding on" msgstr "Datum Bestandskraft" @@ -1074,31 +1093,31 @@ msgstr "" "Das Ökokonto {} hat für eine Abbuchung von {} m² nicht ausreichend " "Restfläche. Es stehen noch {} m² zur Verfügung." -#: intervention/models.py:325 +#: intervention/models.py:324 msgid "Registration office file number missing" msgstr "Aktenzeichen Zulassungsbehörde fehlt" -#: intervention/models.py:328 +#: intervention/models.py:327 msgid "Conservation office file number missing" msgstr "Aktenzeichen Naturschutzbehörde fehlt" -#: intervention/models.py:331 +#: intervention/models.py:330 msgid "Responsible data missing" msgstr "Daten zu Verantwortlichen fehlen" -#: intervention/models.py:345 +#: intervention/models.py:344 msgid "Revocation exists" msgstr "Widerspruch liegt vor" -#: intervention/models.py:348 +#: intervention/models.py:347 msgid "Registration date missing" msgstr "Datum Zulassung bzw. Satzungsbeschluss fehlt" -#: intervention/models.py:351 +#: intervention/models.py:350 msgid "Binding on missing" msgstr "Datum Bestandskraft fehlt" -#: intervention/models.py:353 +#: intervention/models.py:352 msgid "Legal data missing" msgstr "Rechtliche Daten fehlen" @@ -1142,7 +1161,7 @@ msgid "Eco-account not recorded! Deduction invalid!" msgstr "Ökokonto nicht verzeichnet! Abbuchung ungültig!" #: intervention/templates/intervention/detail/includes/payments.html:8 -#: intervention/templates/intervention/report/report.html:72 +#: intervention/templates/intervention/report/report.html:73 msgid "Payments" msgstr "Ersatzzahlungen" @@ -1172,38 +1191,14 @@ msgstr "Widerspruch entfernen" msgid "Exists" msgstr "vorhanden" -#: intervention/templates/intervention/report/report.html:61 +#: intervention/templates/intervention/report/report.html:62 msgid "Deductions of eco-accounts" msgstr "Abbuchungen von Ökokonten" -#: intervention/templates/intervention/report/report.html:75 +#: intervention/templates/intervention/report/report.html:76 msgid "Exist" msgstr "Vorhanden" -#: intervention/templates/intervention/report/report.html:107 -msgid "Open in browser" -msgstr "Im Browser öffnen" - -#: intervention/templates/intervention/report/report.html:111 -msgid "View in LANIS" -msgstr "In LANIS öffnen" - -#: intervention/templates/intervention/report/unavailable.html:6 -msgid "Unrecorded data" -msgstr "Daten nicht veröffentlicht" - -#: intervention/templates/intervention/report/unavailable.html:9 -msgid "" -"\n" -" The data you want to see is not recorded and might still be work " -"in progress. Please come back another time.\n" -" " -msgstr "" -"\n" -" Die Daten, die Sie einsehen möchten, sind in Bearbeitung und daher aktuell nicht öffentlich einsehbar. " -"Schauen Sie zu einem späteren Zeitpunkt wieder vorbei. \n" -" " - #: intervention/views.py:77 msgid "Intervention {} added" msgstr "Eingriff {} hinzugefügt" @@ -1624,6 +1619,23 @@ msgstr "Einstellungen" msgid "Logout" msgstr "Abmelden" +#: templates/report/unavailable.html:6 +msgid "Unrecorded data" +msgstr "Daten nicht veröffentlicht" + +#: templates/report/unavailable.html:9 +msgid "" +"\n" +" The data you want to see is not recorded and might still be work " +"in progress. Please come back another time.\n" +" " +msgstr "" +"\n" +" Die Daten, die Sie einsehen möchten, sind in Bearbeitung und " +"daher aktuell nicht öffentlich einsehbar. Schauen Sie zu einem späteren " +"Zeitpunkt wieder vorbei. \n" +" " + #: user/forms.py:23 msgid "Notifications" msgstr "Benachrichtigungen" From ce74d011f6884d8b0a8ff0a721e3f430b1a2f916 Mon Sep 17 00:00:00 2001 From: mpeltriaux Date: Thu, 14 Oct 2021 08:21:51 +0200 Subject: [PATCH 5/8] #25 Public reports * prevents Actions column in tables from being rendered if there would be no buttons inside due to permission checking * enhances amount of sql requests for detail view and report view --- .../detail/compensation/includes/actions.html | 4 ++-- .../detail/compensation/includes/deadlines.html | 8 +++++--- .../detail/compensation/includes/documents.html | 8 +++++--- .../detail/compensation/includes/states-before.html | 2 +- .../compensation/report/compensation/report.html | 6 +++++- compensation/views/compensation_views.py | 13 +++++++++---- .../intervention/detail/includes/compensations.html | 8 +++++--- .../intervention/detail/includes/deductions.html | 8 +++++--- .../intervention/detail/includes/documents.html | 8 +++++--- .../intervention/detail/includes/payments.html | 8 +++++--- .../intervention/detail/includes/revocation.html | 8 +++++--- 11 files changed, 52 insertions(+), 29 deletions(-) diff --git a/compensation/templates/compensation/detail/compensation/includes/actions.html b/compensation/templates/compensation/detail/compensation/includes/actions.html index a1c77f21..08930a9c 100644 --- a/compensation/templates/compensation/detail/compensation/includes/actions.html +++ b/compensation/templates/compensation/detail/compensation/includes/actions.html @@ -4,7 +4,7 @@
- {{obj.actions.count}} + {{actions.count}} {% trans 'Actions' context 'Compensation' %}
@@ -41,7 +41,7 @@
{{ action.action_type }} diff --git a/compensation/templates/compensation/detail/compensation/includes/deadlines.html b/compensation/templates/compensation/detail/compensation/includes/deadlines.html index 206bd7d3..4ca109f7 100644 --- a/compensation/templates/compensation/detail/compensation/includes/deadlines.html +++ b/compensation/templates/compensation/detail/compensation/includes/deadlines.html @@ -33,9 +33,11 @@ {% trans 'Comment' %} - {% trans 'Action' %} - + {% trans 'Action' %} +
{% trans 'Comment' %} - {% trans 'Action' %} - + {% trans 'Action' %} +
{% trans 'Funded by' %} - {% for funding in obj.fundings.all %} + {% with obj.fundings.all as fundings %} + {% for funding in fundings %}
{{funding.short_name}}

+ {% empty %} + {% trans 'None' %} {% endfor %} + {% endwith %}
{% trans 'Title' %} - {% trans 'Action' %} - + {% trans 'Action' %} +
{% trans 'Created' %} - {% trans 'Action' %} - + {% trans 'Action' %} +
{% trans 'Comment' %} - {% trans 'Action' %} - + {% trans 'Action' %} +
{% trans 'Comment' %} - {% trans 'Action' %} - + {% trans 'Action' %} +
{% trans 'Comment' %} - {% trans 'Action' %} - + {% trans 'Action' %} +
{{obj.responsible.conservation_file_number|default_if_none:""}}
{% trans 'Intervention handler' %}{% trans 'Action handler' %} {{obj.responsible.handler|default_if_none:""}}
{{obj.responsible.conservation_file_number|default_if_none:""}}
{% trans 'Intervention handler' %}{% trans 'Action handler' %} {{obj.responsible.handler|default_if_none:""}}
+ + + + + + + + + + + + + + + + + + + + + + + + +
{% trans 'Title' %}{{obj.title|default_if_none:""}}
{% trans 'Conservation office' %}{{obj.responsible.conservation_office.str_as_office|default_if_none:""}}
{% trans 'Conservation office file number' %}{{obj.responsible.conservation_file_number|default_if_none:""}}
{% trans 'Action handler' %}{{obj.responsible.handler|default_if_none:""}}
{% trans 'Funded by' %} + {% with obj.fundings.all as fundings %} + {% for funding in fundings %} +
{{funding.short_name}}
+
+ {% empty %} + {% trans 'None' %} + {% endfor %} + {% endwith %} +
{% trans 'Last modified' %} + {{obj.modified.timestamp|default_if_none:""|naturalday}} +
+
+ + {% include 'compensation/detail/compensation/includes/states-before.html' %} + {% include 'compensation/detail/compensation/includes/states-after.html' %} + {% include 'compensation/detail/compensation/includes/actions.html' %} +
+
+
+ {% include 'map/geom_form.html' %} +
+
+ {% include 'intervention/detail/includes/comment.html' %} +
+
+
+

{% trans 'Open in browser' %}

+ {{ qrcode|safe }} +
+
+

{% trans 'View in LANIS' %}

+ {{ qrcode_lanis|safe }} +
+
+ +
+
+ +{% endblock %} \ No newline at end of file diff --git a/ema/views.py b/ema/views.py index 5fd9372a..ead1a899 100644 --- a/ema/views.py +++ b/ema/views.py @@ -412,7 +412,7 @@ def report_view(request:HttpRequest, id: str): """ # Reuse the compensation report template since EMAs are structurally identical - template = "compensation/report/report.html" + template = "ema/report/report.html" ema = get_object_or_404(Ema, id=id) # If intervention is not recorded (yet or currently) we need to render another template without any data @@ -420,6 +420,10 @@ def report_view(request:HttpRequest, id: str): template = "report/unavailable.html" return render(request, template, {}) + # Prepare data for map viewer + geom_form = SimpleGeomForm( + instance=ema + ) qrcode_img = generate_qr_code( request.build_absolute_uri(reverse("ema:report", args=(id,))), 10 @@ -428,10 +432,20 @@ def report_view(request:HttpRequest, id: str): ema.get_LANIS_link(), 7 ) + # Order states by surface + before_states = ema.before_states.all().order_by("-surface").prefetch_related("biotope_type") + after_states = ema.after_states.all().order_by("-surface").prefetch_related("biotope_type") + actions = ema.actions.all().prefetch_related("action_type") + context = { "obj": ema, "qrcode": qrcode_img, "qrcode_lanis": qrcode_img_lanis, + "has_access": False, # disables action buttons during rendering + "before_states": before_states, + "after_states": after_states, + "geom_form": geom_form, + "actions": actions, } context = BaseContext(request, context).context return render(request, template, context) \ No newline at end of file diff --git a/locale/de/LC_MESSAGES/django.mo b/locale/de/LC_MESSAGES/django.mo index 8da5e14e205cd793e8e43d657a9746e4b89d5970..348a808d988e5289faef8d59491fb3dd9e5230e5 100644 GIT binary patch delta 6959 z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T`;6Eq&}*RxUQ`(q;9=zw|WigL9Tcdv?fi*`A^UiW2on#GE#)PhyXcKIR9#h+1cN84ZdySP8;!))r9TjUwWN-v0tSaS3@C7h|0$3;pceuko;zr(sJ%J6%T} z*Yk7F{hnx|1`fT}hlmA)eqGh$nn&<$qW1WOLb7LrwZd;{IAv#_#&?NyB8qeMiL;b< z64xHbt@2kqK-2HbZu}3lA@Wt{&>PW*7)`49EBaOC)Xwd6)lqj^5L-Efbn5q}}RCSD?r5DyX)h*d<8`wEF`kM&gYt?gyX-w;cP9mEVmM`--cTvUfj z7CsYdCQX#P+s)C|HUx8sn~6t>6+{*B4)G77fa|Lj?TOooQG|Yaw;|S0*6{&Rk2prOqx~}09{;7lhca|@ z;NJ)I{Ie)@A@&eI5sBPX7ym${5jwUIuMF{Cw37(6FQpu zgg)b8R^D5?{&lRAt9If?j36?IzCM=c$9xKHi3~2%andLBHz3Z+pPJ>^mg|a%53Q}2`8&LUh~?Z( z_&L#(^4~EU-@{D3{|OZSP1GL!DTH&uQ&>SHQ7$5Mbi!tS@&EtMp>&$i|D?(#vWYC} sV~HHfwZ|C>F+>;I{)qdD)&aKa6$&FOPBd*5R?)Eep45u3i?=ubAHP<*Gynhq diff --git a/locale/de/LC_MESSAGES/django.po b/locale/de/LC_MESSAGES/django.po index 391c4d24..ab0ecbbd 100644 --- a/locale/de/LC_MESSAGES/django.po +++ b/locale/de/LC_MESSAGES/django.po @@ -19,7 +19,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-10-13 17:26+0200\n" +"POT-Creation-Date: 2021-10-14 08:46+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -52,7 +52,8 @@ msgstr "Automatisch generiert" #: compensation/templates/compensation/detail/eco_account/view.html:31 #: compensation/templates/compensation/report/compensation/report.html:12 #: ema/tables.py:33 ema/templates/ema/detail/includes/documents.html:28 -#: ema/templates/ema/detail/view.html:24 intervention/forms/forms.py:39 +#: ema/templates/ema/detail/view.html:24 +#: ema/templates/ema/report/report.html:12 intervention/forms/forms.py:39 #: intervention/tables.py:28 #: intervention/templates/intervention/detail/includes/compensations.html:33 #: intervention/templates/intervention/detail/includes/documents.html:28 @@ -113,7 +114,8 @@ msgstr "Zusätzlicher Kommentar" #: compensation/forms/forms.py:93 #: compensation/templates/compensation/detail/eco_account/view.html:58 -#: ema/templates/ema/detail/view.html:42 intervention/forms/forms.py:101 +#: ema/templates/ema/detail/view.html:42 +#: ema/templates/ema/report/report.html:29 intervention/forms/forms.py:101 #: intervention/templates/intervention/detail/view.html:56 #: intervention/templates/intervention/report/report.html:37 msgid "Conservation office" @@ -125,7 +127,8 @@ msgstr "Verantwortliche Stelle" #: compensation/forms/forms.py:109 #: compensation/templates/compensation/detail/eco_account/view.html:62 -#: ema/templates/ema/detail/view.html:46 intervention/forms/forms.py:129 +#: ema/templates/ema/detail/view.html:46 +#: ema/templates/ema/report/report.html:33 intervention/forms/forms.py:129 #: intervention/templates/intervention/detail/view.html:60 #: intervention/templates/intervention/report/report.html:41 msgid "Conservation office file number" @@ -301,8 +304,8 @@ msgstr "Maßnahmentyp wählen" #: compensation/forms/modalForms.py:334 #: compensation/templates/compensation/detail/compensation/includes/actions.html:38 -#: compensation/templates/compensation/detail/compensation/includes/deadlines.html:37 -#: compensation/templates/compensation/detail/compensation/includes/documents.html:34 +#: compensation/templates/compensation/detail/compensation/includes/deadlines.html:38 +#: compensation/templates/compensation/detail/compensation/includes/documents.html:35 #: compensation/templates/compensation/detail/compensation/includes/states-after.html:40 #: compensation/templates/compensation/detail/compensation/includes/states-before.html:40 #: compensation/templates/compensation/detail/eco_account/includes/actions.html:37 @@ -316,11 +319,11 @@ msgstr "Maßnahmentyp wählen" #: ema/templates/ema/detail/includes/documents.html:34 #: ema/templates/ema/detail/includes/states-after.html:39 #: ema/templates/ema/detail/includes/states-before.html:39 -#: intervention/templates/intervention/detail/includes/compensations.html:36 -#: intervention/templates/intervention/detail/includes/deductions.html:37 -#: 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/compensations.html:37 +#: intervention/templates/intervention/detail/includes/deductions.html:38 +#: intervention/templates/intervention/detail/includes/documents.html:35 +#: intervention/templates/intervention/detail/includes/payments.html:38 +#: intervention/templates/intervention/detail/includes/revocation.html:42 #: templates/log.html:10 msgid "Action" msgstr "Aktionen" @@ -578,7 +581,7 @@ msgstr "Frist/Termin hinzufügen" msgid "Type" msgstr "Typ" -#: compensation/templates/compensation/detail/compensation/includes/deadlines.html:51 +#: compensation/templates/compensation/detail/compensation/includes/deadlines.html:53 #: compensation/templates/compensation/detail/eco_account/includes/deadlines.html:51 #: ema/templates/ema/detail/includes/deadlines.html:51 msgid "Remove deadline" @@ -599,10 +602,10 @@ msgstr "Dokumente" msgid "Add new document" msgstr "Neues Dokument hinzufügen" -#: compensation/templates/compensation/detail/compensation/includes/documents.html:49 +#: compensation/templates/compensation/detail/compensation/includes/documents.html:51 #: compensation/templates/compensation/detail/eco_account/includes/documents.html:49 #: ema/templates/ema/detail/includes/documents.html:49 -#: intervention/templates/intervention/detail/includes/documents.html:49 +#: intervention/templates/intervention/detail/includes/documents.html:51 msgid "Remove document" msgstr "Dokument löschen" @@ -685,12 +688,15 @@ msgstr "Verzeichnet am" #: compensation/templates/compensation/detail/eco_account/view.html:70 #: compensation/templates/compensation/report/compensation/report.html:24 #: ema/templates/ema/detail/view.html:54 +#: ema/templates/ema/report/report.html:16 msgid "Funded by" msgstr "Gefördert mit" #: compensation/templates/compensation/detail/compensation/view.html:79 #: compensation/templates/compensation/detail/eco_account/view.html:78 +#: compensation/templates/compensation/report/compensation/report.html:31 #: ema/templates/ema/detail/view.html:62 +#: ema/templates/ema/report/report.html:23 #: intervention/templates/intervention/report/report.html:57 #: intervention/templates/intervention/report/report.html:78 msgid "None" @@ -698,8 +704,9 @@ msgstr "" #: compensation/templates/compensation/detail/compensation/view.html:84 #: compensation/templates/compensation/detail/eco_account/view.html:83 -#: compensation/templates/compensation/report/compensation/report.html:33 +#: compensation/templates/compensation/report/compensation/report.html:37 #: ema/templates/ema/detail/view.html:67 +#: ema/templates/ema/report/report.html:41 #: intervention/templates/intervention/detail/view.html:108 #: intervention/templates/intervention/report/report.html:91 msgid "Last modified" @@ -745,7 +752,7 @@ msgid "Created" msgstr "Erstellt" #: compensation/templates/compensation/detail/eco_account/includes/deductions.html:63 -#: intervention/templates/intervention/detail/includes/deductions.html:56 +#: intervention/templates/intervention/detail/includes/deductions.html:58 msgid "Remove Deduction" msgstr "Abbuchung entfernen" @@ -772,23 +779,23 @@ msgid "Missing" msgstr "Fehlt" #: compensation/templates/compensation/detail/eco_account/view.html:66 -#: ema/templates/ema/detail/view.html:50 intervention/forms/forms.py:141 -#: intervention/templates/intervention/detail/view.html:64 -#: intervention/templates/intervention/report/report.html:45 -msgid "Intervention handler" -msgstr "Eingriffsverursacher" +msgid "Action handler" +msgstr "Maßnahmenträger" #: compensation/templates/compensation/report/compensation/report.html:7 +#: ema/templates/ema/report/report.html:7 #: intervention/templates/intervention/report/report.html:7 msgid "Report" msgstr "Bericht" -#: compensation/templates/compensation/report/compensation/report.html:54 +#: compensation/templates/compensation/report/compensation/report.html:58 +#: ema/templates/ema/report/report.html:62 #: intervention/templates/intervention/report/report.html:108 msgid "Open in browser" msgstr "Im Browser öffnen" -#: compensation/templates/compensation/report/compensation/report.html:58 +#: compensation/templates/compensation/report/compensation/report.html:62 +#: ema/templates/ema/report/report.html:66 #: intervention/templates/intervention/report/report.html:112 msgid "View in LANIS" msgstr "In LANIS öffnen" @@ -801,42 +808,42 @@ msgstr "Kompensation {} hinzugefügt" msgid "Compensation {} edited" msgstr "Kompensation {} bearbeitet" -#: compensation/views/compensation_views.py:211 +#: compensation/views/compensation_views.py:213 #: compensation/views/eco_account_views.py:278 ema/views.py:175 #: intervention/views.py:428 msgid "Log" msgstr "Log" -#: compensation/views/compensation_views.py:232 +#: compensation/views/compensation_views.py:234 msgid "Compensation removed" msgstr "Kompensation entfernt" -#: compensation/views/compensation_views.py:251 +#: compensation/views/compensation_views.py:253 #: compensation/views/eco_account_views.py:377 ema/views.py:328 #: intervention/views.py:124 msgid "Document added" msgstr "Dokument hinzugefügt" -#: compensation/views/compensation_views.py:307 +#: compensation/views/compensation_views.py:309 #: compensation/views/eco_account_views.py:321 ema/views.py:272 msgid "State added" msgstr "Zustand hinzugefügt" -#: compensation/views/compensation_views.py:326 +#: compensation/views/compensation_views.py:328 #: compensation/views/eco_account_views.py:340 ema/views.py:291 msgid "Action added" msgstr "Maßnahme hinzugefügt" -#: compensation/views/compensation_views.py:345 +#: compensation/views/compensation_views.py:347 #: compensation/views/eco_account_views.py:359 ema/views.py:310 msgid "Deadline added" msgstr "Frist/Termin hinzugefügt" -#: compensation/views/compensation_views.py:364 +#: compensation/views/compensation_views.py:366 msgid "State removed" msgstr "Zustand gelöscht" -#: compensation/views/compensation_views.py:383 +#: compensation/views/compensation_views.py:385 msgid "Action removed" msgstr "Maßnahme entfernt" @@ -906,6 +913,13 @@ msgstr "" msgid "Payment funded compensation" msgstr "Ersatzzahlungsmaßnahme" +#: ema/templates/ema/detail/view.html:50 +#: ema/templates/ema/report/report.html:37 intervention/forms/forms.py:141 +#: intervention/templates/intervention/detail/view.html:64 +#: intervention/templates/intervention/report/report.html:45 +msgid "Intervention handler" +msgstr "Eingriffsverursacher" + #: ema/views.py:78 msgid "EMA {} added" msgstr "EMA {} hinzugefügt" @@ -1123,7 +1137,7 @@ msgstr "Rechtliche Daten fehlen" #: intervention/tables.py:45 #: intervention/templates/intervention/detail/includes/revocation.html:8 -#: intervention/templates/intervention/detail/includes/revocation.html:55 +#: intervention/templates/intervention/detail/includes/revocation.html:57 #: intervention/templates/intervention/detail/view.html:104 msgid "Revocation" msgstr "Widerspruch" @@ -1144,7 +1158,7 @@ msgstr "Widerspruch vom {}, am {} von {} hinzugefügt" msgid "Add new compensation" msgstr "Neue Kompensation hinzufügen" -#: intervention/templates/intervention/detail/includes/compensations.html:51 +#: intervention/templates/intervention/detail/includes/compensations.html:53 msgid "Remove compensation" msgstr "Kompensation entfernen" @@ -1152,11 +1166,11 @@ msgstr "Kompensation entfernen" msgid "Account Identifier" msgstr "Ökokonto Kennung" -#: intervention/templates/intervention/detail/includes/deductions.html:43 +#: intervention/templates/intervention/detail/includes/deductions.html:45 msgid "Eco-account deleted! Deduction invalid!" msgstr "Ökokonto gelöscht! Abbuchung ungültig!" -#: intervention/templates/intervention/detail/includes/deductions.html:43 +#: intervention/templates/intervention/detail/includes/deductions.html:45 msgid "Eco-account not recorded! Deduction invalid!" msgstr "Ökokonto nicht verzeichnet! Abbuchung ungültig!" @@ -1174,7 +1188,7 @@ msgctxt "money" msgid "Amount" msgstr "Betrag" -#: intervention/templates/intervention/detail/includes/payments.html:51 +#: intervention/templates/intervention/detail/includes/payments.html:53 msgid "Remove payment" msgstr "Zahlung entfernen" @@ -1183,7 +1197,7 @@ msgctxt "Revocation" msgid "From" msgstr "Vom" -#: intervention/templates/intervention/detail/includes/revocation.html:62 +#: intervention/templates/intervention/detail/includes/revocation.html:64 msgid "Remove revocation" msgstr "Widerspruch entfernen" From 85759a636a0862ec485d5d6aa456ed428a0beef5 Mon Sep 17 00:00:00 2001 From: mpeltriaux Date: Thu, 14 Oct 2021 14:12:33 +0200 Subject: [PATCH 7/8] Database performance * optimizes the db fetching for all index views and detail views * introduces usage of managers.py in all necessary apps for wrapping basic fetch settings * moves comment.html to comment_card.html under /konova/templates/konova/ * adds/updates translations * fixes document typos * drops comment rendering in public reports * opens public reports in new tabs if button is clicked from the detail view --- compensation/managers.py | 73 +++++++++++++++ compensation/models.py | 12 +++ compensation/tables.py | 16 ++-- .../compensation/includes/controls.html | 2 +- .../detail/compensation/view.html | 2 +- .../detail/eco_account/includes/actions.html | 12 +-- .../detail/eco_account/includes/comment.html | 23 ----- .../detail/eco_account/includes/controls.html | 2 +- .../eco_account/includes/deductions.html | 4 +- .../eco_account/includes/states-after.html | 4 +- .../eco_account/includes/states-before.html | 4 +- .../compensation/detail/eco_account/view.html | 2 +- .../report/compensation/report.html | 3 - .../report/eco_account/report.html | 84 ++++++++++++++++++ compensation/views/eco_account_views.py | 44 +++++++-- ema/managers.py | 21 +++++ ema/models.py | 3 + ema/tables.py | 4 +- .../ema/detail/includes/controls.html | 2 +- ema/templates/ema/report/report.html | 3 - intervention/managers.py | 48 ++++++++++ intervention/models.py | 19 ++-- intervention/tables.py | 6 +- .../intervention/detail/includes/comment.html | 23 ----- .../detail/includes/controls.html | 2 +- .../templates/intervention/detail/view.html | 2 +- .../templates/intervention/report/report.html | 3 - intervention/views.py | 11 ++- konova/models.py | 2 +- .../templates/konova/comment_card.html | 5 ++ locale/de/LC_MESSAGES/django.mo | Bin 23203 -> 23251 bytes locale/de/LC_MESSAGES/django.po | 45 ++++++---- 32 files changed, 364 insertions(+), 122 deletions(-) create mode 100644 compensation/managers.py delete mode 100644 compensation/templates/compensation/detail/eco_account/includes/comment.html create mode 100644 compensation/templates/compensation/report/eco_account/report.html create mode 100644 ema/managers.py create mode 100644 intervention/managers.py delete mode 100644 intervention/templates/intervention/detail/includes/comment.html rename compensation/templates/compensation/detail/compensation/includes/comment.html => konova/templates/konova/comment_card.html (81%) diff --git a/compensation/managers.py b/compensation/managers.py new file mode 100644 index 00000000..c97cd518 --- /dev/null +++ b/compensation/managers.py @@ -0,0 +1,73 @@ +""" +Author: Michel Peltriaux +Organization: Struktur- und Genehmigungsdirektion Nord, Rhineland-Palatinate, Germany +Contact: michel.peltriaux@sgdnord.rlp.de +Created on: 14.10.21 + +""" +from django.db import models + + +class CompensationActionManager(models.Manager): + """ Holds default db fetch setting for this model type + + """ + def get_queryset(self): + return super().get_queryset().select_related( + "action_type", + "action_type__parent" + ) + + +class CompensationStateManager(models.Manager): + """ Holds default db fetch setting for this model type + + """ + def get_queryset(self): + return super().get_queryset().select_related( + "biotope_type", + "biotope_type__parent" + ) + + +class CompensationManager(models.Manager): + """ Holds default db fetch setting for this model type + + """ + def get_queryset(self): + return super().get_queryset().select_related( + "modified", + "intervention", + "intervention__recorded", + "intervention__recorded__user", + "intervention__modified", + "intervention__checked", + "intervention__checked__user", + ) + + +class EcoAccountManager(models.Manager): + """ Holds default db fetch setting for this model type + + """ + def get_queryset(self): + return super().get_queryset().select_related( + "recorded", + "recorded__user", + "modified", + "modified__user", + ).prefetch_related( + "users", + ) + + +class EcoAccountDeductionManager(models.Manager): + """ Holds default db fetch setting for this model type + + """ + def get_queryset(self): + return super().get_queryset().select_related( + "intervention", + "intervention__recorded", + "created", + ) \ No newline at end of file diff --git a/compensation/models.py b/compensation/models.py index 850ff7e5..4f9cc919 100644 --- a/compensation/models.py +++ b/compensation/models.py @@ -17,6 +17,8 @@ from django.utils.translation import gettext_lazy as _ from codelist.models import KonovaCode from codelist.settings import CODELIST_COMPENSATION_ACTION_ID, CODELIST_BIOTOPES_ID, \ CODELIST_COMPENSATION_FUNDING_ID +from compensation.managers import CompensationStateManager, EcoAccountDeductionManager, CompensationActionManager, \ + EcoAccountManager, CompensationManager from intervention.models import Intervention, ResponsibilityData from konova.models import BaseObject, BaseResource, Geometry, UuidModel, AbstractDocument, \ generate_document_file_upload_path @@ -67,6 +69,8 @@ class CompensationState(UuidModel): ) surface = models.FloatField() + objects = CompensationStateManager() + def __str__(self): return "{} | {} m²".format(self.biotope_type, self.surface) @@ -102,6 +106,8 @@ class CompensationAction(BaseResource): unit = models.CharField(max_length=100, null=True, blank=True, choices=UnitChoices.choices) comment = models.TextField(blank=True, null=True, help_text="Additional comment") + objects = CompensationActionManager() + def __str__(self): return "{} | {} {}".format(self.action_type, self.amount, self.unit) @@ -178,6 +184,8 @@ class Compensation(AbstractCompensation): related_name='compensations' ) + objects = CompensationManager() + def __str__(self): return "{}".format(self.identifier) @@ -301,6 +309,8 @@ class EcoAccount(AbstractCompensation): default=0, ) + objects = EcoAccountManager() + def __str__(self): return "{}".format(self.identifier) @@ -500,5 +510,7 @@ class EcoAccountDeduction(BaseResource): related_name="deductions", ) + objects = EcoAccountDeductionManager() + def __str__(self): return "{} of {}".format(self.surface, self.account) diff --git a/compensation/tables.py b/compensation/tables.py index 278db13d..df7ec3eb 100644 --- a/compensation/tables.py +++ b/compensation/tables.py @@ -148,14 +148,13 @@ class CompensationTable(BaseTable): Returns: """ - html = "" if value is None: value = User.objects.none() has_access = value.filter( - username=self.user.username + id=self.user.id ).exists() - html += self.render_icn( + html = self.render_icn( tooltip=_("Full access granted") if has_access else _("Access not granted"), icn_class="fas fa-edit rlp-r-inv" if has_access else "far fa-edit", ) @@ -244,7 +243,7 @@ class EcoAccountTable(BaseTable): return format_html(html) def render_r(self, value, record: EcoAccount): - """ Renders the registered column for an eco account + """ Renders the recorded column for an eco account Args: value (str): The identifier value @@ -268,7 +267,7 @@ class EcoAccountTable(BaseTable): return format_html(html) def render_e(self, value, record: EcoAccount): - """ Renders the registered column for an eco account + """ Renders the editable column for an eco account Args: value (str): The identifier value @@ -278,10 +277,9 @@ class EcoAccountTable(BaseTable): """ html = "" - has_access = value.filter( - username=self.user.username - ).exists() - + # Do not use value in here, since value does use unprefetched 'users' manager, where record has already + # prefetched users data + has_access = self.user in record.users.all() html += self.render_icn( tooltip=_("Full access granted") if has_access else _("Access not granted"), icn_class="fas fa-edit rlp-r-inv" if has_access else "far fa-edit", diff --git a/compensation/templates/compensation/detail/compensation/includes/controls.html b/compensation/templates/compensation/detail/compensation/includes/controls.html index a9c68c29..5be0b3e8 100644 --- a/compensation/templates/compensation/detail/compensation/includes/controls.html +++ b/compensation/templates/compensation/detail/compensation/includes/controls.html @@ -6,7 +6,7 @@ LANIS
- + diff --git a/compensation/templates/compensation/detail/compensation/view.html b/compensation/templates/compensation/detail/compensation/view.html index 80b70613..35d45046 100644 --- a/compensation/templates/compensation/detail/compensation/view.html +++ b/compensation/templates/compensation/detail/compensation/view.html @@ -103,7 +103,7 @@ {% include 'map/geom_form.html' %}
- {% include 'compensation/detail/compensation/includes/comment.html' %} + {% include 'konova/comment_card.html' %}
diff --git a/compensation/templates/compensation/detail/eco_account/includes/actions.html b/compensation/templates/compensation/detail/eco_account/includes/actions.html index 23b3f069..868242a5 100644 --- a/compensation/templates/compensation/detail/eco_account/includes/actions.html +++ b/compensation/templates/compensation/detail/eco_account/includes/actions.html @@ -4,7 +4,7 @@
- {{obj.actions.count}} + {{actions.count}} {% trans 'Actions' context 'Compensation' %}
@@ -33,13 +33,15 @@ {% trans 'Comment' %} - - {% trans 'Action' %} - + {% if default_member and has_access %} + + {% trans 'Action' %} + + {% endif %} - {% for action in obj.actions.all %} + {% for action in actions %} {{ action.action_type }} diff --git a/compensation/templates/compensation/detail/eco_account/includes/comment.html b/compensation/templates/compensation/detail/eco_account/includes/comment.html deleted file mode 100644 index aff3dec8..00000000 --- a/compensation/templates/compensation/detail/eco_account/includes/comment.html +++ /dev/null @@ -1,23 +0,0 @@ -{% load i18n fontawesome_5 %} - -{% if obj.comment %} -
-
-
-
-
-
- {% fa5_icon 'info-circle' %} - {% trans 'Comment' %} -
-
-
-
-
-
- {{obj.comment}} -
-
-
-
-{% endif %} \ No newline at end of file diff --git a/compensation/templates/compensation/detail/eco_account/includes/controls.html b/compensation/templates/compensation/detail/eco_account/includes/controls.html index dca0823f..5aa9620e 100644 --- a/compensation/templates/compensation/detail/eco_account/includes/controls.html +++ b/compensation/templates/compensation/detail/eco_account/includes/controls.html @@ -6,7 +6,7 @@ LANIS
- + diff --git a/compensation/templates/compensation/detail/eco_account/includes/deductions.html b/compensation/templates/compensation/detail/eco_account/includes/deductions.html index 94d31da0..b35cef1e 100644 --- a/compensation/templates/compensation/detail/eco_account/includes/deductions.html +++ b/compensation/templates/compensation/detail/eco_account/includes/deductions.html @@ -51,9 +51,9 @@ {% if deduction.intervention.recorded %} - + {% else %} - + {% endif %} {{ deduction.surface|floatformat:2|intcomma }} m² diff --git a/compensation/templates/compensation/detail/eco_account/includes/states-after.html b/compensation/templates/compensation/detail/eco_account/includes/states-after.html index da88db0e..bd71e25a 100644 --- a/compensation/templates/compensation/detail/eco_account/includes/states-after.html +++ b/compensation/templates/compensation/detail/eco_account/includes/states-after.html @@ -4,7 +4,7 @@
- {{obj.after_states.count}} + {{after_states.count}} {% trans 'States after' %}
@@ -35,9 +35,11 @@ {% trans 'Surface' %} + {% if is_default_member and has_access %} {% trans 'Action' %} + {% endif %} diff --git a/compensation/templates/compensation/detail/eco_account/includes/states-before.html b/compensation/templates/compensation/detail/eco_account/includes/states-before.html index 33591509..8acb4865 100644 --- a/compensation/templates/compensation/detail/eco_account/includes/states-before.html +++ b/compensation/templates/compensation/detail/eco_account/includes/states-before.html @@ -4,7 +4,7 @@
- {{obj.before_states.count}} + {{before_states.count}} {% trans 'States before' %}
@@ -35,9 +35,11 @@ {% trans 'Surface' %} + {% if is_default_member and has_access %} {% trans 'Action' %} + {% endif %} diff --git a/compensation/templates/compensation/detail/eco_account/view.html b/compensation/templates/compensation/detail/eco_account/view.html index 429c4f4d..e839e6e9 100644 --- a/compensation/templates/compensation/detail/eco_account/view.html +++ b/compensation/templates/compensation/detail/eco_account/view.html @@ -102,7 +102,7 @@ {% include 'map/geom_form.html' %}
- {% include 'compensation/detail/compensation/includes/comment.html' %} + {% include 'konova/comment_card.html' %}
diff --git a/compensation/templates/compensation/report/compensation/report.html b/compensation/templates/compensation/report/compensation/report.html index de8ddd15..956c0094 100644 --- a/compensation/templates/compensation/report/compensation/report.html +++ b/compensation/templates/compensation/report/compensation/report.html @@ -50,9 +50,6 @@
{% include 'map/geom_form.html' %}
-
- {% include 'intervention/detail/includes/comment.html' %} -

{% trans 'Open in browser' %}

diff --git a/compensation/templates/compensation/report/eco_account/report.html b/compensation/templates/compensation/report/eco_account/report.html new file mode 100644 index 00000000..bd633322 --- /dev/null +++ b/compensation/templates/compensation/report/eco_account/report.html @@ -0,0 +1,84 @@ +{% extends 'public_base.html' %} +{% load i18n fontawesome_5 humanize %} + +{% block body %} +
+
+

{% trans 'Report' %}

+

{{obj.identifier}}

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{% trans 'Title' %}{{obj.title|default_if_none:""}}
{% trans 'Conservation office' %}{{obj.responsible.conservation_office.str_as_office|default_if_none:""}}
{% trans 'Conservation office file number' %}{{obj.responsible.conservation_file_number|default_if_none:""}}
{% trans 'Action handler' %}{{obj.responsible.handler|default_if_none:""}}
{% trans 'Funded by' %} + {% with obj.fundings.all as fundings %} + {% for funding in fundings %} +
{{funding.short_name}}
+
+ {% empty %} + {% trans 'None' %} + {% endfor %} + {% endwith %} +
{% trans 'Deductions for' %} + {% for deduction in deductions %} + + {{deduction.intervention__identifier}} + +
+ {% empty %} + {% trans 'None' %} + {% endfor %} +
{% trans 'Last modified' %} + {{obj.modified.timestamp|default_if_none:""|naturalday}} +
+
+ + {% include 'compensation/detail/compensation/includes/states-before.html' %} + {% include 'compensation/detail/compensation/includes/states-after.html' %} + {% include 'compensation/detail/compensation/includes/actions.html' %} +
+
+
+ {% include 'map/geom_form.html' %} +
+
+
+

{% trans 'Open in browser' %}

+ {{ qrcode|safe }} +
+
+

{% trans 'View in LANIS' %}

+ {{ qrcode_lanis|safe }} +
+
+ +
+
+ +{% endblock %} \ No newline at end of file diff --git a/compensation/views/eco_account_views.py b/compensation/views/eco_account_views.py index 5f2ede3b..dadac7e6 100644 --- a/compensation/views/eco_account_views.py +++ b/compensation/views/eco_account_views.py @@ -42,7 +42,6 @@ def index_view(request: HttpRequest): A rendered view """ template = "generic_index.html" - user = request.user eco_accounts = EcoAccount.objects.filter( deleted=None, ) @@ -167,27 +166,36 @@ def detail_view(request: HttpRequest, id: str): """ template = "compensation/detail/eco_account/view.html" - acc = get_object_or_404(EcoAccount, id=id) + acc = get_object_or_404( + EcoAccount.objects.prefetch_related( + "deadlines", + ).select_related( + 'geometry', + 'responsible', + ), + id=id + ) geom_form = SimpleGeomForm(instance=acc) _user = request.user is_data_shared = acc.is_shared_with(_user) # Order states according to surface - before_states = acc.before_states.all().order_by("-surface") - after_states = acc.after_states.all().order_by("-surface") + before_states = acc.before_states.order_by("-surface") + after_states = acc.after_states.order_by("-surface") # Precalculate logical errors between before- and after-states # Sum() returns None in case of no states, so we catch that and replace it with 0 for easier handling sum_before_states = before_states.aggregate(Sum("surface"))["surface__sum"] or 0 sum_after_states = after_states.aggregate(Sum("surface"))["surface__sum"] or 0 diff_states = abs(sum_before_states - sum_after_states) - # Calculate rest of available surface for deductions available_total, available_relative = acc.get_available_rest() + # Prefetch related data to decrease the amount of db connections deductions = acc.deductions.filter( intervention__deleted=None, ) + actions = acc.actions.all() context = { "obj": acc, @@ -205,6 +213,7 @@ def detail_view(request: HttpRequest, id: str): "is_ets_member": in_group(_user, ETS_GROUP), "LANIS_LINK": acc.get_LANIS_link(), "deductions": deductions, + "actions": actions, } context = BaseContext(request, context).context return render(request, template, context) @@ -446,7 +455,7 @@ def report_view(request:HttpRequest, id: str): """ # Reuse the compensation report template since EcoAccounts are structurally identical - template = "compensation/report/report.html" + template = "compensation/report/eco_account/report.html" acc = get_object_or_404(EcoAccount, id=id) # If intervention is not recorded (yet or currently) we need to render another template without any data @@ -454,18 +463,39 @@ def report_view(request:HttpRequest, id: str): template = "report/unavailable.html" return render(request, template, {}) + # Prepare data for map viewer + geom_form = SimpleGeomForm( + instance=acc + ) qrcode_img = generate_qr_code( - request.build_absolute_uri(reverse("compensation:acc-report", args=(id,))), + request.build_absolute_uri(reverse("ema:report", args=(id,))), 10 ) qrcode_img_lanis = generate_qr_code( acc.get_LANIS_link(), 7 ) + # Order states by surface + before_states = acc.before_states.all().order_by("-surface").select_related("biotope_type__parent") + after_states = acc.after_states.all().order_by("-surface").select_related("biotope_type__parent") + actions = acc.actions.all().select_related("action_type__parent") + + # Reduce amount of db fetched data to the bare minimum we need in the template (deduction's intervention id and identifier) + deductions = acc.deductions.all()\ + .distinct("intervention")\ + .select_related("intervention")\ + .values_list("intervention__id", "intervention__identifier", named=True) + context = { "obj": acc, "qrcode": qrcode_img, "qrcode_lanis": qrcode_img_lanis, + "has_access": False, # disables action buttons during rendering + "before_states": before_states, + "after_states": after_states, + "geom_form": geom_form, + "actions": actions, + "deductions": deductions, } context = BaseContext(request, context).context return render(request, template, context) diff --git a/ema/managers.py b/ema/managers.py new file mode 100644 index 00000000..aaac3a39 --- /dev/null +++ b/ema/managers.py @@ -0,0 +1,21 @@ +""" +Author: Michel Peltriaux +Organization: Struktur- und Genehmigungsdirektion Nord, Rhineland-Palatinate, Germany +Contact: michel.peltriaux@sgdnord.rlp.de +Created on: 14.10.21 + +""" +from django.db import models + + +class EmaManager(models.Manager): + """ Holds default db fetch setting for this model type + + """ + def get_queryset(self): + return super().get_queryset().select_related( + "modified", + "modified__user", + "recorded", + "recorded__user", + ) \ No newline at end of file diff --git a/ema/models.py b/ema/models.py index d7e214fe..e8d31c4f 100644 --- a/ema/models.py +++ b/ema/models.py @@ -5,6 +5,7 @@ from django.db import models from django.db.models import QuerySet from compensation.models import AbstractCompensation +from ema.managers import EmaManager from konova.models import AbstractDocument, generate_document_file_upload_path from konova.settings import DEFAULT_SRID_RLP, LANIS_LINK_TEMPLATE, EMA_DOC_PATH from user.models import UserActionLogEntry @@ -43,6 +44,8 @@ class Ema(AbstractCompensation): related_name="+" ) + objects = EmaManager() + def __str__(self): return "{}".format(self.identifier) diff --git a/ema/tables.py b/ema/tables.py index aeeece2f..9055059d 100644 --- a/ema/tables.py +++ b/ema/tables.py @@ -49,7 +49,7 @@ class EmaTable(BaseTable): lm = tables.Column( verbose_name=_("Last edit"), orderable=True, - accessor="created__timestamp", + accessor="modified__timestamp", ) class Meta(BaseTable.Meta): @@ -122,7 +122,7 @@ class EmaTable(BaseTable): """ html = "" has_access = value.filter( - username=self.user.username + id=self.user.id ).exists() html += self.render_icn( diff --git a/ema/templates/ema/detail/includes/controls.html b/ema/templates/ema/detail/includes/controls.html index 88a112ff..1d5e5467 100644 --- a/ema/templates/ema/detail/includes/controls.html +++ b/ema/templates/ema/detail/includes/controls.html @@ -6,7 +6,7 @@ LANIS
- + diff --git a/ema/templates/ema/report/report.html b/ema/templates/ema/report/report.html index 756b6573..2395e7ce 100644 --- a/ema/templates/ema/report/report.html +++ b/ema/templates/ema/report/report.html @@ -54,9 +54,6 @@
{% include 'map/geom_form.html' %}
-
- {% include 'intervention/detail/includes/comment.html' %} -

{% trans 'Open in browser' %}

diff --git a/intervention/managers.py b/intervention/managers.py new file mode 100644 index 00000000..213e8659 --- /dev/null +++ b/intervention/managers.py @@ -0,0 +1,48 @@ +""" +Author: Michel Peltriaux +Organization: Struktur- und Genehmigungsdirektion Nord, Rhineland-Palatinate, Germany +Contact: michel.peltriaux@sgdnord.rlp.de +Created on: 14.10.21 + +""" +from django.db import models + + +class InterventionManager(models.Manager): + """ Holds default db fetch setting for this model type + + """ + def get_queryset(self): + return super().get_queryset().select_related( + "recorded", + "recorded__user", + "modified", + "modified__user", + "checked", + "checked__user", + ).prefetch_related( + "users", + ) + + +class LegalDataManager(models.Manager): + """ Holds default db fetch setting for this model type + + """ + def get_queryset(self): + return super().get_querset().select_related( + "process_type", + ).prefetch_related( + "laws" + ) + + +class ResponsibilityDataManager(models.Manager): + """ Holds default db fetch setting for this model type + + """ + def get_queryset(self): + return super().get_querset().select_related( + "registration_office", + "conservation_office", + ) diff --git a/intervention/models.py b/intervention/models.py index e2a6c44e..2bdf1eff 100644 --- a/intervention/models.py +++ b/intervention/models.py @@ -10,16 +10,15 @@ import shutil from django.contrib.auth.models import User from django.contrib.gis.db import models from django.db.models import QuerySet -from django.utils.timezone import localtime from django.utils.translation import gettext_lazy as _ from codelist.models import KonovaCode from codelist.settings import CODELIST_REGISTRATION_OFFICE_ID, CODELIST_CONSERVATION_OFFICE_ID, CODELIST_LAW_ID, \ CODELIST_PROCESS_TYPE_ID +from intervention.managers import InterventionManager, LegalDataManager, ResponsibilityDataManager from konova.models import BaseObject, Geometry, UuidModel, BaseResource, AbstractDocument, \ generate_document_file_upload_path from konova.settings import DEFAULT_SRID_RLP, LANIS_LINK_TEMPLATE, LANIS_ZOOM_LUT -from konova.sub_settings.django_settings import DEFAULT_DATE_TIME_FORMAT from konova.utils import generators from user.models import UserActionLogEntry @@ -57,6 +56,8 @@ class ResponsibilityData(UuidModel): conservation_file_number = models.CharField(max_length=1000, blank=True, null=True) handler = models.CharField(max_length=500, null=True, blank=True, help_text="Refers to 'Eingriffsverursacher' or 'Maßnahmenträger'") + objects = ResponsibilityDataManager() + def __str__(self): return "ZB: {} | ETS: {} | Handler: {}".format( self.registration_office, @@ -171,6 +172,8 @@ class LegalData(UuidModel): revocation = models.OneToOneField(Revocation, null=True, blank=True, help_text="Refers to 'Widerspruch am'", on_delete=models.SET_NULL) + objects = LegalDataManager() + class Intervention(BaseObject): """ @@ -221,6 +224,8 @@ class Intervention(BaseObject): help_text="Used for sharing access", ) + objects = InterventionManager() + def __str__(self): return "{} ({})".format(self.identifier, self.title) @@ -379,16 +384,6 @@ class Intervention(BaseObject): y, ) - @property - def recorded_tooltip(self): - tooltip = _("Not recorded yet") - if self.recorded: - value = self.recorded.timestamp - value = localtime(value) - on = value.strftime(DEFAULT_DATE_TIME_FORMAT) - tooltip = _("Recorded on {} by {}").format(on, self.recorded.user) - return tooltip - def get_documents(self) -> (QuerySet, QuerySet): """ Getter for all documents of an intervention diff --git a/intervention/tables.py b/intervention/tables.py index bf0e718d..103d419a 100644 --- a/intervention/tables.py +++ b/intervention/tables.py @@ -117,7 +117,7 @@ class InterventionTable(BaseTable): return format_html(html) def render_r(self, value, record: Intervention): - """ Renders the registered column for an intervention + """ Renders the recorded column for an intervention Args: value (str): The identifier value @@ -141,7 +141,7 @@ class InterventionTable(BaseTable): return format_html(html) def render_e(self, value, record: Intervention): - """ Renders the registered column for an intervention + """ Renders the editable column for an intervention Args: value (str): The identifier value @@ -152,7 +152,7 @@ class InterventionTable(BaseTable): """ html = "" has_access = value.filter( - username=self.user.username + id=self.user.id ).exists() html += self.render_icn( diff --git a/intervention/templates/intervention/detail/includes/comment.html b/intervention/templates/intervention/detail/includes/comment.html deleted file mode 100644 index aff3dec8..00000000 --- a/intervention/templates/intervention/detail/includes/comment.html +++ /dev/null @@ -1,23 +0,0 @@ -{% load i18n fontawesome_5 %} - -{% if obj.comment %} -
-
-
-
-
-
- {% fa5_icon 'info-circle' %} - {% trans 'Comment' %} -
-
-
-
-
-
- {{obj.comment}} -
-
-
-
-{% endif %} \ No newline at end of file diff --git a/intervention/templates/intervention/detail/includes/controls.html b/intervention/templates/intervention/detail/includes/controls.html index 4a64e5fb..bb94042a 100644 --- a/intervention/templates/intervention/detail/includes/controls.html +++ b/intervention/templates/intervention/detail/includes/controls.html @@ -6,7 +6,7 @@ LANIS
- + diff --git a/intervention/templates/intervention/detail/view.html b/intervention/templates/intervention/detail/view.html index 7d2788e3..e3d919f3 100644 --- a/intervention/templates/intervention/detail/view.html +++ b/intervention/templates/intervention/detail/view.html @@ -127,7 +127,7 @@ {% include 'map/geom_form.html' %}
- {% include 'intervention/detail/includes/comment.html' %} + {% include 'konova/comment_card.html' %}
diff --git a/intervention/templates/intervention/report/report.html b/intervention/templates/intervention/report/report.html index 4813582e..cf422042 100644 --- a/intervention/templates/intervention/report/report.html +++ b/intervention/templates/intervention/report/report.html @@ -100,9 +100,6 @@
{% include 'map/geom_form.html' %}
-
- {% include 'intervention/detail/includes/comment.html' %} -

{% trans 'Open in browser' %}

diff --git a/intervention/views.py b/intervention/views.py index 49b363cf..6853197f 100644 --- a/intervention/views.py +++ b/intervention/views.py @@ -35,6 +35,8 @@ def index_view(request: HttpRequest): # Filtering by user access is performed in table filter inside of InterventionTableFilter class interventions = Intervention.objects.filter( deleted=None, # not deleted + ).select_related( + "legal" ) table = InterventionTable( request=request, @@ -194,7 +196,14 @@ def detail_view(request: HttpRequest, id: str): template = "intervention/detail/view.html" # Fetch data, filter out deleted related data - intervention = get_object_or_404(Intervention, id=id) + intervention = get_object_or_404( + Intervention.objects.select_related( + "geometry", + "legal", + "responsible", + ), + id=id + ) compensations = intervention.compensations.filter( deleted=None, ) diff --git a/konova/models.py b/konova/models.py index ab4ad7ae..f9f87584 100644 --- a/konova/models.py +++ b/konova/models.py @@ -149,7 +149,7 @@ class BaseObject(BaseResource): """ if hasattr(self, "users"): - return self.users.filter(username=user.username).exists() + return self.users.filter(id=user.id) else: return User.objects.none() diff --git a/compensation/templates/compensation/detail/compensation/includes/comment.html b/konova/templates/konova/comment_card.html similarity index 81% rename from compensation/templates/compensation/detail/compensation/includes/comment.html rename to konova/templates/konova/comment_card.html index aff3dec8..0cc91bf0 100644 --- a/compensation/templates/compensation/detail/compensation/includes/comment.html +++ b/konova/templates/konova/comment_card.html @@ -1,5 +1,10 @@ {% load i18n fontawesome_5 %} +{% comment %} + Used in e.g. reports and detail views for every model which supports comment field (BaseObject derived) +{% endcomment %} + + {% if obj.comment %}
diff --git a/locale/de/LC_MESSAGES/django.mo b/locale/de/LC_MESSAGES/django.mo index 348a808d988e5289faef8d59491fb3dd9e5230e5..5c28ab3990cbc7c5abdc48bc98a964e3f7a8dac3 100644 GIT binary patch delta 6849 zcmYk=3w+PjAII@Co82$$F2go9b~Br?F>5w|i7Bg9LZT%rl3U3w-_nhgXkGA6q( z3lSl?U+>@d?Emn6^!Yu{Ip6R1ob&yh^Zo6o#cR9{t?_bd z!+qW`9K~M7#9?}%F;$eiM5@)8D>oSvM*S*QQV-yw7jQm4hpn0!!+&NuAK|#udIWu` zpT!{j9fQ#{HzpK9TpbffK^LT9OU$(w3_#6c7&bx&8{;fnUxZ=Qt1$w%p{_rS8sIn7 zfY)r@zlGZ#gCVphV~}x-$)TW`cg18ZLvNgjdV(pa0iH*7I2YByG7P{^P!szcNuK!{ z)!z@O>(5!Qq5AWWHzotaFwvn(8MEyo?$! zAi>QSe&whzQ8>SNG}rZA0yo@fE8!_<(c29@%2sE)2+ z30}t;Si%NUCJ&Af|5olqTcYkyYeoJw^K2S4^Ul_8s1)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,7 +19,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-10-14 08:46+0200\n" +"POT-Creation-Date: 2021-10-14 09:12+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -51,6 +51,7 @@ msgstr "Automatisch generiert" #: compensation/templates/compensation/detail/eco_account/includes/documents.html:28 #: compensation/templates/compensation/detail/eco_account/view.html:31 #: compensation/templates/compensation/report/compensation/report.html:12 +#: compensation/templates/compensation/report/eco_account/report.html:12 #: ema/tables.py:33 ema/templates/ema/detail/includes/documents.html:28 #: ema/templates/ema/detail/view.html:24 #: ema/templates/ema/report/report.html:12 intervention/forms/forms.py:39 @@ -89,22 +90,19 @@ msgstr "Auswählen..." #: compensation/forms/forms.py:73 compensation/forms/modalForms.py:61 #: compensation/forms/modalForms.py:272 compensation/forms/modalForms.py:367 #: compensation/templates/compensation/detail/compensation/includes/actions.html:34 -#: compensation/templates/compensation/detail/compensation/includes/comment.html:11 #: compensation/templates/compensation/detail/compensation/includes/deadlines.html:34 #: compensation/templates/compensation/detail/compensation/includes/documents.html:31 #: compensation/templates/compensation/detail/eco_account/includes/actions.html:34 -#: compensation/templates/compensation/detail/eco_account/includes/comment.html:11 #: compensation/templates/compensation/detail/eco_account/includes/deadlines.html:34 #: compensation/templates/compensation/detail/eco_account/includes/documents.html:31 #: 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/forms.py:179 intervention/forms/modalForms.py:132 -#: intervention/templates/intervention/detail/includes/comment.html:11 #: 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:371 +#: konova/forms.py:371 konova/templates/konova/comment_card.html:16 msgid "Comment" msgstr "Kommentar" @@ -114,8 +112,9 @@ msgstr "Zusätzlicher Kommentar" #: compensation/forms/forms.py:93 #: compensation/templates/compensation/detail/eco_account/view.html:58 +#: compensation/templates/compensation/report/eco_account/report.html:16 #: ema/templates/ema/detail/view.html:42 -#: ema/templates/ema/report/report.html:29 intervention/forms/forms.py:101 +#: ema/templates/ema/report/report.html:16 intervention/forms/forms.py:101 #: intervention/templates/intervention/detail/view.html:56 #: intervention/templates/intervention/report/report.html:37 msgid "Conservation office" @@ -127,8 +126,9 @@ msgstr "Verantwortliche Stelle" #: compensation/forms/forms.py:109 #: compensation/templates/compensation/detail/eco_account/view.html:62 +#: compensation/templates/compensation/report/eco_account/report.html:20 #: ema/templates/ema/detail/view.html:46 -#: ema/templates/ema/report/report.html:33 intervention/forms/forms.py:129 +#: ema/templates/ema/report/report.html:20 intervention/forms/forms.py:129 #: intervention/templates/intervention/detail/view.html:60 #: intervention/templates/intervention/report/report.html:41 msgid "Conservation office file number" @@ -687,16 +687,19 @@ msgstr "Verzeichnet am" #: compensation/templates/compensation/detail/compensation/view.html:71 #: compensation/templates/compensation/detail/eco_account/view.html:70 #: compensation/templates/compensation/report/compensation/report.html:24 +#: compensation/templates/compensation/report/eco_account/report.html:28 #: ema/templates/ema/detail/view.html:54 -#: ema/templates/ema/report/report.html:16 +#: ema/templates/ema/report/report.html:28 msgid "Funded by" msgstr "Gefördert mit" #: compensation/templates/compensation/detail/compensation/view.html:79 #: compensation/templates/compensation/detail/eco_account/view.html:78 #: compensation/templates/compensation/report/compensation/report.html:31 +#: compensation/templates/compensation/report/eco_account/report.html:35 +#: compensation/templates/compensation/report/eco_account/report.html:49 #: ema/templates/ema/detail/view.html:62 -#: ema/templates/ema/report/report.html:23 +#: ema/templates/ema/report/report.html:35 #: intervention/templates/intervention/report/report.html:57 #: intervention/templates/intervention/report/report.html:78 msgid "None" @@ -705,6 +708,7 @@ msgstr "" #: compensation/templates/compensation/detail/compensation/view.html:84 #: compensation/templates/compensation/detail/eco_account/view.html:83 #: compensation/templates/compensation/report/compensation/report.html:37 +#: compensation/templates/compensation/report/eco_account/report.html:54 #: ema/templates/ema/detail/view.html:67 #: ema/templates/ema/report/report.html:41 #: intervention/templates/intervention/detail/view.html:108 @@ -779,27 +783,37 @@ msgid "Missing" msgstr "Fehlt" #: compensation/templates/compensation/detail/eco_account/view.html:66 +#: compensation/templates/compensation/report/eco_account/report.html:24 +#: ema/templates/ema/detail/view.html:50 +#: ema/templates/ema/report/report.html:24 msgid "Action handler" msgstr "Maßnahmenträger" #: compensation/templates/compensation/report/compensation/report.html:7 +#: compensation/templates/compensation/report/eco_account/report.html:7 #: ema/templates/ema/report/report.html:7 #: intervention/templates/intervention/report/report.html:7 msgid "Report" msgstr "Bericht" #: compensation/templates/compensation/report/compensation/report.html:58 +#: compensation/templates/compensation/report/eco_account/report.html:75 #: ema/templates/ema/report/report.html:62 #: intervention/templates/intervention/report/report.html:108 msgid "Open in browser" msgstr "Im Browser öffnen" #: compensation/templates/compensation/report/compensation/report.html:62 +#: compensation/templates/compensation/report/eco_account/report.html:79 #: ema/templates/ema/report/report.html:66 #: intervention/templates/intervention/report/report.html:112 msgid "View in LANIS" msgstr "In LANIS öffnen" +#: compensation/templates/compensation/report/eco_account/report.html:41 +msgid "Deductions for" +msgstr "Abbuchungen für" + #: compensation/views/compensation_views.py:77 msgid "Compensation {} added" msgstr "Kompensation {} hinzugefügt" @@ -913,13 +927,6 @@ msgstr "" msgid "Payment funded compensation" msgstr "Ersatzzahlungsmaßnahme" -#: ema/templates/ema/detail/view.html:50 -#: ema/templates/ema/report/report.html:37 intervention/forms/forms.py:141 -#: intervention/templates/intervention/detail/view.html:64 -#: intervention/templates/intervention/report/report.html:45 -msgid "Intervention handler" -msgstr "Eingriffsverursacher" - #: ema/views.py:78 msgid "EMA {} added" msgstr "EMA {} hinzugefügt" @@ -984,6 +991,12 @@ msgstr "Aktenzeichen Zulassungsbehörde" msgid "ZB-123/ABC.456" msgstr "" +#: intervention/forms/forms.py:141 +#: intervention/templates/intervention/detail/view.html:64 +#: intervention/templates/intervention/report/report.html:45 +msgid "Intervention handler" +msgstr "Eingriffsverursacher" + #: intervention/forms/forms.py:145 msgid "Who performs the intervention" msgstr "Wer führt den Eingriff durch" From 7631adc88fa345fb070b9dfb9a2be0232a546ea8 Mon Sep 17 00:00:00 2001 From: mpeltriaux Date: Fri, 15 Oct 2021 09:25:26 +0200 Subject: [PATCH 8/8] Translations * adds/updates translations --- konova/contexts.py | 3 +- konova/sub_settings/django_settings.py | 8 ++- locale/de/LC_MESSAGES/django.mo | Bin 23251 -> 24781 bytes locale/de/LC_MESSAGES/django.po | 82 ++++++++++++------------- 4 files changed, 49 insertions(+), 44 deletions(-) diff --git a/konova/contexts.py b/konova/contexts.py index b8ca6d68..b415889b 100644 --- a/konova/contexts.py +++ b/konova/contexts.py @@ -8,6 +8,7 @@ Created on: 16.11.20 from django.http import HttpRequest from konova.sub_settings.context_settings import BASE_TITLE, HELP_LINK, BASE_FRONTEND_TITLE +from konova.sub_settings.django_settings import LANGUAGE_CODE class BaseContext: @@ -17,7 +18,7 @@ class BaseContext: context = { "base_title": BASE_TITLE, "base_frontend_title": BASE_FRONTEND_TITLE, - "language": "en", + "language": LANGUAGE_CODE, "user": None, "current_role": None, "help_link": HELP_LINK, diff --git a/konova/sub_settings/django_settings.py b/konova/sub_settings/django_settings.py index 568492f5..29540d4b 100644 --- a/konova/sub_settings/django_settings.py +++ b/konova/sub_settings/django_settings.py @@ -10,7 +10,7 @@ For the full list of settings and their values, see https://docs.djangoproject.com/en/3.1/ref/settings/ """ import os -from pathlib import Path +from django.utils.translation import gettext_lazy as _ # Build paths inside the project like this: BASE_DIR / 'subdir'. BASE_DIR = os.path.dirname( @@ -78,12 +78,12 @@ if DEBUG: MIDDLEWARE = [ 'django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', + "django.middleware.locale.LocaleMiddleware", 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', - "django.middleware.locale.LocaleMiddleware", ] if DEBUG: MIDDLEWARE += [ @@ -149,6 +149,10 @@ AUTH_PASSWORD_VALIDATORS = [ # https://docs.djangoproject.com/en/3.1/topics/i18n/ LANGUAGE_CODE = 'de' +LANGUAGES = [ + ('de', _('German')), + ('en', _('English')), +] USE_THOUSAND_SEPARATOR = True diff --git a/locale/de/LC_MESSAGES/django.mo b/locale/de/LC_MESSAGES/django.mo index 5c28ab3990cbc7c5abdc48bc98a964e3f7a8dac3..b9d3ebde2f32b322b31bbe5e82f547e9e9e5b976 100644 GIT binary patch delta 8666 zcmZA63tU!Jy2tSaf`CW}DWYhAAc_hiD&8_dxhRIHV1gGC;Z+dfbzUJwXMA&VGRvu> z*hMSL6AhNxnAFK*Xr~;TN-Y~t4K+F4)v?SjcGR(H=J$X1^2oG5^YC43?X}lh`&oN$ za60jV-?3Nxynl@hxZiNp_!-j&>qCt>P5Ee)T8*i?!I*IB)!0P6G1iznF)YrQb+`rl zVy}2(B5{;8A3IZ@j|^!lu`4da>+n~OUbE45co-8n(PBFs!S2*Qz;1XRBhd77>X8^u zH36^3;i&$3s0rqwCakgbmDcqbM*9O8YP`lYQ_#xyU=kj}PIwk|2VbKm_yILw2&>cp zQ5b@WsD-6s7tBPBHx<>t%vysQZzZOn7yB{4*-b%ravX#3V;q2IuoreqbW%77wU7*J zKB|8iYQjaR2^&$FxD(a?Vbm7=-nJjZ9@IZYueSLT1>I42e`mnHs1)``rG5lzpd4iT zO(|-Dji`Zlpce8n2IC)X{W$8nc2tJGLS^75dp*cpF;Q*kBUgMUC}bULfl#0ya4c(6CF#UOlS0QuJd&9-3|YT#CD8!An@-sxPqE6Y@oAMeNkJHjJlBwRHn0S`&`u9R^_Fjz4{GmqHU)R&_MT7g>V8VteBsOuj=W#UQeUhGNzW#_!t{F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