From fd0976c79b9db71c3cb7018dd4b56975e6914d96 Mon Sep 17 00:00:00 2001 From: "holger.trampe" Date: Wed, 16 Dec 2020 19:22:05 +0100 Subject: [PATCH] =?UTF-8?q?Zeiterfassung=20zur=C3=BCcksetzen=20und=20Ausga?= =?UTF-8?q?ngsarbeitstage=20hinzugef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dasettings/forms.py | 4 +- .../templates/dasettings/user_usprof.html | 93 +++++++++++++++++- dasettings/views.py | 16 ++- .../__pycache__/counter_tag.cpython-38.pyc | Bin 20193 -> 20244 bytes standards/templatetags/counter_tag.py | 5 +- users/models.py | 1 + 6 files changed, 110 insertions(+), 9 deletions(-) diff --git a/dasettings/forms.py b/dasettings/forms.py index 1cfe334..cde0882 100644 --- a/dasettings/forms.py +++ b/dasettings/forms.py @@ -334,9 +334,10 @@ class UserTimeForm(forms.ModelForm): "wd_sa" : "Samstag", "wd_so" : "Sonntag", "usetime" : "Zeiterfassung" , + "startcount" : "Bisheriges Gleitzeitkonto", "usetime_start" : "Zeiterfassung ab" } - fields = ["startdate", "usetime", "usetime_start", "wd_mo", "wd_tu", "wd_we", "wd_th", "wd_fr", "wd_sa", "wd_so", "loose_holidedate"] + fields = ["startcount", "startdate", "usetime", "usetime_start", "wd_mo", "wd_tu", "wd_we", "wd_th", "wd_fr", "wd_sa", "wd_so", "loose_holidedate"] widgets = { "startdate" : DatePickerInput(options={"format":'DD.MM.YYYY', "locale":'de'}), "usetime_start" : DatePickerInput(options={"format":'DD.MM.YYYY', "locale":'de'}) @@ -346,6 +347,7 @@ class UserTimeForm(forms.ModelForm): super().__init__(*args, **kwargs) self.fields['startdate'].required = True self.fields['usetime_start'].required = False + self.fields['startcount'].required = False self.fields['usetime'].required = False #self.fields['usetime'].widget.attrs['readonly'] = True #self.fields['usetime_start'].widget.attrs['readonly'] = True diff --git a/dasettings/templates/dasettings/user_usprof.html b/dasettings/templates/dasettings/user_usprof.html index ca993b0..b0bf7cf 100644 --- a/dasettings/templates/dasettings/user_usprof.html +++ b/dasettings/templates/dasettings/user_usprof.html @@ -166,13 +166,25 @@
Zeiterfassung 
-
+
{{usertime_form.usetime|as_crispy_field}}
-
+
{{usertime_form.usetime_start|as_crispy_field}}
-
+
+ {{usertime_form.startcount|as_crispy_field}} +
+ {% if usertochangefull.usertime.usetime %} +
+ Zurücksetzen + {% if request.user.profile.showtooltips %} {% endif %} +
+ +
+ {% endif %} +
+ + + + + + + + + +