# 70 Tab title eco-account

* adds tab titles for eco account
* adds/updates translations
pull/81/head
mpeltriaux 3 years ago
parent 014155b0a4
commit b9bec82876

@ -25,6 +25,7 @@ from konova.decorators import any_group_check, default_group_required, conservat
shared_access_required shared_access_required
from konova.forms import RemoveModalForm, SimpleGeomForm, NewDocumentForm, RecordModalForm from konova.forms import RemoveModalForm, SimpleGeomForm, NewDocumentForm, RecordModalForm
from konova.settings import DEFAULT_GROUP, ZB_GROUP, ETS_GROUP from konova.settings import DEFAULT_GROUP, ZB_GROUP, ETS_GROUP
from konova.sub_settings.context_settings import TAB_TITLE_IDENTIFIER
from konova.utils.documents import get_document, remove_document from konova.utils.documents import get_document, remove_document
from konova.utils.generators import generate_qr_code from konova.utils.generators import generate_qr_code
from konova.utils.message_templates import IDENTIFIER_REPLACED, FORM_INVALID, DATA_UNSHARED, DATA_UNSHARED_EXPLANATION, \ from konova.utils.message_templates import IDENTIFIER_REPLACED, FORM_INVALID, DATA_UNSHARED, DATA_UNSHARED_EXPLANATION, \
@ -54,6 +55,7 @@ def index_view(request: HttpRequest):
) )
context = { context = {
"table": table, "table": table,
TAB_TITLE_IDENTIFIER: _("Eco-account - Overview"),
} }
context = BaseContext(request, context).context context = BaseContext(request, context).context
return render(request, template, context) return render(request, template, context)
@ -96,6 +98,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 Eco-Account"),
} }
context = BaseContext(request, context).context context = BaseContext(request, context).context
return render(request, template, context) return render(request, template, context)
@ -153,6 +156,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(acc.identifier),
} }
context = BaseContext(request, context).context context = BaseContext(request, context).context
return render(request, template, context) return render(request, template, context)
@ -223,6 +227,7 @@ def detail_view(request: HttpRequest, id: str):
"LANIS_LINK": acc.get_LANIS_link(), "LANIS_LINK": acc.get_LANIS_link(),
"deductions": deductions, "deductions": deductions,
"actions": actions, "actions": actions,
TAB_TITLE_IDENTIFIER: f"{acc.identifier} - {acc.title}",
} }
context = BaseContext(request, context).context context = BaseContext(request, context).context
return render(request, template, context) return render(request, template, context)
@ -546,10 +551,15 @@ def report_view(request:HttpRequest, id: str):
template = "compensation/report/eco_account/report.html" template = "compensation/report/eco_account/report.html"
acc = get_object_or_404(EcoAccount, id=id) acc = get_object_or_404(EcoAccount, id=id)
tab_title = _("Report {}").format(acc.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 acc.recorded: if not acc.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(
@ -586,6 +596,7 @@ def report_view(request:HttpRequest, id: str):
"parcels": parcels, "parcels": parcels,
"actions": actions, "actions": actions,
"deductions": deductions, "deductions": deductions,
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)

Binary file not shown.

@ -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-20 12:17+0100\n" "POT-Creation-Date: 2022-01-20 12:22+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"
@ -452,7 +452,7 @@ msgstr "Vereinbarungsdatum"
msgid "When did the parties agree on this?" msgid "When did the parties agree on this?"
msgstr "Wann wurde dieses Ökokonto offiziell vereinbart?" msgstr "Wann wurde dieses Ökokonto offiziell vereinbart?"
#: compensation/forms/forms.py:340 #: compensation/forms/forms.py:340 compensation/views/eco_account.py:101
msgid "New Eco-Account" msgid "New Eco-Account"
msgstr "Neues Ökokonto" msgstr "Neues Ökokonto"
@ -1067,11 +1067,12 @@ msgstr "Kompensation {} hinzugefügt"
msgid "Compensation {} edited" msgid "Compensation {} edited"
msgstr "Kompensation {} bearbeitet" msgstr "Kompensation {} bearbeitet"
#: compensation/views/compensation.py:156 intervention/views.py:309 #: compensation/views/compensation.py:156 compensation/views/eco_account.py:159
#: intervention/views.py:309
msgid "Edit {}" msgid "Edit {}"
msgstr "Bearbeite {}" msgstr "Bearbeite {}"
#: compensation/views/compensation.py:235 compensation/views/eco_account.py:309 #: compensation/views/compensation.py:235 compensation/views/eco_account.py:314
#: ema/views.py:183 intervention/views.py:482 #: ema/views.py:183 intervention/views.py:482
msgid "Log" msgid "Log"
msgstr "Log" msgstr "Log"
@ -1080,86 +1081,91 @@ msgstr "Log"
msgid "Compensation removed" msgid "Compensation removed"
msgstr "Kompensation entfernt" msgstr "Kompensation entfernt"
#: compensation/views/compensation.py:279 compensation/views/eco_account.py:461 #: compensation/views/compensation.py:279 compensation/views/eco_account.py:466
#: ema/views.py:350 intervention/views.py:132 #: ema/views.py:350 intervention/views.py:132
msgid "Document added" msgid "Document added"
msgstr "Dokument hinzugefügt" msgstr "Dokument hinzugefügt"
#: compensation/views/compensation.py:348 compensation/views/eco_account.py:355 #: compensation/views/compensation.py:348 compensation/views/eco_account.py:360
#: ema/views.py:288 #: ema/views.py:288
msgid "State added" msgid "State added"
msgstr "Zustand hinzugefügt" msgstr "Zustand hinzugefügt"
#: compensation/views/compensation.py:369 compensation/views/eco_account.py:376 #: compensation/views/compensation.py:369 compensation/views/eco_account.py:381
#: ema/views.py:309 #: ema/views.py:309
msgid "Action added" msgid "Action added"
msgstr "Maßnahme hinzugefügt" msgstr "Maßnahme hinzugefügt"
#: compensation/views/compensation.py:390 compensation/views/eco_account.py:441 #: compensation/views/compensation.py:390 compensation/views/eco_account.py:446
#: ema/views.py:330 #: ema/views.py:330
msgid "Deadline added" msgid "Deadline added"
msgstr "Frist/Termin hinzugefügt" msgstr "Frist/Termin hinzugefügt"
#: compensation/views/compensation.py:412 compensation/views/eco_account.py:398 #: compensation/views/compensation.py:412 compensation/views/eco_account.py:403
#: ema/views.py:420 #: ema/views.py:420
msgid "State removed" msgid "State removed"
msgstr "Zustand gelöscht" msgstr "Zustand gelöscht"
#: compensation/views/compensation.py:434 compensation/views/eco_account.py:420 #: compensation/views/compensation.py:434 compensation/views/eco_account.py:425
#: ema/views.py:442 #: ema/views.py:442
msgid "Action removed" msgid "Action removed"
msgstr "Maßnahme entfernt" msgstr "Maßnahme entfernt"
#: compensation/views/compensation.py:452 intervention/views.py:546 #: compensation/views/compensation.py:452 compensation/views/eco_account.py:554
#: intervention/views.py:546
msgid "Report {}" msgid "Report {}"
msgstr "Bericht {}" msgstr "Bericht {}"
#: compensation/views/eco_account.py:89 #: compensation/views/eco_account.py:58
msgid "Eco-account - Overview"
msgstr "Ökokonten - Übersicht"
#: compensation/views/eco_account.py:91
msgid "Eco-Account {} added" msgid "Eco-Account {} added"
msgstr "Ökokonto {} hinzugefügt" msgstr "Ökokonto {} hinzugefügt"
#: compensation/views/eco_account.py:146 #: compensation/views/eco_account.py:149
msgid "Eco-Account {} edited" msgid "Eco-Account {} edited"
msgstr "Ökokonto {} bearbeitet" msgstr "Ökokonto {} bearbeitet"
#: compensation/views/eco_account.py:257 #: compensation/views/eco_account.py:262
msgid "Eco-account removed" msgid "Eco-account removed"
msgstr "Ökokonto entfernt" msgstr "Ökokonto entfernt"
#: compensation/views/eco_account.py:285 #: compensation/views/eco_account.py:290
msgid "Deduction removed" msgid "Deduction removed"
msgstr "Abbuchung entfernt" msgstr "Abbuchung entfernt"
#: compensation/views/eco_account.py:330 ema/views.py:263 #: compensation/views/eco_account.py:335 ema/views.py:263
#: intervention/views.py:524 #: 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:335 ema/views.py:263
#: intervention/views.py:524 #: intervention/views.py:524
msgid "{} recorded" msgid "{} recorded"
msgstr "{} verzeichnet" msgstr "{} verzeichnet"
#: compensation/views/eco_account.py:531 intervention/views.py:505 #: compensation/views/eco_account.py:536 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:627 ema/views.py:520
#: intervention/views.py:380 #: 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:632 ema/views.py:525
#: intervention/views.py:385 #: 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:639 ema/views.py:532
#: intervention/views.py:392 #: 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:662 ema/views.py:555
#: intervention/views.py:415 #: intervention/views.py:415
msgid "Share settings updated" msgid "Share settings updated"
msgstr "Freigabe Einstellungen aktualisiert" msgstr "Freigabe Einstellungen aktualisiert"

Loading…
Cancel
Save