From 0de2a48c9e9fc555663c156c77ddff485cc17405 Mon Sep 17 00:00:00 2001 From: Holger Trampe Date: Wed, 29 Jul 2020 13:45:34 +0200 Subject: [PATCH] =?UTF-8?q?Zeiterfassung=20bis=20auf=20Bearbeiten=20durch?= =?UTF-8?q?=20andere=20Mitarbeiter=20fertig=20f=C3=BCr=20Betatest?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../templates/dasettings/user_content.html | 34 +- requirements.txt | 10 + .../timemanagement_management.html | 126 +++++- timemanagement/views.py | 3 +- users/templates/users/base.html | 208 +++++---- users/templates/users/publicbase.html | 34 +- users/views.py | 426 ++++++++++-------- 7 files changed, 503 insertions(+), 338 deletions(-) diff --git a/dasettings/templates/dasettings/user_content.html b/dasettings/templates/dasettings/user_content.html index 5746f07..b37f033 100644 --- a/dasettings/templates/dasettings/user_content.html +++ b/dasettings/templates/dasettings/user_content.html @@ -1,15 +1,16 @@ {% load counter_tag %}  Mitarbeiter
-
-
+
+
- - + + + @@ -21,21 +22,33 @@ {% for item in usersofagency %} - + + - {% endfor %} - + {% endfor %} +
VornameNachnameVornameNachname E-Mail AgenturfunktionGleitzeit Letzter Login Tätigkeit Telefon
{{item.first_name }}{{ item.last_name }}{{ item.last_name }} {{ item.email }} {% if item.profile.func == None %}-{%else%}{{ item.profile.func }}{%endif%} + {% if item.usertime.usetime %} + {% loadaccounttime item as actualaccounttime %} + {% if actualaccounttime.1 == 0 %} + +{{actualaccounttime.0}} + {% else %} + -{{actualaccounttime.0}} + {% endif %} + {% else %} + - + {% endif %} + {% if item.last_login != Nonte %}{{ item.last_login }}{% endif %} {{ item.profile.compfunc }} {{ item.profile.phoneland }} {{ item.profile.phonemobile }} - {% if item != request.user %} + {% if item != request.user %} {% endif %}
@@ -51,7 +64,7 @@ - diff --git a/requirements.txt b/requirements.txt index 6d749d6..30f643d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -17,3 +17,13 @@ six==1.13.0 sqlparse==0.3.0 urllib3==1.25.7 webcolors==1.10 +django-summernote==0.8.11.6 +django-mathfilters==1.0.0 +django-cleanup==5.0.0 +django-user-agents==0.4.0 +djangorestframework==3.11.0 +django-channels==0.7.0 +django-channels-presence==1.0.0 +django-cryptography==1.0 +channels-redis==3.0.1 +filetype==1.0.7 diff --git a/timemanagement/templates/timemanagement/timemanagement_management.html b/timemanagement/templates/timemanagement/timemanagement_management.html index 54d01df..61e9288 100644 --- a/timemanagement/templates/timemanagement/timemanagement_management.html +++ b/timemanagement/templates/timemanagement/timemanagement_management.html @@ -20,9 +20,7 @@
@@ -63,14 +61,129 @@ {% if abday.start == da%} {% if abday.startday_info == "1" %} (nur Vormittags) + {% for workday in workdays %} + {% if workday.start|date:"d-m-y" == da|date:"d-m-y" %} +
+ {{workday.start|date:"H:i"}} - {{workday.end|date:"H:i"}}, + {% getsumworkdayexcludebreak workday as sumworkday %} + {{ sumworkday }}, + {% getsumbreak workday as sumbreakofday %} + {{sumbreakofday}} min. ({{workday.breaks.all|length}}), + {% getsumworkday workday as sumwd %} + {{sumwd}}, + {% gettimeoveralldiff workday user as erg%} + {% if erg.1 == 0 %} + +{{erg.0}} + {% elif erg.1 == 1 %} + {{erg.0}} + {% else %} + -{{erg.0}} + {% endif %} + + {% if breakmonthline < da %} + + + {% endif %} + {% endif %} + {% endfor %} + + + {% elif abday.startday_info == "2" %} (nur Nachmittags) + + {% for workday in workdays %} + {% if workday.start|date:"d-m-y" == da|date:"d-m-y" %} +
+ {{workday.start|date:"H:i"}} - {{workday.end|date:"H:i"}} + {% getsumworkdayexcludebreak workday as sumworkday %} + {{ sumworkday }}, + {% getsumbreak workday as sumbreakofday %} + {{sumbreakofday}} min. ({{workday.breaks.all|length}}), + {% getsumworkday workday as sumwd %} + {{sumwd}}, + {% gettimeoveralldiff workday user as erg%} + {% if erg.1 == 0 %} + +{{erg.0}} + {% elif erg.1 == 1 %} + {{erg.0}} + {% else %} + -{{erg.0}} + {% endif %} + + {% if breakmonthline < da %} + + + {% endif %} + {% endif %} + {% endfor %} + {% endif %} {% elif abday.end == da%} {% if abday.endday_info == "1" %} (nur Vormittags) + + + + {% for workday in workdays %} + {% if workday.start|date:"d-m-y" == da|date:"d-m-y" %} +
+ {{workday.start|date:"H:i"}} - {{workday.end|date:"H:i"}} + {% getsumworkdayexcludebreak workday as sumworkday %} + {{ sumworkday }}, + {% getsumbreak workday as sumbreakofday %} + {{sumbreakofday}} min. ({{workday.breaks.all|length}}), + {% getsumworkday workday as sumwd %} + {{sumwd}}, + {% gettimeoveralldiff workday user as erg%} + {% if erg.1 == 0 %} + +{{erg.0}} + {% elif erg.1 == 1 %} + {{erg.0}} + {% else %} + -{{erg.0}} + {% endif %} + + {% if breakmonthline < da %} + + + {% endif %} + + {% endif %} + {% endfor %} + {% elif abday.endday_info == "2" %} (nur Nachmittags) + + + + {% for workday in workdays %} + {% if workday.start|date:"d-m-y" == da|date:"d-m-y" %} +
+ {{workday.start|date:"H:i"}} - {{workday.end|date:"H:i"}} + {% getsumworkdayexcludebreak workday as sumworkday %} + {{ sumworkday }}, + {% getsumbreak workday as sumbreakofday %} + {{sumbreakofday}} min. ({{workday.breaks.all|length}}), + {% getsumworkday workday as sumwd %} + {{sumwd}}, + {% gettimeoveralldiff workday user as erg%} + {% if erg.1 == 0 %} + +{{erg.0}} + {% elif erg.1 == 1 %} + {{erg.0}} + {% else %} + -{{erg.0}} + {% endif %} + + {% if breakmonthline < da %} + + + {% endif %} + + {% endif %} + {% endfor %} + {% endif %} {% endif %} @@ -212,9 +325,10 @@ {% counterWDUp %} - - - + {% if breakmonthline < da %} + + + {% endif %} {% endif %} {% endfor %} diff --git a/timemanagement/views.py b/timemanagement/views.py index c52ee64..5f019b6 100644 --- a/timemanagement/views.py +++ b/timemanagement/views.py @@ -321,6 +321,7 @@ def TimeManagement(request, activemonth=False, activeyear=False): # Hier werden nur die Arbeitstage gefiltert, die auch aktuell zur Ansicht stehen sollen context = { "next_month" : next_month, + "breakmonthline" : date.today() - timedelta(days=30), "prev_month" : prev_month, "next_year" : next_year, "prev_year" : prev_year, @@ -331,7 +332,7 @@ def TimeManagement(request, activemonth=False, activeyear=False): "days_this_month" : get_datetime_range(int(active_year), int(activemonth)), "workdays" : Workday.objects.filter(agency=request.user.profile.agency, user=request.user, start__month=activemonth, start__year=active_year).order_by("start").exclude(end=None), "userhasworkdays" : user_has_workdays - } + } return render(request, 'timemanagement/timemanagement_management.html', context) diff --git a/users/templates/users/base.html b/users/templates/users/base.html index d29b5f1..039a3f8 100644 --- a/users/templates/users/base.html +++ b/users/templates/users/base.html @@ -12,43 +12,43 @@ Digitale Agentur - + - + - + - + - + - - + + - - + + - + - + - + @@ -59,8 +59,8 @@ +
@@ -267,7 +267,7 @@
-
@@ -316,7 +316,7 @@ {% endif %} -