diff --git a/analysis/templates/analysis/reports/includes/intervention/amount.html b/analysis/templates/analysis/reports/includes/intervention/amount.html index a146d4b2..8ecbe018 100644 --- a/analysis/templates/analysis/reports/includes/intervention/amount.html +++ b/analysis/templates/analysis/reports/includes/intervention/amount.html @@ -1,4 +1,4 @@ -{% load i18n fontawesome_5 %} +{% load i18n fontawesome_5 ksp_filters %}

{% trans 'Amount' %}

@@ -21,9 +21,9 @@ - {{report.intervention_report.queryset.count}} - {{report.intervention_report.queryset_checked.count}} - {{report.intervention_report.queryset_recorded.count}} + {{report.intervention_report.queryset.count|default_if_zero:"-"}} + {{report.intervention_report.queryset_checked.count|default_if_zero:"-"}} + {{report.intervention_report.queryset_recorded.count|default_if_zero:"-"}} diff --git a/analysis/templates/analysis/reports/includes/intervention/card_intervention.html b/analysis/templates/analysis/reports/includes/intervention/card_intervention.html index 13c22892..6a9993a3 100644 --- a/analysis/templates/analysis/reports/includes/intervention/card_intervention.html +++ b/analysis/templates/analysis/reports/includes/intervention/card_intervention.html @@ -16,9 +16,9 @@
{% include 'analysis/reports/includes/intervention/amount.html' %}
- {% include 'analysis/reports/includes/intervention/laws.html' %} -
{% include 'analysis/reports/includes/intervention/compensated_by.html' %} +
+ {% include 'analysis/reports/includes/intervention/laws.html' %}
diff --git a/analysis/templates/analysis/reports/includes/intervention/compensated_by.html b/analysis/templates/analysis/reports/includes/intervention/compensated_by.html index 87dfc570..8608f113 100644 --- a/analysis/templates/analysis/reports/includes/intervention/compensated_by.html +++ b/analysis/templates/analysis/reports/includes/intervention/compensated_by.html @@ -1,4 +1,4 @@ -{% load i18n fontawesome_5 %} +{% load i18n fontawesome_5 ksp_filters %}

{% trans 'Compensated by' %}

@@ -13,21 +13,21 @@ - - - + + + - - - + + + - - - + + +
{% trans 'Compensation' %}{{report.intervention_report.compensation_sum}}{{report.intervention_report.compensation_sum_checked}}{{report.intervention_report.compensation_sum_recorded}}{{report.intervention_report.compensation_sum|default_if_zero:"-"}}{{report.intervention_report.compensation_sum_checked|default_if_zero:"-"}}{{report.intervention_report.compensation_sum_recorded|default_if_zero:"-"}}
{% trans 'Payment' %}{{report.intervention_report.payment_sum}}{{report.intervention_report.payment_sum_checked}}{{report.intervention_report.payment_sum_recorded}}{{report.intervention_report.payment_sum|default_if_zero:"-"}}{{report.intervention_report.payment_sum_checked|default_if_zero:"-"}}{{report.intervention_report.payment_sum_recorded|default_if_zero:"-"}}
{% trans 'Deductions' %}{{report.intervention_report.deduction_sum}}{{report.intervention_report.deduction_sum_checked}}{{report.intervention_report.deduction_sum_recorded}}{{report.intervention_report.deduction_sum|default_if_zero:"-"}}{{report.intervention_report.deduction_sum_checked|default_if_zero:"-"}}{{report.intervention_report.deduction_sum_recorded|default_if_zero:"-"}}
diff --git a/analysis/templates/analysis/reports/includes/intervention/laws.html b/analysis/templates/analysis/reports/includes/intervention/laws.html index d373c681..8e04341c 100644 --- a/analysis/templates/analysis/reports/includes/intervention/laws.html +++ b/analysis/templates/analysis/reports/includes/intervention/laws.html @@ -1,4 +1,4 @@ -{% load i18n fontawesome_5 %} +{% load i18n fontawesome_5 ksp_filters %}

{% trans 'Law usage' %}

{% blocktrans %} @@ -34,16 +34,16 @@ {{law.long_name}} - {{law.num_checked}} - {{law.num_recorded}} - {{law.num}} + {{law.num_checked|default_if_zero:"-"}} + {{law.num_recorded|default_if_zero:"-"}} + {{law.num|default_if_zero:"-"}} {% endfor %} {% trans 'Total' %} - {{report.intervention_report.law_sum_checked}} - {{report.intervention_report.law_sum_recorded}} - {{report.intervention_report.law_sum}} + {{report.intervention_report.law_sum_checked|default_if_zero:"-"}} + {{report.intervention_report.law_sum_recorded|default_if_zero:"-"}} + {{report.intervention_report.law_sum|default_if_zero:"-"}} diff --git a/konova/templatetags/ksp_filters.py b/konova/templatetags/ksp_filters.py index 95fc7ea0..1472d503 100644 --- a/konova/templatetags/ksp_filters.py +++ b/konova/templatetags/ksp_filters.py @@ -34,3 +34,19 @@ def bootstrap_cls(value): """ return SVI_BOOTSTRAP_CLS_MAP.get(value, "") + + +@register.filter("default_if_zero") +def default_if_zero(val1, val2): + """ Returns val2 if val1 is 0 + + Similar to default_if_none + + Args: + val1 (int): The numerical value + val2 (str): The alternative + + Returns: + + """ + return val1 if val1 > 0 else val2 diff --git a/locale/de/LC_MESSAGES/django.mo b/locale/de/LC_MESSAGES/django.mo index c65e66dc..9b21d9f7 100644 Binary files a/locale/de/LC_MESSAGES/django.mo and b/locale/de/LC_MESSAGES/django.mo differ diff --git a/locale/de/LC_MESSAGES/django.po b/locale/de/LC_MESSAGES/django.po index f02eced3..7c47ddac 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-18 14:59+0200\n" +"POT-Creation-Date: 2021-10-19 08:40+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -48,39 +48,54 @@ msgstr "Kompensationen" msgid "Eco-Accounts" msgstr "Ökokonten" -#: analysis/templates/analysis/reports/includes/card_intervention.html:10 -#: intervention/tables.py:66 -msgid "Interventions" -msgstr "Eingriffe" +#: analysis/templates/analysis/reports/includes/card_old_interventions.html:11 +msgid "Old interventions" +msgstr "Altfälle" -#: analysis/templates/analysis/reports/includes/card_intervention.html:17 -msgid "Total interventions" +#: analysis/templates/analysis/reports/includes/card_old_interventions.html:13 +msgid "Before" +msgstr "Vor" + +#: analysis/templates/analysis/reports/includes/intervention/amount.html:3 +#: compensation/forms/modalForms.py:351 +#: compensation/templates/compensation/detail/eco_account/includes/deductions.html:34 +#: intervention/templates/intervention/detail/includes/deductions.html:31 +msgid "Amount" +msgstr "Menge" + +#: analysis/templates/analysis/reports/includes/intervention/amount.html:5 +msgid "" +"\n" +" Checked = Has been checked by the registration office according to " +"LKompVzVo\n" +" " +msgstr "" +"\n" +" Geprüft = Wurde von der zuständigen Zulassungsbehörde überprüft\n" +" " + +#: analysis/templates/analysis/reports/includes/intervention/amount.html:9 +msgid "" +"\n" +" Recorded = Has been checked and published by the conservation office\n" +" " +msgstr "" +"\n" +" Verzeichnet = Wurde von der Eintragungsstelle überprüft und veröffentlicht\n" +" " + +#: analysis/templates/analysis/reports/includes/intervention/amount.html:17 +#: analysis/templates/analysis/reports/includes/intervention/compensated_by.html:8 +#: analysis/templates/analysis/reports/includes/intervention/laws.html:23 +#: analysis/templates/analysis/reports/includes/intervention/laws.html:43 +#: konova/templates/konova/home.html:23 konova/templates/konova/home.html:61 +#: konova/templates/konova/home.html:100 +msgid "Total" msgstr "Insgesamt" -#: analysis/templates/analysis/reports/includes/card_intervention.html:22 -msgid "Amount total" -msgstr "Anzahl insgesamt" - -#: analysis/templates/analysis/reports/includes/card_intervention.html:26 -msgid "Amount checked" -msgstr "Anzahl geprüft" - -#: analysis/templates/analysis/reports/includes/card_intervention.html:30 -msgid "Amount recorded" -msgstr "Anzahl verzeichnet" - -#: analysis/templates/analysis/reports/includes/card_intervention.html:37 -msgid "Law usage" -msgstr "Gesetzesanwendungen" - -#: analysis/templates/analysis/reports/includes/card_intervention.html:43 -#: intervention/forms/forms.py:68 -#: intervention/templates/intervention/detail/view.html:39 -#: intervention/templates/intervention/report/report.html:20 -msgid "Law" -msgstr "Gesetz" - -#: analysis/templates/analysis/reports/includes/card_intervention.html:46 +#: analysis/templates/analysis/reports/includes/intervention/amount.html:18 +#: analysis/templates/analysis/reports/includes/intervention/compensated_by.html:9 +#: analysis/templates/analysis/reports/includes/intervention/laws.html:17 #: compensation/tables.py:35 #: compensation/templates/compensation/detail/compensation/view.html:43 #: intervention/tables.py:33 @@ -88,7 +103,9 @@ msgstr "Gesetz" msgid "Checked" msgstr "Geprüft" -#: analysis/templates/analysis/reports/includes/card_intervention.html:49 +#: analysis/templates/analysis/reports/includes/intervention/amount.html:19 +#: analysis/templates/analysis/reports/includes/intervention/compensated_by.html:10 +#: analysis/templates/analysis/reports/includes/intervention/laws.html:20 #: compensation/tables.py:41 compensation/tables.py:181 #: compensation/templates/compensation/detail/compensation/view.html:57 #: compensation/templates/compensation/detail/eco_account/includes/deductions.html:31 @@ -99,29 +116,58 @@ msgstr "Geprüft" msgid "Recorded" msgstr "Verzeichnet" -#: analysis/templates/analysis/reports/includes/card_intervention.html:52 -#: analysis/templates/analysis/reports/includes/card_intervention.html:72 -#: konova/templates/konova/home.html:23 konova/templates/konova/home.html:61 -#: konova/templates/konova/home.html:100 -msgid "Total" -msgstr "Insgesamt" +#: analysis/templates/analysis/reports/includes/intervention/card_intervention.html:10 +#: intervention/tables.py:66 +msgid "Interventions" +msgstr "Eingriffe" -#: analysis/templates/analysis/reports/includes/card_intervention.html:81 +#: analysis/templates/analysis/reports/includes/intervention/compensated_by.html:2 +msgid "Compensated by" +msgstr "Kompensiert durch" + +#: analysis/templates/analysis/reports/includes/intervention/compensated_by.html:7 +msgid "Compensation type" +msgstr "Kompensationsart" + +#: analysis/templates/analysis/reports/includes/intervention/compensated_by.html:15 +#: compensation/tables.py:84 +#: compensation/templates/compensation/detail/compensation/view.html:19 +#: konova/templates/konova/home.html:49 templates/navbars/navbar.html:28 +msgid "Compensation" +msgstr "Kompensation" + +#: analysis/templates/analysis/reports/includes/intervention/compensated_by.html:21 +#: compensation/forms/modalForms.py:75 +msgid "Payment" +msgstr "Zahlung" + +#: analysis/templates/analysis/reports/includes/intervention/compensated_by.html:27 +msgid "Deductions" +msgstr "Abbuchungen" + +#: analysis/templates/analysis/reports/includes/intervention/laws.html:2 +msgid "Law usage" +msgstr "Gesetzesanwendungen" + +#: analysis/templates/analysis/reports/includes/intervention/laws.html:4 msgid "" "\n" -" Please note: One intervention can be based on " -"multiple laws. This table therefore does not\n" -" count\n" -" " +" Please note: One intervention can be based on multiple laws. This table " +"therefore does not\n" +" count\n" +" " msgstr "" +"\n" +" Beachten Sie: Ein Eingriff kann mehreren Gesetzen zugeordnet worden sein. Diese Tabelle zählt daher nicht die Eingriffe selbst " +", sondern wie oft ein Gesetz Anwendung fand.\n" +" " -#: analysis/templates/analysis/reports/includes/card_old_interventions.html:11 -msgid "Old interventions" -msgstr "Altfälle" - -#: analysis/templates/analysis/reports/includes/card_old_interventions.html:13 -msgid "Before" -msgstr "Vor" +#: analysis/templates/analysis/reports/includes/intervention/laws.html:14 +#: intervention/forms/forms.py:68 +#: intervention/templates/intervention/detail/view.html:39 +#: intervention/templates/intervention/report/report.html:20 +msgid "Law" +msgstr "Gesetz" #: analysis/templates/analysis/reports/index.html:6 #: templates/navbars/navbar.html:46 @@ -306,10 +352,6 @@ msgstr "Zahlung wird an diesem Datum erwartet" msgid "Additional comment, maximum {} letters" msgstr "Zusätzlicher Kommentar, maximal {} Zeichen" -#: compensation/forms/modalForms.py:75 -msgid "Payment" -msgstr "Zahlung" - #: compensation/forms/modalForms.py:76 msgid "Add a payment for intervention '{}'" msgstr "Neue Ersatzzahlung zu Eingriff '{}' hinzufügen" @@ -435,12 +477,6 @@ msgstr "Einheit" msgid "Select the unit" msgstr "Einheit wählen" -#: compensation/forms/modalForms.py:351 -#: compensation/templates/compensation/detail/eco_account/includes/deductions.html:34 -#: intervention/templates/intervention/detail/includes/deductions.html:31 -msgid "Amount" -msgstr "Menge" - #: compensation/forms/modalForms.py:354 msgid "Insert the amount" msgstr "Menge eingeben" @@ -511,12 +547,6 @@ msgstr "Zuletzt bearbeitet" msgid "Open {}" msgstr "Öffne {}" -#: compensation/tables.py:84 -#: compensation/templates/compensation/detail/compensation/view.html:19 -#: konova/templates/konova/home.html:49 templates/navbars/navbar.html:28 -msgid "Compensation" -msgstr "Kompensation" - #: compensation/tables.py:105 intervention/tables.py:107 msgid "Not checked yet" msgstr "Noch nicht geprüft" @@ -781,7 +811,7 @@ msgstr "Gefördert mit" #: intervention/templates/intervention/report/report.html:57 #: intervention/templates/intervention/report/report.html:78 msgid "None" -msgstr "" +msgstr "-" #: compensation/templates/compensation/detail/compensation/view.html:84 #: compensation/templates/compensation/detail/eco_account/view.html:83 @@ -834,8 +864,6 @@ msgid "Created" msgstr "Erstellt" #: compensation/templates/compensation/detail/eco_account/includes/deductions.html:54 -#, fuzzy -#| msgid "Recorded on " msgid "Recorded on" msgstr "Verzeichnet am" @@ -3001,6 +3029,18 @@ msgstr "" msgid "A fontawesome icon field" msgstr "" +#~ msgid "Total interventions" +#~ msgstr "Insgesamt" + +#~ msgid "Amount total" +#~ msgstr "Anzahl insgesamt" + +#~ msgid "Amount checked" +#~ msgstr "Anzahl geprüft" + +#~ msgid "Amount recorded" +#~ msgstr "Anzahl verzeichnet" + #~ msgid "Funding by..." #~ msgstr "Gefördert mit..."