From c94d73c03797ff2822f0b7a0cc2fe26e159d6665 Mon Sep 17 00:00:00 2001 From: mipel Date: Thu, 19 Aug 2021 14:39:28 +0200 Subject: [PATCH] EMA Filter * refactors EmaTableFilter to inherit from EcoAccountFilter * refactors messages for recording/unrecording of EMA * adds/updates translations --- ema/filters.py | 41 +++----------------------------- ema/views.py | 3 ++- locale/de/LC_MESSAGES/django.mo | Bin 18840 -> 19291 bytes locale/de/LC_MESSAGES/django.po | 34 +++++++++++++------------- 4 files changed, 21 insertions(+), 57 deletions(-) diff --git a/ema/filters.py b/ema/filters.py index 308f14ef..2817d6dc 100644 --- a/ema/filters.py +++ b/ema/filters.py @@ -7,47 +7,12 @@ Created on: 19.08.21 """ from django.db.models import QuerySet -from compensation.filters import CompensationTableFilter +from compensation.filters import EcoAccountTableFilter -class EmaTableFilter(CompensationTableFilter): +class EmaTableFilter(EcoAccountTableFilter): """ Since EMA and compensation are basically the same, we can reuse CompensationTableFilter and extend the MAE filter in the future by inheriting. """ - - def _filter_show_all(self, queryset, name, value) -> QuerySet: - """ Filters queryset depending on value of 'show_all' setting - - Args: - queryset (): - name (): - value (): - - Returns: - - """ - if not value: - return queryset.filter( - users__in=[self.user], # requesting user has access - ) - else: - return queryset - - def _filter_show_recorded(self, queryset, name, value) -> QuerySet: - """ Filters queryset depending on value of 'show_recorded' setting - - Args: - queryset (): - name (): - value (): - - Returns: - - """ - if not value: - return queryset.filter( - recorded=None, - ) - else: - return queryset \ No newline at end of file + pass \ No newline at end of file diff --git a/ema/views.py b/ema/views.py index 2f6a6650..31103308 100644 --- a/ema/views.py +++ b/ema/views.py @@ -167,10 +167,11 @@ def record_view(request: HttpRequest, id: str): """ ema = get_object_or_404(Ema, id=id) + msg_succ = _("{} unrecorded") if ema.recorded else _("{} recorded") form = RecordForm(request.POST or None, instance=ema, user=request.user) return form.process_request( request=request, - msg_success=_("EMA recorded"), + msg_success=msg_succ.format("EMA"), ) diff --git a/locale/de/LC_MESSAGES/django.mo b/locale/de/L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lN8<>o{Q3Jh-rFp))NkI=N!jc&Jj5qQ~)EZX7T9}Fn*aP)8 zyn>qHbgR!nA9Wqe2)*MvPI?6X8%M=N;uAt2HGdXA{zd%%@rG3v;!jrIh<_l;@`Rqa zg6Kf#SVPPwwi4eG6NutN--Sg)S7Memp2E6b+3)sKc#{}MZ1Ni2dDLrDiHFrh{pXa9 zBgEf{5MmxteEg2WErLDi9ug$dT_Ju&v?ulu{~@jtI(*h&w9n6uq#>NhBVHoPa8jS+ z4~YAO)@nBKZ{kIwFY$oTUMR`6DX3#A@i(Fwahu@l?0!#-CPos)$4&~N#4pvr^WBFk z*f9uyB(%OdHWOz8C2#GYwenZ^Pb-UVRvvFoHh<1qYuJWig#Yo+uGm4nK5>``CN2}z z32jVm#yP|cLPrd~LdQXmz|VU8)W>NcaVXH@eTFYlenLcB+c5JQHYQ#rRuknI+;J?0 z`RG5#kK&^Vg})G!h&n_R@h9Rl;(KB!@dNQCp<@)0O$5_f9EM}@5pRWy_%ZP*kxKlL zm_}44f_&uvG=<^BZX%Kn(s3UVVV$K>*70W#_YwB8a(7%$OefA-+X7Tp4-iwVEtJ02 zQGSkSVQt3(a^*7=23TV;IaWA<<+-`3)yv`yD=#+R!QWbW2wu1H`}nfT+#h9=DS;*I z{O73O4X%eZ`~zc%rB)ZUh_P0$z|D`W+#E|0gNg6dmYdk9V!@A\n" "Language-Team: LANGUAGE \n" @@ -656,23 +656,23 @@ msgid "Compensation removed" msgstr "Kompensation entfernt" #: compensation/views/compensation_views.py:162 -#: compensation/views/eco_account_views.py:283 ema/views.py:248 +#: compensation/views/eco_account_views.py:283 ema/views.py:249 #: intervention/views.py:93 msgid "Document added" msgstr "Dokument hinzugefügt" #: compensation/views/compensation_views.py:181 -#: compensation/views/eco_account_views.py:227 ema/views.py:192 +#: compensation/views/eco_account_views.py:227 ema/views.py:193 msgid "State added" msgstr "Zustand hinzugefügt" #: compensation/views/compensation_views.py:200 -#: compensation/views/eco_account_views.py:246 ema/views.py:211 +#: compensation/views/eco_account_views.py:246 ema/views.py:212 msgid "Action added" msgstr "Maßnahme hinzugefügt" #: compensation/views/compensation_views.py:219 -#: compensation/views/eco_account_views.py:265 ema/views.py:230 +#: compensation/views/eco_account_views.py:265 ema/views.py:231 msgid "Deadline added" msgstr "Frist/Termin hinzugefügt" @@ -692,11 +692,13 @@ msgstr "Ökokonto entfernt" msgid "Withdraw removed" msgstr "Abbuchung entfernt" -#: compensation/views/eco_account_views.py:204 intervention/views.py:376 +#: compensation/views/eco_account_views.py:204 ema/views.py:170 +#: intervention/views.py:376 msgid "{} unrecorded" msgstr "{} entzeichnet" -#: compensation/views/eco_account_views.py:204 intervention/views.py:376 +#: compensation/views/eco_account_views.py:204 ema/views.py:170 +#: intervention/views.py:376 msgid "{} recorded" msgstr "{} verzeichnet" @@ -733,16 +735,8 @@ msgid "Payment funded compensation" msgstr "Ersatzzahlungsmaßnahme" #: ema/views.py:153 -#, fuzzy -#| msgid "{} removed" msgid "EMA removed" -msgstr "{} entfernt" - -#: ema/views.py:173 -#, fuzzy -#| msgid "{} recorded" -msgid "EMA recorded" -msgstr "{} verzeichnet" +msgstr "EMA entfernt" #: intervention/filters.py:25 msgid "Show unshared" @@ -909,6 +903,7 @@ msgid "" "Eco-account {} is not recorded yet. You can only withdraw from recorded " "accounts." msgstr "" +"Ökokonto {} ist noch nicht verzeichnet. Abbuchungen können nur von verzeichneten Ökokonten erfolgen." #: intervention/forms.py:544 msgid "" @@ -1248,11 +1243,11 @@ msgstr "{} geprüft" #: konova/utils/messenger.py:71 msgid "Check it out" -msgstr "" +msgstr "Schauen Sie rein" #: konova/utils/messenger.py:72 msgid "{} has been checked successfully by user {}! {}" -msgstr "" +msgstr "{} wurde erfolgreich vom Nutzer {} geprüft! {}" #: konova/views.py:138 msgid "Document '{}' deleted" @@ -2670,6 +2665,9 @@ msgstr "" msgid "A fontawesome icon field" msgstr "" +#~ msgid "EMA recorded" +#~ msgstr "EMA verzeichnet" + #~ msgid "Edit {}" #~ msgstr "Bearbeite {}"