From 9f41152153f5e60a8f32a68e9f84f6723bbb130a Mon Sep 17 00:00:00 2001 From: "holger.trampe" Date: Wed, 25 Mar 2020 00:48:15 +0100 Subject: [PATCH] 0.8.2. Zwischencommit Steckbrief Prios fertig --- areas/__pycache__/views.cpython-38.pyc | Bin 2247 -> 2518 bytes areas/views.py | 29 ++++++- orga/__pycache__/views.cpython-38.pyc | Bin 2115 -> 2114 bytes orga/templates/orga/orga_single.html | 78 +++++++++++++++++- orga/views.py | 2 +- .../templates/standards/standards_add.html | 6 +- .../templates/standards/standards_single.html | 6 +- .../templates/standards/standards_update.html | 6 +- 8 files changed, 111 insertions(+), 16 deletions(-) diff --git a/areas/__pycache__/views.cpython-38.pyc b/areas/__pycache__/views.cpython-38.pyc index b416f82bffef7b430aec890aa8f1a6330af66eca..09ba9ba3d2be6f298fa3f3f7842d6fdaf78f3916 100644 GIT binary patch delta 827 zcmYjPzi-n(7`=0B$8l`uS4ESOQV73df~pR%&{C;tKw^Q4HVhdE7U!ZQjvdafDxp+C z3TuTTZ%iP;z+A+?z{G@vkXIH)26p(qiyCp(J-vJ1^WF1z{!;i}vRbC86BsLRUOfJ5 zO|2^ZG;O@T#t1XK%3!IzM2TBwCbM3V32mPRo@05zt4!Y|c47MCt7g+g-r?QgO-OZ*ow%A^WmDOmY& zLw!`6OBs-UM`lmysY27irXJHH8EloY73H9kKdp=;ra(P=EKMjgD&$B3C0!vSrBfIw zZ?o?RCC}eS2Gb^Vm-rem6B#4WDeFEjK`g!i&^CPc(BZBVaOU!MdcW&CUcf}d_!%^4 zU{F*R>?a!5ka6q_uVKB&FCxc-6S)@#exi7R z!$O`#`4YlqgewSF5$XU*W|nOX;dlep9D;?ghEPOU1xVx}+`Fyv8?X=oML6a}4qr#p zO*CndI~a=lY@)U?huc^+@vshlFMcjwY>2^#q}QoM^HifnKph?p)(b+Z;abuqeiw}P za{My=jc&zzTHS5u@St!Na}5IKdb6;&tuX(0y2v3SXd7TX@Z3%8T!_D|K@EBy=Ip@` Mz$A(4YcLo80dNtv`v3p{ delta 594 zcmYk3O>fgc5QcXgCpeCsHc6r1Q7K;va6p1nQ;MpV8v;a0ks?85bsdz}*wWZhC4|&N zxT9$Q1e`hX3o0RTLgL^H7ybiR-Z3;{SNr(&JF_$E^^ewBqu%pzP6?X?IU`W+%VCef~nXt>!Xz@`_*;=-51OewRXOnwR#o zg=sJ^1yPh&2E!-|nJ<|$d#5#z{JeIO@bNHyJxbxX&1(6Hvj+c@;;zZcJ@U-ga(ClC ztV06MhYcZX2P=IGyi-R?)3L=d6lrTw=@Q-s=0RouH1l+IOnXWz9Nm4)O>E#6(D&l- zB;YVeSclxdFc`)`l<4A9_@X2@Ncb1*J>A`Y{&1Hs!|(XKE=8nLZXcydoR^~{&?(o% zz9P6PxCWf^b&)rKygKd1H^rO*aA|k(C=OHf(m@vRhJ^14x>IaI<-U|SI6s$MO*#iC z%cVNal0!|<#dIv*hToxOGjhIHwxIL2X;kO>Iy_7`$P!Mu0hgsnk^5h-qHEF6*?g1e aQ50^;A4rz~k33q#`a7kkXIbRlvFH!`zkYN8 diff --git a/areas/views.py b/areas/views.py index 9b6f172..d838559 100644 --- a/areas/views.py +++ b/areas/views.py @@ -8,6 +8,7 @@ from django.contrib.auth.models import User from django.http import HttpResponse, JsonResponse import json from django.contrib.auth.decorators import login_required +from users.priomodel import Prio @login_required def area_addareas_ajax(request): @@ -68,6 +69,30 @@ def area_neworder(request): if(area.agency == request.user.profile.agency): area.areaorder = ele['neworder'] area.save() - return HttpResponse("UPDATED") + return HttpResponse("UPDATED") + elif request.GET['action'] == 'newtaskorder': + tempuser = User.objects.get(pk=request.GET['userid']) + neworderdata = json.loads(request.GET['finalod']) + for ele in neworderdata: + prio = list(Prio.objects.filter(user__pk=request.GET['userid'], task__pk=ele['id']))[0] + prio.prio = ele['neworder'] + prio.save() + + return HttpResponse("UPDATED") else: - return HttpResponse("Request method is not a GET") \ No newline at end of file + return HttpResponse("Request method is not a GET") + + +''' +@login_required +def UsersPrioUpdate(request): + tempuser = User.objects.get(pk=request.GET['userid']) + if request.method == 'GET' and tempuser.profile.agency.pk == request.user.profile.agency.pk: + prio = Prio.objects.filter(user__pk=request.GET['userid']).filter(task__pk=request.GET['taskid']) + prio = list(prio)[0] + prio.prio = request.GET['value'] + prio.save() + return HttpResponse("udated...") + else: + return HttpResponse("Request method is not a GET") +''' \ No newline at end of file diff --git a/orga/__pycache__/views.cpython-38.pyc b/orga/__pycache__/views.cpython-38.pyc index 26dbe5aea1f2546c4bfff9bc09682dab2dd65d49..fe87e0b7b5286119cc624863f41307ec1210622a 100644 GIT binary patch delta 103 zcmX>sa7chRl$V!_0SJudRK>+@L5a6@)@>DMw`iQ?3=g^K?3q1!e%lvhXVj0W*8O# delta 104 zcmX>ka9Dshl$V!_0SGp-rNzZ>5Me!;iNgT^2AdbF diff --git a/orga/templates/orga/orga_single.html b/orga/templates/orga/orga_single.html index 81ce686..a118247 100644 --- a/orga/templates/orga/orga_single.html +++ b/orga/templates/orga/orga_single.html @@ -4,7 +4,7 @@

Bereiche und Aufgaben von {{user_first_name}} {{user_last_name}} {% if user|usergperm:"usermanager" %} - + {% endif %}


@@ -57,13 +57,15 @@ {% for area in areas %} - {%for prio in prios %} +
+ {%for prio in prios %} {% if prio.task.area.pk == area.pk and prio.task.visible %} -
-
{{prio.task.name}}
+ {% endif %} {% endfor %} +
{% endfor %} @@ -76,4 +78,72 @@ }
+ + + {% endblock content %} \ No newline at end of file diff --git a/orga/views.py b/orga/views.py index 3c9a637..ebfa8c8 100644 --- a/orga/views.py +++ b/orga/views.py @@ -52,7 +52,7 @@ def singleorga(request, pk): ''' if(user.profile.agency.pk==request.user.profile.agency.pk): - prios = Prio.objects.filter(user__pk=pk).order_by('-prio') + prios = Prio.objects.filter(user__pk=pk).order_by('prio') areas = list(Areas.objects.filter(agency__pk=request.user.profile.agency.pk).order_by('areaorder')) i = 0 for area in areas: diff --git a/standards/templates/standards/standards_add.html b/standards/templates/standards/standards_add.html index dd4ec34..9a47d68 100644 --- a/standards/templates/standards/standards_add.html +++ b/standards/templates/standards/standards_add.html @@ -182,7 +182,7 @@ Ausführender Vertreter --> -
Verantwortlicher hinzufügen:
+
Verantwortlicher:
@@ -203,7 +203,7 @@ Ausführender Vertreter --> -
Ausführender hinzufügen:
+
Ausführender:
@@ -224,7 +224,7 @@ -
Vertreter hinzufügen:
+
Vertreter:
diff --git a/standards/templates/standards/standards_single.html b/standards/templates/standards/standards_single.html index c8c2a41..cc5e239 100644 --- a/standards/templates/standards/standards_single.html +++ b/standards/templates/standards/standards_single.html @@ -61,7 +61,7 @@

{% if standard.authority.count > 0 %} - Verantwortlich:
+ Verantwortliche
{% for u in standard.authority.all %} {{u.first_name}} {{u.last_name}}{% if forloop.counter < standard.authority.count%} | {% endif %} {% endfor %} @@ -69,7 +69,7 @@ {% endif %} {% if standard.executor.count > 0 %} - Ausführende:
+ Ausführende
{% for u in standard.executor.all %} {{u.first_name}} {{u.last_name}}{% if forloop.counter < standard.executor.count%} | {% endif %} {% endfor %} @@ -77,7 +77,7 @@ {% endif %} {% if standard.representative.count > 0 %} - Vertreter:
+ Vertreter
{% for u in standard.representative.all %} {{u.first_name}} {{u.last_name}}{% if forloop.counter < standard.representative.count%} | {% endif %} {% endfor %} diff --git a/standards/templates/standards/standards_update.html b/standards/templates/standards/standards_update.html index 9dbbfc6..2fbcbad 100644 --- a/standards/templates/standards/standards_update.html +++ b/standards/templates/standards/standards_update.html @@ -177,7 +177,7 @@ Ausführender Vertreter --> -

Verantwortlicher hinzufügen:
+
Verantwortlicher
@@ -201,7 +201,7 @@ Ausführender Vertreter --> -
Ausführende hinzufügen:
+
Ausführende
@@ -223,7 +223,7 @@ -
Vertreter hinzufügen:
+
Vertreter