From 5e20c56368ede98a9c35f7275c2bada2c04b0e3a Mon Sep 17 00:00:00 2001 From: Holger Trampe Date: Sat, 23 May 2020 02:47:56 +0200 Subject: [PATCH] Abwesenheit usw. --- chat/templates/chat/chat_content.html | 4 +- chat/templates/chat/chat_othermessage.html | 2 +- chat/templates/chat/chat_ownmessage.html | 2 +- dasettings/forms.py | 27 +++-- .../dasettings/absencereason_add.html | 41 +++++++ .../dasettings/absencereason_update.html | 49 +++++++- .../modulesettings_timemanagement.html | 17 +-- .../templates/dasettings/moduls_content.html | 2 +- .../dasettings/structure_content.html | 5 +- .../templates/dasettings/user_usprof.html | 108 +++++++++++++++--- dasettings/views.py | 90 +++++++++++++-- .../__pycache__/settings.cpython-38.pyc | Bin 4750 -> 4697 bytes digitaleagentur/settings.py | 31 ++--- orga/templates/orga/orga_single.html | 2 +- .../__pycache__/counter_tag.cpython-38.pyc | Bin 11992 -> 12704 bytes standards/templatetags/counter_tag.py | 26 ++++- timemanagement/models.py | 4 +- .../timemanagement/rendered_table.html | 14 ++- users/admin.py | 3 +- users/models.py | 12 +- users/signals.py | 79 +++++++++---- users/templates/users/base.html | 34 ++++-- users/templates/users/login.html | 5 + users/templates/users/logout.html | 5 + users/views.py | 10 +- 25 files changed, 455 insertions(+), 117 deletions(-) diff --git a/chat/templates/chat/chat_content.html b/chat/templates/chat/chat_content.html index a30783a..a2cc885 100644 --- a/chat/templates/chat/chat_content.html +++ b/chat/templates/chat/chat_content.html @@ -36,7 +36,7 @@
-
{{message.sendtime|date:"H:m"}}
+
{{message.sendtime|date:"H:i"}}
{{message.content}} @@ -48,7 +48,7 @@
-
{{message.author.first_name}} {{message.author.last_name}}, {{message.sendtime|date:"H:m"}}
+
{{message.author.first_name}} {{message.author.last_name}}, {{message.sendtime|date:"H:i"}}
{{message.content}} diff --git a/chat/templates/chat/chat_othermessage.html b/chat/templates/chat/chat_othermessage.html index b56cc25..ce535cb 100644 --- a/chat/templates/chat/chat_othermessage.html +++ b/chat/templates/chat/chat_othermessage.html @@ -2,7 +2,7 @@
-
{{newmessage.author.first_name}} {{newmessage.author.last_name}}, {{newmessage.sendtime|date:"H:m"}}
+
{{newmessage.author.first_name}} {{newmessage.author.last_name}}, {{newmessage.sendtime|date:"H:i"}}
{{newmessage.content}} diff --git a/chat/templates/chat/chat_ownmessage.html b/chat/templates/chat/chat_ownmessage.html index 3ee7ff0..ab3083d 100644 --- a/chat/templates/chat/chat_ownmessage.html +++ b/chat/templates/chat/chat_ownmessage.html @@ -2,7 +2,7 @@
-
{{newmessage.sendtime|date:"H:m"}}
+
{{newmessage.sendtime|date:"H:i"}}
{{newmessage.content}} diff --git a/dasettings/forms.py b/dasettings/forms.py index d07ed72..98631a1 100644 --- a/dasettings/forms.py +++ b/dasettings/forms.py @@ -68,20 +68,16 @@ class UserTimeForm(forms.ModelForm): class Meta: model = UserTime labels = { - "holiday" : "Urlaubstage", - "loose_holidedate" : "Urlaubstage aus Vorjahr verfallen am", + "loose_holidedate" : "Resturlaub verfällt am (XX.XX)", "startdate" : "Einstellungsdatum", - "holiday_start" : "Urlaubstage bei Einstellung", - #"wd_mo" : "Montag", - #"wd_tu" : "Dienstag", - #"wd_we" : "Mittwoch", - #"wd_th" : "Donnerstag", - #"wd_fr" : "Freitag", + "wd_mo" : "Montag", + "wd_tu" : "Dienstag", + "wd_we" : "Mittwoch", + "wd_th" : "Donnerstag", + "wd_fr" : "Freitag", } - #fields = ["startdate", "wd_mo", "wd_tu", "wd_we", "wd_th", "wd_fr", "holiday", "loose_holidedate", "holiday_start", ] - fields = ["startdate", "holiday", "loose_holidedate", "holiday_start", ] + fields = ["startdate", "wd_mo", "wd_tu", "wd_we", "wd_th", "wd_fr", "loose_holidedate"] widgets = { - 'loose_holidedate': DatePickerInput(options={"format":'DD.MM.YYYY', "locale":'de'}), "startdate" : DatePickerInput(options={"format":'DD.MM.YYYY', "locale":'de'}) } @@ -193,13 +189,16 @@ class UserProfileForm(forms.ModelForm): class AbsenceReasonForm(forms.ModelForm): + + rgb_color = forms.CharField(widget=forms.HiddenInput()) + class Meta: model = AbsenceReason labels = { "name" : "Bezeichnung", "need_confirm" : "Muss bestätigt werden", "need_rep" : "Muss vertreten werden", - "is_holiday" : "Geht vom Urlaub ab", - "color" : "Farbe" + "is_holiday" : "Geht vom Urlaub ab" } - fields = ["name", "need_confirm", "need_rep", "is_holiday", "color"] \ No newline at end of file + fields = ["name", "need_confirm", "need_rep", "is_holiday", "rgb_color"] + diff --git a/dasettings/templates/dasettings/absencereason_add.html b/dasettings/templates/dasettings/absencereason_add.html index 2eabca0..14e5f05 100644 --- a/dasettings/templates/dasettings/absencereason_add.html +++ b/dasettings/templates/dasettings/absencereason_add.html @@ -1,18 +1,59 @@ {% extends "users/base.html" %} {% load crispy_forms_tags %} +{% load static %} {% block content %} {% if request.user.profile.agency.module_timemanagement %} + + +

Abwesenheitskategorie anlegen


{% csrf_token %} {{ form|crispy }} +
+ +
+

  Abbrechen
+ + {% else %}

Das Modul Abwesenheitsplanung wurden in ihrer Agentur deaktiviert.

{% endif %} diff --git a/dasettings/templates/dasettings/absencereason_update.html b/dasettings/templates/dasettings/absencereason_update.html index 5616b7a..b43a07d 100644 --- a/dasettings/templates/dasettings/absencereason_update.html +++ b/dasettings/templates/dasettings/absencereason_update.html @@ -1,20 +1,65 @@ {% extends "users/base.html" %} {% load crispy_forms_tags %} +{% load static %} {% block content %} {% if request.user.profile.agency.module_timemanagement %} + + +

Abwesenheitskategorie aktualisieren


- {% csrf_token %} - {{ form|crispy }} + {% csrf_token %} + {{ form|crispy }} +
+ +
+

  Abbrechen
+ {% else %}

Das Modul Abwesenheitsplanung wurden in ihrer Agentur deaktiviert.

{% endif %} + + {% endblock content %} diff --git a/dasettings/templates/dasettings/modulesettings_timemanagement.html b/dasettings/templates/dasettings/modulesettings_timemanagement.html index c8d24fa..e1afd01 100644 --- a/dasettings/templates/dasettings/modulesettings_timemanagement.html +++ b/dasettings/templates/dasettings/modulesettings_timemanagement.html @@ -2,15 +2,15 @@ {% load counter_tag %}

Abwesenheitskategorien{% if request.user.profile.showtooltips %} {% endif %}  Kategorie -

-   + - - - + + + + @@ -18,9 +18,10 @@ {% for ab in modsettings_tm_abcat %} - - - + + + +
BezeichnungMuss bestätigt werdenMuss vertreten werdenUrlaubstagBestätigungVertretungUrlaubstagFarbe  
{{ab.name}}{% if ab.need_confirm %} Bedarf Bestätigung {% else %} Ohne Bestätigung {% endif %}{% if ab.need_rep %} Muss vertreten werden {% else %} Ohne Vertretung {% endif %}{% if ab.is_holiday %} Urlaub {% endif %}{% if ab.need_confirm %} {% else %} {% endif %}{% if ab.need_rep %} {% else %} {% endif %}{% if ab.is_holiday %} {% endif %} {% if user|usergperm:"moduleorganizer" %} diff --git a/dasettings/templates/dasettings/moduls_content.html b/dasettings/templates/dasettings/moduls_content.html index f6fd6e9..e016555 100644 --- a/dasettings/templates/dasettings/moduls_content.html +++ b/dasettings/templates/dasettings/moduls_content.html @@ -34,7 +34,7 @@ {% for formfield in modulform %} + {% endblock content %} \ No newline at end of file diff --git a/users/templates/users/logout.html b/users/templates/users/logout.html index 50d27e5..96c46bb 100644 --- a/users/templates/users/logout.html +++ b/users/templates/users/logout.html @@ -19,4 +19,9 @@

+ {% endblock content %} \ No newline at end of file diff --git a/users/views.py b/users/views.py index e2d8029..b33a112 100644 --- a/users/views.py +++ b/users/views.py @@ -147,10 +147,15 @@ def toUpdate(request): usersofagency = User.objects.filter(profile__agency=request.user.profile.agency) for u in usersofagency: + # CREATE USERTIME-OBJECT if(len(UserTime.objects.filter(user=u)) == 0): usertime_new = UserTime(user=u) usertime_new.save() - + else: + ut = UserTime.objects.get(user=u) + if(ut.loose_holidedate == "2020-" or ut.loose_holidedate == "2021-"): + ut.loose_holidedate = "30.04" + ut.save() ''' DASHBOARD-View @@ -833,7 +838,8 @@ def cronactions(request, code): if(user.profile.news_push): newnotification = UserNotification(touser=user, notificationtext="Neue Agenturnews: " + news.name, notificationtype="agencynews", elementid=news.pk) newnotification.save() - data.update({"status" : "ok"}) + + data.update({"status" : "ok"}) elif(code == settings.MAILINFOKEY): pass '''