#26 Annual conservation reports

* enhances TimespanReportForm control rendering
* adds/updates translations
This commit is contained in:
mpeltriaux 2021-10-20 13:41:32 +02:00
parent 6b839b7f60
commit e22e390040
6 changed files with 47 additions and 41 deletions

View File

@ -65,6 +65,8 @@ class TimespanReportForm(BaseForm):
self.form_title = _("Generate report") self.form_title = _("Generate report")
self.form_caption = _("Select a timespan and the desired conservation office") self.form_caption = _("Select a timespan and the desired conservation office")
self.action_url = reverse("analysis:reports") self.action_url = reverse("analysis:reports")
self.show_cancel_btn = False
self.action_btn_label = _("Continue")
def save(self) -> str: def save(self) -> str:
""" Generates a redirect url for the detail report """ Generates a redirect url for the detail report

View File

@ -37,12 +37,14 @@ class BaseForm(forms.Form):
""" """
template = None template = None
action_url = None action_url = None
action_btn_label = _("Save")
form_title = None form_title = None
cancel_redirect = None cancel_redirect = None
form_caption = None form_caption = None
instance = None # The data holding model object instance = None # The data holding model object
form_attrs = {} # Holds additional attributes, that can be used in the template form_attrs = {} # Holds additional attributes, that can be used in the template
has_required_fields = False # Automatically set. Triggers hint rendering in templates has_required_fields = False # Automatically set. Triggers hint rendering in templates
show_cancel_btn = True
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
self.instance = kwargs.pop("instance", None) self.instance = kwargs.pop("instance", None)
@ -189,6 +191,7 @@ class BaseModalForm(BaseForm, BSModalForm):
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs) super().__init__(*args, **kwargs)
self.action_btn_label = _("Continue")
def process_request(self, request: HttpRequest, msg_success: str = _("Object removed"), msg_error: str = FORM_INVALID, redirect_url: str = None): def process_request(self, request: HttpRequest, msg_success: str = _("Object removed"), msg_error: str = FORM_INVALID, redirect_url: str = None):
""" Generic processing of request """ Generic processing of request

Binary file not shown.

View File

@ -11,15 +11,15 @@
#: intervention/forms/forms.py:53 intervention/forms/forms.py:155 #: intervention/forms/forms.py:53 intervention/forms/forms.py:155
#: intervention/forms/forms.py:167 intervention/forms/modalForms.py:107 #: intervention/forms/forms.py:167 intervention/forms/modalForms.py:107
#: intervention/forms/modalForms.py:120 intervention/forms/modalForms.py:133 #: intervention/forms/modalForms.py:120 intervention/forms/modalForms.py:133
#: konova/forms.py:140 konova/forms.py:244 konova/forms.py:310 #: konova/forms.py:142 konova/forms.py:246 konova/forms.py:312
#: konova/forms.py:337 konova/forms.py:347 konova/forms.py:360 #: konova/forms.py:339 konova/forms.py:349 konova/forms.py:362
#: konova/forms.py:372 konova/forms.py:393 user/forms.py:38 #: konova/forms.py:374 konova/forms.py:395 user/forms.py:38
#, fuzzy #, fuzzy
msgid "" 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: 2021-10-20 13:19+0200\n" "POT-Creation-Date: 2021-10-20 13:37+0200\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"
@ -29,15 +29,15 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: analysis/forms.py:26 analysis/templates/analysis/reports/detail.html:8 #: analysis/forms.py:24 analysis/templates/analysis/reports/detail.html:8
msgid "From" msgid "From"
msgstr "Vom" msgstr "Vom"
#: analysis/forms.py:38 #: analysis/forms.py:36
msgid "To" msgid "To"
msgstr "Bis" msgstr "Bis"
#: analysis/forms.py:49 compensation/forms/forms.py:93 #: analysis/forms.py:47 compensation/forms/forms.py:93
#: compensation/templates/compensation/detail/eco_account/view.html:58 #: compensation/templates/compensation/detail/eco_account/view.html:58
#: compensation/templates/compensation/report/eco_account/report.html:16 #: compensation/templates/compensation/report/eco_account/report.html:16
#: ema/templates/ema/detail/view.html:42 #: ema/templates/ema/detail/view.html:42
@ -47,22 +47,22 @@ msgstr "Bis"
msgid "Conservation office" msgid "Conservation office"
msgstr "Eintragungsstelle" msgstr "Eintragungsstelle"
#: analysis/forms.py:51 compensation/forms/forms.py:95 #: analysis/forms.py:49 compensation/forms/forms.py:95
msgid "Select the responsible office" msgid "Select the responsible office"
msgstr "Verantwortliche Stelle" msgstr "Verantwortliche Stelle"
#: analysis/forms.py:60 compensation/forms/forms.py:67 #: analysis/forms.py:58 compensation/forms/forms.py:67
#: compensation/forms/forms.py:104 compensation/forms/forms.py:155 #: compensation/forms/forms.py:104 compensation/forms/forms.py:155
#: intervention/forms/forms.py:63 intervention/forms/forms.py:80 #: intervention/forms/forms.py:63 intervention/forms/forms.py:80
#: intervention/forms/forms.py:96 intervention/forms/forms.py:112 #: intervention/forms/forms.py:96 intervention/forms/forms.py:112
msgid "Click for selection" msgid "Click for selection"
msgstr "Auswählen..." msgstr "Auswählen..."
#: analysis/forms.py:67 #: analysis/forms.py:65
msgid "Generate report" msgid "Generate report"
msgstr "Bericht generieren" msgstr "Bericht generieren"
#: analysis/forms.py:68 #: analysis/forms.py:66
msgid "Select a timespan and the desired conservation office" msgid "Select a timespan and the desired conservation office"
msgstr "Wählen Sie die Zeitspanne und die gewünschte Eintragungsstelle" msgstr "Wählen Sie die Zeitspanne und die gewünschte Eintragungsstelle"
@ -300,7 +300,7 @@ msgstr "Automatisch generiert"
#: intervention/templates/intervention/detail/includes/documents.html:28 #: intervention/templates/intervention/detail/includes/documents.html:28
#: intervention/templates/intervention/detail/view.html:31 #: intervention/templates/intervention/detail/view.html:31
#: intervention/templates/intervention/report/report.html:12 #: intervention/templates/intervention/report/report.html:12
#: konova/forms.py:336 #: konova/forms.py:338
msgid "Title" msgid "Title"
msgstr "Bezeichnung" msgstr "Bezeichnung"
@ -335,7 +335,7 @@ msgstr "Wählen Sie ggf. Fördermittelprojekte"
#: intervention/templates/intervention/detail/includes/documents.html:31 #: intervention/templates/intervention/detail/includes/documents.html:31
#: intervention/templates/intervention/detail/includes/payments.html:34 #: intervention/templates/intervention/detail/includes/payments.html:34
#: intervention/templates/intervention/detail/includes/revocation.html:38 #: intervention/templates/intervention/detail/includes/revocation.html:38
#: konova/forms.py:371 konova/templates/konova/comment_card.html:16 #: konova/forms.py:373 konova/templates/konova/comment_card.html:16
msgid "Comment" msgid "Comment"
msgstr "Kommentar" msgstr "Kommentar"
@ -422,7 +422,7 @@ msgstr "Zahlung wird an diesem Datum erwartet"
#: compensation/forms/modalForms.py:63 compensation/forms/modalForms.py:274 #: compensation/forms/modalForms.py:63 compensation/forms/modalForms.py:274
#: compensation/forms/modalForms.py:369 intervention/forms/modalForms.py:134 #: compensation/forms/modalForms.py:369 intervention/forms/modalForms.py:134
#: konova/forms.py:373 #: konova/forms.py:375
msgid "Additional comment, maximum {} letters" msgid "Additional comment, maximum {} letters"
msgstr "Zusätzlicher Kommentar, maximal {} Zeichen" msgstr "Zusätzlicher Kommentar, maximal {} Zeichen"
@ -462,7 +462,7 @@ msgstr "Geben Sie die Daten des neuen Zustandes ein"
msgid "Added state" msgid "Added state"
msgstr "Zustand hinzugefügt" msgstr "Zustand hinzugefügt"
#: compensation/forms/modalForms.py:190 konova/forms.py:193 #: compensation/forms/modalForms.py:190 konova/forms.py:195
msgid "Object removed" msgid "Object removed"
msgstr "Objekt entfernt" msgstr "Objekt entfernt"
@ -768,7 +768,7 @@ msgstr "Dokumente"
#: compensation/templates/compensation/detail/eco_account/includes/documents.html:14 #: compensation/templates/compensation/detail/eco_account/includes/documents.html:14
#: ema/templates/ema/detail/includes/documents.html:14 #: ema/templates/ema/detail/includes/documents.html:14
#: intervention/templates/intervention/detail/includes/documents.html:14 #: intervention/templates/intervention/detail/includes/documents.html:14
#: konova/forms.py:392 #: konova/forms.py:394
msgid "Add new document" msgid "Add new document"
msgstr "Neues Dokument hinzufügen" msgstr "Neues Dokument hinzufügen"
@ -1220,7 +1220,7 @@ msgstr "Datum des Widerspruchs"
msgid "Document" msgid "Document"
msgstr "Dokument" msgstr "Dokument"
#: intervention/forms/modalForms.py:122 konova/forms.py:361 #: intervention/forms/modalForms.py:122 konova/forms.py:363
msgid "Must be smaller than 15 Mb" msgid "Must be smaller than 15 Mb"
msgstr "Muss kleiner als 15 Mb sein" msgstr "Muss kleiner als 15 Mb sein"
@ -1242,7 +1242,7 @@ msgstr "Kompensationen und Zahlungen geprüft"
msgid "Run check" msgid "Run check"
msgstr "Prüfung vornehmen" msgstr "Prüfung vornehmen"
#: intervention/forms/modalForms.py:201 konova/forms.py:446 #: intervention/forms/modalForms.py:201 konova/forms.py:448
msgid "" msgid ""
"I, {} {}, confirm that all necessary control steps have been performed by " "I, {} {}, confirm that all necessary control steps have been performed by "
"myself." "myself."
@ -1466,64 +1466,68 @@ msgstr ""
"somit nichts eingeben, bearbeiten oder sonstige Aktionen ausführen. " "somit nichts eingeben, bearbeiten oder sonstige Aktionen ausführen. "
"Kontaktieren Sie bitte einen Administrator. +++" "Kontaktieren Sie bitte einen Administrator. +++"
#: konova/forms.py:69 #: konova/forms.py:40 templates/form/collapsable/form.html:62
msgid "Save"
msgstr "Speichern"
#: konova/forms.py:71
msgid "Not editable" msgid "Not editable"
msgstr "Nicht editierbar" msgstr "Nicht editierbar"
#: konova/forms.py:139 konova/forms.py:309 #: konova/forms.py:141 konova/forms.py:311
msgid "Confirm" msgid "Confirm"
msgstr "Bestätige" msgstr "Bestätige"
#: konova/forms.py:151 konova/forms.py:318 #: konova/forms.py:153 konova/forms.py:320
msgid "Remove" msgid "Remove"
msgstr "Löschen" msgstr "Löschen"
#: konova/forms.py:153 #: konova/forms.py:155
msgid "You are about to remove {} {}" msgid "You are about to remove {} {}"
msgstr "Sie sind dabei {} {} zu löschen" msgstr "Sie sind dabei {} {} zu löschen"
#: konova/forms.py:243 templates/form/collapsable/form.html:45 #: konova/forms.py:245 templates/form/collapsable/form.html:45
msgid "Geometry" msgid "Geometry"
msgstr "Geometrie" msgstr "Geometrie"
#: konova/forms.py:319 #: konova/forms.py:321
msgid "Are you sure?" msgid "Are you sure?"
msgstr "Sind Sie sicher?" msgstr "Sind Sie sicher?"
#: konova/forms.py:346 #: konova/forms.py:348
msgid "Created on" msgid "Created on"
msgstr "Erstellt" msgstr "Erstellt"
#: konova/forms.py:348 #: konova/forms.py:350
msgid "When has this file been created? Important for photos." msgid "When has this file been created? Important for photos."
msgstr "Wann wurde diese Datei erstellt oder das Foto aufgenommen?" msgstr "Wann wurde diese Datei erstellt oder das Foto aufgenommen?"
#: konova/forms.py:359 #: konova/forms.py:361
#: venv/lib/python3.7/site-packages/django/db/models/fields/files.py:231 #: venv/lib/python3.7/site-packages/django/db/models/fields/files.py:231
msgid "File" msgid "File"
msgstr "Datei" msgstr "Datei"
#: konova/forms.py:423 #: konova/forms.py:425
msgid "Added document" msgid "Added document"
msgstr "Dokument hinzugefügt" msgstr "Dokument hinzugefügt"
#: konova/forms.py:437 #: konova/forms.py:439
msgid "Confirm record" msgid "Confirm record"
msgstr "Verzeichnen bestätigen" msgstr "Verzeichnen bestätigen"
#: konova/forms.py:445 #: konova/forms.py:447
msgid "Record data" msgid "Record data"
msgstr "Daten verzeichnen" msgstr "Daten verzeichnen"
#: konova/forms.py:452 #: konova/forms.py:454
msgid "Confirm unrecord" msgid "Confirm unrecord"
msgstr "Entzeichnen bestätigen" msgstr "Entzeichnen bestätigen"
#: konova/forms.py:453 #: konova/forms.py:455
msgid "Unrecord data" msgid "Unrecord data"
msgstr "Daten entzeichnen" msgstr "Daten entzeichnen"
#: konova/forms.py:454 #: konova/forms.py:456
msgid "I, {} {}, confirm that this data must be unrecorded." msgid "I, {} {}, confirm that this data must be unrecorded."
msgstr "" msgstr ""
"Ich, {} {}, bestätige, dass diese Daten wieder entzeichnet werden müssen." "Ich, {} {}, bestätige, dass diese Daten wieder entzeichnet werden müssen."
@ -1721,15 +1725,10 @@ msgid "General data"
msgstr "Allgemeine Daten" msgstr "Allgemeine Daten"
#: templates/form/collapsable/form.html:58 #: templates/form/collapsable/form.html:58
#: templates/form/table/generic_table_form.html:23 #: templates/form/table/generic_table_form.html:24
msgid "Cancel" msgid "Cancel"
msgstr "Abbrechen" msgstr "Abbrechen"
#: templates/form/collapsable/form.html:62
#: templates/form/table/generic_table_form.html:27
msgid "Save"
msgstr "Speichern"
#: templates/form/table/generic_table_form_body.html:24 #: templates/form/table/generic_table_form_body.html:24
msgid "Fields with * are required." msgid "Fields with * are required."
msgstr "* sind Pflichtfelder." msgstr "* sind Pflichtfelder."

View File

@ -19,12 +19,14 @@
{% include 'form/table/generic_table_form_body.html' %} {% include 'form/table/generic_table_form_body.html' %}
<div class="row"> <div class="row">
<div class="col-6"> <div class="col-6">
{% if form.show_cancel_btn %}
<a href="{{ form.cancel_redirect }}"> <a href="{{ form.cancel_redirect }}">
<button class="btn btn-default" type="button" title="{% trans 'Cancel' %}">{% trans 'Cancel' %}</button> <button class="btn btn-default" type="button" title="{% trans 'Cancel' %}">{% trans 'Cancel' %}</button>
</a> </a>
{% endif %}
</div> </div>
<div class="col-6 d-flex justify-content-end"> <div class="col-6 d-flex justify-content-end">
<button class="btn btn-default" type="submit" title="{% trans 'Save' %}">{% trans 'Save' %}</button> <button class="btn btn-default" type="submit" title="{{form.action_btn_label}}">{{form.action_btn_label}}</button>
</div> </div>
</div> </div>
</form> </form>

View File

@ -22,7 +22,7 @@
</div> </div>
{% if form.render_submit %} {% if form.render_submit %}
<div class="modal-footer"> <div class="modal-footer">
<button type="submit" class="btn btn-default">{% trans 'Continue' %}</button> <button type="submit" class="btn btn-default" title="{{form.action_btn_label}}">{{form.action_btn_label}}</button>
</div> </div>
{% endif %} {% endif %}
</form> </form>