From b249bb0dba2771bcaa0cd8a3997c5f9c56b3c3c0 Mon Sep 17 00:00:00 2001 From: Holger Trampe Date: Sun, 5 Sep 2021 16:22:48 +0200 Subject: [PATCH] einiges --- .../realtime_dropdown_nc_iframe.html | 336 ++++++++++++++++++ timemanagement/urls.py | 4 +- timemanagement/views.py | 3 + users/static/users/js/nc_js.js | 38 ++ 4 files changed, 379 insertions(+), 2 deletions(-) create mode 100644 timemanagement/templates/timemanagement/realtime_dropdown_nc_iframe.html create mode 100644 users/static/users/js/nc_js.js diff --git a/timemanagement/templates/timemanagement/realtime_dropdown_nc_iframe.html b/timemanagement/templates/timemanagement/realtime_dropdown_nc_iframe.html new file mode 100644 index 0000000..50d0150 --- /dev/null +++ b/timemanagement/templates/timemanagement/realtime_dropdown_nc_iframe.html @@ -0,0 +1,336 @@ + + +{% load counter_tag %} +{% load static %} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ Arbeitsbeginn: 00:00:00
+ Arbeitsende: 00:00:00
+ Pausenzeit: 00:00:00 +
+
+
+ +
+
+{% loadaccounttime request.user as actualaccounttime %} +Gleitzeitkonto: +{% if actualaccounttime.1 == 0 %} + +{{actualaccounttime.0}} Stunden +{% else %} + -{{actualaccounttime.0}} Stunden +{% endif %} +
+ + + + + diff --git a/timemanagement/urls.py b/timemanagement/urls.py index efa88ae..41442ab 100644 --- a/timemanagement/urls.py +++ b/timemanagement/urls.py @@ -1,6 +1,6 @@ from django.urls import path from django.contrib.auth.decorators import login_required, permission_required -from .views import TimeManagement, TimeAjax, AbsenceManagmenet, AbsenceUpdate, TimeUpdate, AddBreak, TimeAdd, TimeManagementTeamSingle +from .views import TimeManagement, TimeAjax, AbsenceManagmenet, AbsenceUpdate, TimeUpdate, AddBreak, TimeAdd, TimeManagementTeamSingle, GetRealtimeDropDown ''' Permissions definiert in models.py bei USERS und dann hier vor die View geschrieben! ''' @@ -20,5 +20,5 @@ urlpatterns = [ path('abs//', AbsenceManagmenet, name='tma-management'), path('ajax/', TimeAjax, name='tm-ajax'), path('abs/update//', AbsenceUpdate, name='tma-update'), - + path('abs/getncdd/', GetRealtimeDropDown, name='tma-getrealtimedd'), ] diff --git a/timemanagement/views.py b/timemanagement/views.py index d717c5c..c4b21e5 100644 --- a/timemanagement/views.py +++ b/timemanagement/views.py @@ -24,6 +24,9 @@ from django.core.mail import send_mail from digitaleagentur.utils import * +def GetRealtimeDropDown(request): + return render(request, 'timemanagement/realtime_dropdown_nc_iframe.html', {}) + # Load freedays def loadingFreeDays(plz): # Getting land diff --git a/users/static/users/js/nc_js.js b/users/static/users/js/nc_js.js new file mode 100644 index 0000000..49325f1 --- /dev/null +++ b/users/static/users/js/nc_js.js @@ -0,0 +1,38 @@ +window.onload = function () { + var button = document.createElement("a"); + button.innerHTML = ''; + + button.classList.add("header-menu"); + + // 2. Append somewhere + var header = document.getElementsByClassName("header-right")[0]; + header.prepend(button); + + button.style.padding = "20px"; + + // DIV + realtimediv = document.createElement("div"); + realtimediv.style.width = "300px"; + realtimediv.style.height = "250px"; + realtimediv.style.border = "solid black 1px"; + realtimediv.style.top = "50px"; + realtimediv.style.right = "50px"; + realtimediv.style.position = "fixed"; + realtimediv.style.overflow = "hidden"; + realtimediv.style.display = "none"; + realtimediv.innerHTML = ''; + + + + header.appendChild(realtimediv); + + + button.addEventListener ("click", function() { + if(realtimediv.style.display == "none"){ + realtimediv.style.display = "block"; + } + else { + realtimediv.style.display = "none"; + } + }); + } \ No newline at end of file