# 70 Tab titles interventions

* adds content related tab title
* adds/updates translations
This commit is contained in:
mpeltriaux 2022-01-20 12:12:04 +01:00
parent 9e3d9a1c19
commit 77e9c989aa
7 changed files with 53 additions and 37 deletions

View File

@ -10,11 +10,12 @@ from intervention.models import Intervention, Revocation, InterventionDocument,
from intervention.tables import InterventionTable from intervention.tables import InterventionTable
from konova.contexts import BaseContext from konova.contexts import BaseContext
from konova.decorators import * from konova.decorators import *
from konova.forms import SimpleGeomForm, NewDocumentForm, RemoveModalForm, RecordModalForm from konova.forms import SimpleGeomForm, RemoveModalForm, RecordModalForm
from konova.sub_settings.context_settings import TAB_TITLE_IDENTIFIER
from konova.utils.documents import remove_document, get_document from konova.utils.documents import remove_document, get_document
from konova.utils.generators import generate_qr_code from konova.utils.generators import generate_qr_code
from konova.utils.message_templates import INTERVENTION_INVALID, FORM_INVALID, IDENTIFIER_REPLACED, \ from konova.utils.message_templates import INTERVENTION_INVALID, FORM_INVALID, IDENTIFIER_REPLACED, \
DATA_UNSHARED_EXPLANATION, CHECKED_RECORDED_RESET CHECKED_RECORDED_RESET
from konova.utils.user_checks import in_group from konova.utils.user_checks import in_group
@ -44,6 +45,7 @@ def index_view(request: HttpRequest):
) )
context = { context = {
"table": table, "table": table,
TAB_TITLE_IDENTIFIER: _("Interventions - Overview"),
} }
context = BaseContext(request, context).context context = BaseContext(request, context).context
return render(request, template, context) return render(request, template, context)
@ -86,6 +88,7 @@ def new_view(request: HttpRequest):
context = { context = {
"form": data_form, "form": data_form,
"geom_form": geom_form, "geom_form": geom_form,
TAB_TITLE_IDENTIFIER: _("New intervention"),
} }
context = BaseContext(request, context).context context = BaseContext(request, context).context
return render(request, template, context) return render(request, template, context)
@ -255,7 +258,8 @@ def detail_view(request: HttpRequest, id: str):
"is_default_member": in_group(_user, DEFAULT_GROUP), "is_default_member": in_group(_user, DEFAULT_GROUP),
"is_zb_member": in_group(_user, ZB_GROUP), "is_zb_member": in_group(_user, ZB_GROUP),
"is_ets_member": in_group(_user, ETS_GROUP), "is_ets_member": in_group(_user, ETS_GROUP),
"LANIS_LINK": intervention.get_LANIS_link() "LANIS_LINK": intervention.get_LANIS_link(),
TAB_TITLE_IDENTIFIER: f"{intervention.identifier} - {intervention.title}",
} }
request = intervention.set_status_messages(request) request = intervention.set_status_messages(request)
@ -302,6 +306,7 @@ def edit_view(request: HttpRequest, id: str):
context = { context = {
"form": data_form, "form": data_form,
"geom_form": geom_form, "geom_form": geom_form,
TAB_TITLE_IDENTIFIER: _("Edit {}").format(intervention.identifier),
} }
context = BaseContext(request, context).context context = BaseContext(request, context).context
return render(request, template, context) return render(request, template, context)
@ -538,10 +543,15 @@ def report_view(request:HttpRequest, id: str):
template = "intervention/report/report.html" template = "intervention/report/report.html"
intervention = get_object_or_404(Intervention, id=id) intervention = get_object_or_404(Intervention, id=id)
tab_title = _("Report {}").format(intervention.identifier)
# If intervention is not recorded (yet or currently) we need to render another template without any data # If intervention is not recorded (yet or currently) we need to render another template without any data
if not intervention.recorded: if not intervention.recorded:
template = "report/unavailable.html" template = "report/unavailable.html"
return render(request, template, {}) context = {
TAB_TITLE_IDENTIFIER: tab_title,
}
context = BaseContext(request, context).context
return render(request, template, context)
# Prepare data for map viewer # Prepare data for map viewer
geom_form = SimpleGeomForm( geom_form = SimpleGeomForm(
@ -567,6 +577,7 @@ def report_view(request:HttpRequest, id: str):
"qrcode_lanis": qrcode_img_lanis, "qrcode_lanis": qrcode_img_lanis,
"geom_form": geom_form, "geom_form": geom_form,
"parcels": parcels, "parcels": parcels,
TAB_TITLE_IDENTIFIER: tab_title,
} }
context = BaseContext(request, context).context context = BaseContext(request, context).context
return render(request, template, context) return render(request, template, context)

View File

@ -7,7 +7,7 @@ Created on: 16.11.20
""" """
from django.http import HttpRequest from django.http import HttpRequest
from konova.sub_settings.context_settings import BASE_TITLE, HELP_LINK, BASE_FRONTEND_TITLE from konova.sub_settings.context_settings import BASE_TITLE, HELP_LINK, BASE_FRONTEND_TITLE, TAB_TITLE_IDENTIFIER
from konova.sub_settings.django_settings import EMAIL_REPLY_TO from konova.sub_settings.django_settings import EMAIL_REPLY_TO
@ -20,7 +20,7 @@ class BaseContext:
def __init__(self, request: HttpRequest, additional_context: dict = {}): def __init__(self, request: HttpRequest, additional_context: dict = {}):
self.context = { self.context = {
"base_title": BASE_TITLE, "base_title": BASE_TITLE,
"base_frontend_title": BASE_FRONTEND_TITLE, TAB_TITLE_IDENTIFIER: BASE_FRONTEND_TITLE,
"language": request.LANGUAGE_CODE, "language": request.LANGUAGE_CODE,
"user": request.user, "user": request.user,
"current_role": None, "current_role": None,

View File

@ -9,4 +9,5 @@ Created on: 16.11.20
BASE_TITLE_SHORT = "KSP" BASE_TITLE_SHORT = "KSP"
BASE_TITLE = "KSP - Kompensationsverzeichnis Service Portal" BASE_TITLE = "KSP - Kompensationsverzeichnis Service Portal"
BASE_FRONTEND_TITLE = "Kompensationsverzeichnis Service Portal" BASE_FRONTEND_TITLE = "Kompensationsverzeichnis Service Portal"
TAB_TITLE_IDENTIFIER = "tab_title"
HELP_LINK = "https://dienste.naturschutz.rlp.de/doku/doku.php?id=ksp:start" HELP_LINK = "https://dienste.naturschutz.rlp.de/doku/doku.php?id=ksp:start"

Binary file not shown.

View File

@ -26,7 +26,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-01-12 16:43+0100\n" "POT-Creation-Date: 2022-01-20 12:07+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -1064,7 +1064,7 @@ msgid "Compensation {} edited"
msgstr "Kompensation {} bearbeitet" msgstr "Kompensation {} bearbeitet"
#: compensation/views/compensation.py:230 compensation/views/eco_account.py:309 #: compensation/views/compensation.py:230 compensation/views/eco_account.py:309
#: ema/views.py:183 intervention/views.py:478 #: ema/views.py:183 intervention/views.py:482
msgid "Log" msgid "Log"
msgstr "Log" msgstr "Log"
@ -1073,7 +1073,7 @@ msgid "Compensation removed"
msgstr "Kompensation entfernt" msgstr "Kompensation entfernt"
#: compensation/views/compensation.py:274 compensation/views/eco_account.py:461 #: compensation/views/compensation.py:274 compensation/views/eco_account.py:461
#: ema/views.py:350 intervention/views.py:129 #: ema/views.py:350 intervention/views.py:132
msgid "Document added" msgid "Document added"
msgstr "Dokument hinzugefügt" msgstr "Dokument hinzugefügt"
@ -1119,36 +1119,36 @@ msgid "Deduction removed"
msgstr "Abbuchung entfernt" msgstr "Abbuchung entfernt"
#: compensation/views/eco_account.py:330 ema/views.py:263 #: compensation/views/eco_account.py:330 ema/views.py:263
#: intervention/views.py:520 #: intervention/views.py:524
msgid "{} unrecorded" msgid "{} unrecorded"
msgstr "{} entzeichnet" msgstr "{} entzeichnet"
#: compensation/views/eco_account.py:330 ema/views.py:263 #: compensation/views/eco_account.py:330 ema/views.py:263
#: intervention/views.py:520 #: intervention/views.py:524
msgid "{} recorded" msgid "{} recorded"
msgstr "{} verzeichnet" msgstr "{} verzeichnet"
#: compensation/views/eco_account.py:531 intervention/views.py:501 #: compensation/views/eco_account.py:531 intervention/views.py:505
msgid "Deduction added" msgid "Deduction added"
msgstr "Abbuchung hinzugefügt" msgstr "Abbuchung hinzugefügt"
#: compensation/views/eco_account.py:616 ema/views.py:520 #: compensation/views/eco_account.py:616 ema/views.py:520
#: intervention/views.py:376 #: intervention/views.py:380
msgid "{} has already been shared with you" msgid "{} has already been shared with you"
msgstr "{} wurde bereits für Sie freigegeben" msgstr "{} wurde bereits für Sie freigegeben"
#: compensation/views/eco_account.py:621 ema/views.py:525 #: compensation/views/eco_account.py:621 ema/views.py:525
#: intervention/views.py:381 #: intervention/views.py:385
msgid "{} has been shared with you" msgid "{} has been shared with you"
msgstr "{} ist nun für Sie freigegeben" msgstr "{} ist nun für Sie freigegeben"
#: compensation/views/eco_account.py:628 ema/views.py:532 #: compensation/views/eco_account.py:628 ema/views.py:532
#: intervention/views.py:388 #: intervention/views.py:392
msgid "Share link invalid" msgid "Share link invalid"
msgstr "Freigabelink ungültig" msgstr "Freigabelink ungültig"
#: compensation/views/eco_account.py:651 ema/views.py:555 #: compensation/views/eco_account.py:651 ema/views.py:555
#: intervention/views.py:411 #: intervention/views.py:415
msgid "Share settings updated" msgid "Share settings updated"
msgstr "Freigabe Einstellungen aktualisiert" msgstr "Freigabe Einstellungen aktualisiert"
@ -1257,7 +1257,7 @@ msgstr "Datum Zulassung bzw. Satzungsbeschluss"
msgid "Binding on" msgid "Binding on"
msgstr "Datum Bestandskraft" msgstr "Datum Bestandskraft"
#: intervention/forms/forms.py:191 #: intervention/forms/forms.py:191 intervention/views.py:91
msgid "New intervention" msgid "New intervention"
msgstr "Neuer Eingriff" msgstr "Neuer Eingriff"
@ -1459,38 +1459,50 @@ msgstr ""
"Kein Ausgleich jeglicher Art gefunden (Kompensation, Ersatzzahlung, " "Kein Ausgleich jeglicher Art gefunden (Kompensation, Ersatzzahlung, "
"Abbuchung)" "Abbuchung)"
#: intervention/views.py:79 #: intervention/views.py:48
msgid "Interventions - Overview"
msgstr "Eingriffe - Übersicht"
#: intervention/views.py:81
msgid "Intervention {} added" msgid "Intervention {} added"
msgstr "Eingriff {} hinzugefügt" msgstr "Eingriff {} hinzugefügt"
#: intervention/views.py:246 #: intervention/views.py:248
msgid "This intervention has {} revocations" msgid "This intervention has {} revocations"
msgstr "Dem Eingriff liegen {} Widersprüche vor" msgstr "Dem Eingriff liegen {} Widersprüche vor"
#: intervention/views.py:294 #: intervention/views.py:297
msgid "Intervention {} edited" msgid "Intervention {} edited"
msgstr "Eingriff {} bearbeitet" msgstr "Eingriff {} bearbeitet"
#: intervention/views.py:329 #: intervention/views.py:309
msgid "Edit {}"
msgstr "Bearbeite {}"
#: intervention/views.py:333
msgid "{} removed" msgid "{} removed"
msgstr "{} entfernt" msgstr "{} entfernt"
#: intervention/views.py:350 #: intervention/views.py:354
msgid "Revocation removed" msgid "Revocation removed"
msgstr "Widerspruch entfernt" msgstr "Widerspruch entfernt"
#: intervention/views.py:432 #: intervention/views.py:436
msgid "Check performed" msgid "Check performed"
msgstr "Prüfung durchgeführt" msgstr "Prüfung durchgeführt"
#: intervention/views.py:454 #: intervention/views.py:458
msgid "Revocation added" msgid "Revocation added"
msgstr "Widerspruch hinzugefügt" msgstr "Widerspruch hinzugefügt"
#: intervention/views.py:525 #: intervention/views.py:529
msgid "There are errors on this intervention:" msgid "There are errors on this intervention:"
msgstr "Es liegen Fehler in diesem Eingriff vor:" msgstr "Es liegen Fehler in diesem Eingriff vor:"
#: intervention/views.py:546
msgid "Report {}"
msgstr "Bericht {}"
#: konova/decorators.py:30 #: konova/decorators.py:30
msgid "You need to be staff to perform this action!" msgid "You need to be staff to perform this action!"
msgstr "Hierfür müssen Sie Mitarbeiter sein!" msgstr "Hierfür müssen Sie Mitarbeiter sein!"
@ -2165,22 +2177,14 @@ msgid "More"
msgstr "Mehr" msgstr "Mehr"
#: templates/navbars/navbar.html:44 #: templates/navbars/navbar.html:44
msgid "Import..."
msgstr ""
#: templates/navbars/navbar.html:45
msgid "Export..."
msgstr ""
#: templates/navbars/navbar.html:46
msgid "Reports" msgid "Reports"
msgstr "Berichte" msgstr "Berichte"
#: templates/navbars/navbar.html:58 user/templates/user/index.html:31 #: templates/navbars/navbar.html:56 user/templates/user/index.html:31
msgid "Settings" msgid "Settings"
msgstr "Einstellungen" msgstr "Einstellungen"
#: templates/navbars/navbar.html:59 #: templates/navbars/navbar.html:57
msgid "Logout" msgid "Logout"
msgstr "Abmelden" msgstr "Abmelden"

View File

@ -4,7 +4,7 @@
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<title>{{ base_frontend_title }}</title> <title>{{ tab_title }}</title>
<link rel="icon" type="image/ico" href="{% static 'images/ksp-favicon.ico' %}"> <link rel="icon" type="image/ico" href="{% static 'images/ksp-favicon.ico' %}">
{% bootstrap_css %} {% bootstrap_css %}
{% bootstrap_javascript jquery='full' %} {% bootstrap_javascript jquery='full' %}

View File

@ -4,7 +4,7 @@
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<title>{{ base_frontend_title }}</title> <title>{{ tab_title }}</title>
<link rel="icon" type="image/ico" href="{% static 'images/ksp-favicon.ico' %}"> <link rel="icon" type="image/ico" href="{% static 'images/ksp-favicon.ico' %}">
{% bootstrap_css %} {% bootstrap_css %}
{% bootstrap_javascript jquery='full' %} {% bootstrap_javascript jquery='full' %}