From d0169c8cfc030885912115ffc6d4ad181ee772f4 Mon Sep 17 00:00:00 2001 From: Holger Trampe Date: Mon, 9 Dec 2019 22:29:46 +0100 Subject: [PATCH] Standards haben ein Uhrzeitfeld bekommen --- news/__pycache__/models.cpython-38.pyc | Bin 1466 -> 1455 bytes news/migrations/0004_auto_20191209_2227.py | 24 +++++++++ .../0004_auto_20191209_2227.cpython-38.pyc | Bin 0 -> 707 bytes news/models.py | 8 +-- standards/__pycache__/models.cpython-38.pyc | Bin 1651 -> 1655 bytes .../migrations/0003_auto_20191209_2226.py | 29 ++++++++++ .../0003_auto_20191209_2226.cpython-38.pyc | Bin 0 -> 778 bytes standards/models.py | 6 +-- .../templates/standards/standard_area.html | 4 +- .../standards/standard_area_OLD.html | 50 ----------------- .../templates/standards/standard_task.html | 4 +- .../standards/standard_task_OLD.html | 51 ------------------ .../standards/standards_management.html | 4 +- users/__pycache__/views.cpython-38.pyc | Bin 10309 -> 10314 bytes users/migrations/0002_auto_20191209_2226.py | 18 +++++++ .../0002_auto_20191209_2226.cpython-38.pyc | Bin 0 -> 719 bytes users/templates/users/dashboard.html | 8 ++- users/views.py | 2 +- 18 files changed, 88 insertions(+), 120 deletions(-) create mode 100644 news/migrations/0004_auto_20191209_2227.py create mode 100644 news/migrations/__pycache__/0004_auto_20191209_2227.cpython-38.pyc create mode 100644 standards/migrations/0003_auto_20191209_2226.py create mode 100644 standards/migrations/__pycache__/0003_auto_20191209_2226.cpython-38.pyc delete mode 100644 standards/templates/standards/standard_area_OLD.html delete mode 100644 standards/templates/standards/standard_task_OLD.html create mode 100644 users/migrations/0002_auto_20191209_2226.py create mode 100644 users/migrations/__pycache__/0002_auto_20191209_2226.cpython-38.pyc diff --git a/news/__pycache__/models.cpython-38.pyc b/news/__pycache__/models.cpython-38.pyc index f9078a4b7ddb3b037f15118b572ca8f802db2e85..e4beecc67e03a3383ed14405161b58529be6c281 100644 GIT binary patch delta 139 zcmdnRy`Gyll$V!_0SIjNyo=qokvEDloIh0{OE60)g)N1%mnljll{pJlL=-5(lF9=l zc~iJjxKns~S)#-+REekXrtq~eL`kIZrw9OP$<6y1uP`!7O`go$!olm3Sdto&nLAmU LMSF87ODZD(WZ5H1 delta 151 zcmZ3_y^EVSl$V!_0SG$QzKh+kkvEDlTqIQ>OE60)g)N1%mnlj#l{pJlL<}gxlF9=l zc~iJjxKns~S)#;&Jbn~?5-GeXd@T%7k}3Qt0zg`7^FGEajEvHgCo{LOaJnRxOqOTS Z=D)=YWTl2==BB!3rskw<_F_q81OQ81C))r3 diff --git a/news/migrations/0004_auto_20191209_2227.py b/news/migrations/0004_auto_20191209_2227.py new file mode 100644 index 0000000..1331670 --- /dev/null +++ b/news/migrations/0004_auto_20191209_2227.py @@ -0,0 +1,24 @@ +# Generated by Django 2.2.7 on 2019-12-09 21:27 + +import datetime +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('news', '0003_auto_20191209_1828'), + ] + + operations = [ + migrations.AlterField( + model_name='news', + name='created_date', + field=models.DateTimeField(blank=True, default=datetime.date.today), + ), + migrations.AlterField( + model_name='news', + name='last_modified_on', + field=models.DateTimeField(blank=True, default=datetime.date.today), + ), + ] diff --git a/news/migrations/__pycache__/0004_auto_20191209_2227.cpython-38.pyc b/news/migrations/__pycache__/0004_auto_20191209_2227.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..fef0d5373f9f49b4f1a7e48992dbdc1a12c08947 GIT binary patch literal 707 zcmZuv&2G~`5MHnC#4(AK0}?-PkV}*pBwB<}Q7bAAP@p5efy z55ha}Bzxt=g$JmF+F6&X5n`+z&+qOx-|l)ci5bb^kKZ4@amIc+XIBDp4rrMoM zm57`JT4qHGS?U2xIe593`WTcUaPVY`#6$ z?xhTAna89epI-%G;BoqqyPW_ literal 0 HcmV?d00001 diff --git a/news/models.py b/news/models.py index 1655d6a..897cf7d 100644 --- a/news/models.py +++ b/news/models.py @@ -13,16 +13,16 @@ class News(models.Model): content = RichTextUploadingField(blank=True, verbose_name='Inhalt') created_by = models.ForeignKey(User, on_delete=models.PROTECT) - created_date = models.DateField(default=datetime.date.today, blank=True) + created_date = models.DateTimeField(default=datetime.date.today, blank=True) go_online_on = models.DateTimeField(default=datetime.date.today, blank=True) go_offline_on = models.DateTimeField(default=datetime.date.today, blank=True) last_modified_by = models.ForeignKey(User, on_delete=models.PROTECT, related_name='news_mod_by', default=None) - last_modified_on = models.DateField(default=datetime.date.today, blank=True) - - + last_modified_on = models.DateTimeField(default=datetime.date.today, blank=True) + + def __str__(self): return f'{self.name}' diff --git a/standards/__pycache__/models.cpython-38.pyc b/standards/__pycache__/models.cpython-38.pyc index d7f1d7e56bd15233ae6b9ac536a5e453e7d473e5..e56e73e999b467faad45e8eceaf63e66e99d698a 100644 GIT binary patch delta 36 qcmey&^PPt`l$V!_0SILGyo=quk#`vj2d_(FNoq)D?&j?*dl&)9hYPR( delta 32 mcmey)^O=V?l$V!_0SIP`zl>eJk#`vj3#UtB$>!ZGdl&(lm>Mt zyPu|M#&~Z!mZi&sWtJYW<&!j1Au_ak8zs0Az;+1?5T4-?;ac+c zogIU?;Jq|+ANzMbvz9l)27?YSDj~tnB-e(aw?Yi8Ywcv)uVtm*4(N0~u@M{c7_$j; zk-ZdXPZ)dObLq}<2*g&jAlgkOw4#n)@z=bX)QFralpM9}@@l^Ze*(vC=~6V%1{bvN-NGeIr_p^tzH$o zndsu?<_jF>qkqPkW!dA!_ENcLHb&78QAIxe9fW~L@tgg+)A~MS%tN(@@ivB {{item.name}} {{item.created_standard_by.first_name}} {{item.created_standard_by.last_name}} - {{ item.created_standard_date}} + {{ item.created_standard_date|date:"d.m.Y, H:i"}} {{ item.last_modified_by.first_name }} {{ item.last_modified_by.last_name }} - {{ item.last_modified_on }} + {{ item.last_modified_on|date:"d.m.Y, H:i"}} {{item.public|yesno:"Öffentlich,Nicht öffentlich"}} {% if item.created_standard_by == user or perms.users.standard_management %} diff --git a/standards/templates/standards/standard_area_OLD.html b/standards/templates/standards/standard_area_OLD.html deleted file mode 100644 index d8125b9..0000000 --- a/standards/templates/standards/standard_area_OLD.html +++ /dev/null @@ -1,50 +0,0 @@ -{% extends "users/base.html" %} -{% block content %} -
- -

Standards aus dem Bereich {{areaname}}

-
-
- {% for item in standards_of_agency_area %} - {% if item.public or item.created_standard_by == user or perms.users.standard_management %} -
-
-
- - {% if item.public %} -

{{item.name}}

- {% else %} -

{{item.name}}

- {% endif %} -
- {% if item.created_standard_by == user or perms.users.standard_management %} - - {% endif %} -
-
-
{{item.created_standard_by.first_name}} {{item.created_standard_by.last_name}}
Zuletzt bearbeitet von {{ item.last_modified_by.first_name }} {{ item.last_modified_by.last_name }} am {{ item.last_modified_on }}
- -

{{ item.content|truncatechars:250|safe}}

-
-
-
- {% endif %} - {% endfor%} -
-
-{% endblock content %} diff --git a/standards/templates/standards/standard_task.html b/standards/templates/standards/standard_task.html index 1baf176..3091910 100644 --- a/standards/templates/standards/standard_task.html +++ b/standards/templates/standards/standard_task.html @@ -28,9 +28,9 @@ {{item.name}} {{item.created_standard_by.first_name}} {{item.created_standard_by.last_name}} - {{ item.created_standard_date}} + {{ item.created_standard_date|date:"d.m.Y, H:i"}} {{ item.last_modified_by.first_name }} {{ item.last_modified_by.last_name }} - {{ item.last_modified_on }} + {{ item.last_modified_on|date:"d.m.Y, H:i"}} {{item.public|yesno:"Öffentlich,Nicht öffentlich"}} {% if item.created_standard_by == user or perms.users.standard_management %} diff --git a/standards/templates/standards/standard_task_OLD.html b/standards/templates/standards/standard_task_OLD.html deleted file mode 100644 index 2ea2f08..0000000 --- a/standards/templates/standards/standard_task_OLD.html +++ /dev/null @@ -1,51 +0,0 @@ -{% extends "users/base.html" %} -{% block content %} -
- -

Standards aus dem Aufgabenbereich {{taskname}} des Bereichs {{areaname}}

-
-
- {% for item in standards_of_agency_task %} - {% if item.public or item.created_standard_by == user or perms.users.standard_management %} -
-
-
- - {% if item.public %} -

{{item.name}}

- {% else %} -

{{item.name}}

- {% endif %} -
- {% if item.created_standard_by == user or perms.users.standard_management %} - - {% endif %} -
-
-
{{item.created_standard_by.first_name}} {{item.created_standard_by.last_name}}
Zuletzt bearbeitet von {{ item.last_modified_by.first_name }} {{ item.last_modified_by.last_name }} am {{ item.last_modified_on }}
- -

{{ item.content|truncatechars:250|safe}}

-
-
-
- {% endif %} - {% endfor%} -
-
-{% endblock content %} diff --git a/standards/templates/standards/standards_management.html b/standards/templates/standards/standards_management.html index 3d2bb95..6955979 100644 --- a/standards/templates/standards/standards_management.html +++ b/standards/templates/standards/standards_management.html @@ -67,9 +67,9 @@ {% for standard in standards_of_user %} {{standard.name}} - {{standard.created_standard_date}} + {{standard.created_standard_date|date:"d.m.Y, H:i"}} {{standard.last_modified_by.first_name}} {{standard.last_modified_by.last_name}} - {{standard.last_modified_on}} + {{standard.last_modified_on|date:"d.m.Y, H:i"}} {{standard.public|yesno:"Öffentlich,Nicht öffentlich"}} diff --git a/users/__pycache__/views.cpython-38.pyc b/users/__pycache__/views.cpython-38.pyc index 00aacf828edbd9900662e40810ef1172f3fd4f7d..e466373c041c92112d3411db7829a904cb01a1ee 100644 GIT binary patch delta 51 zcmX>aa4LW|l$V!_0SHoezl&Aa$a{rDTue8)C^fMpH6^~dBrz`~u_z@z1<2j}nIlLZ E0IseP*#H0l delta 46 zcmX>Va5R87l$V!_0SHugzKfOK$a{rDNKiK?vA85YH$NpaEi*MGK0j~s4~`&t08tGO Am;e9( diff --git a/users/migrations/0002_auto_20191209_2226.py b/users/migrations/0002_auto_20191209_2226.py new file mode 100644 index 0000000..bd5b4fa --- /dev/null +++ b/users/migrations/0002_auto_20191209_2226.py @@ -0,0 +1,18 @@ +# Generated by Django 2.2.7 on 2019-12-09 21:26 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('users', '0001_initial'), + ] + + operations = [ + migrations.AlterField( + model_name='profile', + name='func', + field=models.CharField(choices=[('lead', 'Agenturleitung'), ('external', 'Außendienst'), ('indoor', 'Innendienst'), ('trainee', 'Azubi')], default='lead', max_length=50), + ), + ] diff --git a/users/migrations/__pycache__/0002_auto_20191209_2226.cpython-38.pyc b/users/migrations/__pycache__/0002_auto_20191209_2226.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5aa46d1bfcded0c6360d684be9e3a17a57f1f8b2 GIT binary patch literal 719 zcmYjPy>8S%5MKYCf9`@(Q9_4wO?2l15rj}qK}0D?16N=ftu~%H-=5a%V{J=;7TP=m zHP1lFTWm{}h8iKEF!q6RW6fx1zVXh?H@iGINEpelZ$ICSUB-U&&c68MoRBt;$N&RJ zvC7Gu%FSGdoiT91`^>;YXXAbHG7tRMY#Q89E}ObGsbpzHD{I}@QB?z~rs$!4iO4x2 zZJv-pmN~#O7o5_`JoGm~UjRp&5PS$=1Yzkz1TiGn9*nO&%8Fn@B@b-;>VGXN9CQtu z#!hCl*_=x)TPc(cx29f6h1Oqnx}Ypyp#XbtQKD`;qfoY;E-4=2Rf|Ro)lI0UMfd#+ zYLKX#mcWtJP}jze&$ZqQhpiD(Bidl`vAdKerax~|GE>in#k!USHZ}xYiB7ddjJVlD&?!uk77s6My%0Jqc%>Ox{;Xp77y z3q>Qm>~Aq%ABa!aV&~hW-r~Qld}ZbVp@aGT_Vj7K?0L(V+MrPRi@NA4;-<;Z&fnx9 zOW6vdY)4l1=*HPiMzGP1DCm+YhFHMI+MYkWA#cw|?L|E`9g^ r__qUkG4*W>8==ek2rh>qhQCr5XFEEc_wzOV)Q8?*ge=RM literal 0 HcmV?d00001 diff --git a/users/templates/users/dashboard.html b/users/templates/users/dashboard.html index bc958fc..b1b9ef6 100644 --- a/users/templates/users/dashboard.html +++ b/users/templates/users/dashboard.html @@ -22,7 +22,7 @@ {{news_single.name }} {{ news_single.created_by.first_name }} {{ news_single.created_by.last_name }} - {{ news_single.created_date }} + {{ news_single.created_date|date:"d.m.Y, H:i" }} {% endfor %} @@ -41,12 +41,10 @@ {% for standard in standards_of_agency %} {{standard.name}} - {{standard.created_standard_date}} + {{standard.created_standard_date|date:"d.m.Y, H:i"}} {{standard.created_standard_by.first_name}} {{standard.created_standard_by.last_name}} - {{standard.last_modified_on}} + {{standard.last_modified_on|date:"d.m.Y, H:i"}} {{standard.last_modified_by.first_name}} {{standard.last_modified_by.last_name}} - - {% endfor %} diff --git a/users/views.py b/users/views.py index 08a8074..120def8 100644 --- a/users/views.py +++ b/users/views.py @@ -61,7 +61,7 @@ def dashboard(request): # Loading only user same agency # Change context and return for template-data # # Get all Users of the Same Agency as logged user - standards_of_agency = Standards.objects.filter(agency__pk=request.user.profile.agency.pk).order_by('-last_modified_on')[:10] + standards_of_agency = Standards.objects.filter(agency__pk=request.user.profile.agency.pk).order_by('-created_standard_date')[:10] filterdate = datetime.now() news = News.objects.filter(agency__pk=request.user.profile.agency.pk).filter(go_online_on__lt=filterdate).filter(go_offline_on__gt=filterdate)