From dcd8613ee40886b9af5084661ed923326a00773f Mon Sep 17 00:00:00 2001 From: "holger.trampe" Date: Thu, 23 Apr 2020 23:17:41 +0200 Subject: [PATCH] Bug Agenturen und dynamischer Steckbrief vorbereitet --- .../dasettings/agencynetwork_content.html | 2 +- dasettings/views.py | 5 +- .../__pycache__/settings.cpython-38.pyc | Bin 3946 -> 3946 bytes digitaleagentur/settings.py | 5 +- orga/__pycache__/views.cpython-38.pyc | Bin 2114 -> 2440 bytes orga/templates/orga/orga_single.html | 70 ++++++++++++++++-- orga/views.py | 22 ++++++ .../standards/standards_management.html | 5 +- standards/views.py | 4 +- users/models.py | 5 +- 10 files changed, 102 insertions(+), 16 deletions(-) diff --git a/dasettings/templates/dasettings/agencynetwork_content.html b/dasettings/templates/dasettings/agencynetwork_content.html index 50a336a..347ef4f 100644 --- a/dasettings/templates/dasettings/agencynetwork_content.html +++ b/dasettings/templates/dasettings/agencynetwork_content.html @@ -25,7 +25,7 @@ {% getoutstandinginvites agn.pk as outstanding %} {% ifaginadminagn agn.pk request.user.profile.agency.pk as is_adminag %} - {{agn.name}} + {% if is_adminag %} {% endif %}{{agn.name}}{% if is_adminag %}{% endif %} {% if is_adminag %} diff --git a/dasettings/views.py b/dasettings/views.py index d46655c..e72b9a7 100644 --- a/dasettings/views.py +++ b/dasettings/views.py @@ -93,7 +93,10 @@ def DASettings(request): context.update({"agencyareas" : agencyareas}) # LOAD AGENCYNETWORKS - agencynetworks = AgencyNetwork.objects.filter(creator_agency=request.user.profile.agency) | AgencyNetwork.objects.filter(adminagencys__in=[request.user.profile.agency.pk]) | AgencyNetwork.objects.filter(members__in=[request.user.profile.agency.pk]) | AgencyNetwork.objects.filter(sharemembers__in=[request.user.profile.agency.pk]) + #agencynetworks = AgencyNetwork.objects.filter(creator_agency=request.user.profile.agency) | AgencyNetwork.objects.filter(adminagencys__in=[request.user.profile.agency.pk]) | AgencyNetwork.objects.filter(members__in=[request.user.profile.agency.pk]) | AgencyNetwork.objects.filter(sharemembers__in=[request.user.profile.agency.pk]) + + agencynetworks = AgencyNetwork.objects.filter(adminagencys__in=[request.user.profile.agency.pk]) | AgencyNetwork.objects.filter(members__in=[request.user.profile.agency.pk]) | AgencyNetwork.objects.filter(sharemembers__in=[request.user.profile.agency.pk]) + context.update({"agencynetworks" : agencynetworks}) # LOAD TASKS diff --git a/digitaleagentur/__pycache__/settings.cpython-38.pyc b/digitaleagentur/__pycache__/settings.cpython-38.pyc index 349916f9bac6d151b5f9365bac72d36ce5bc5a14..e12786e331ce94eef622ceb547f19b234d83f691 100644 GIT binary patch delta 28 icmaDQ_ezd8l$V!_0SNA~E{ZeX$lJun$US)i-z@-esR$MT delta 28 icmaDQ_ezd8l$V!_0SNL=E{wC^$lJun$TN8Y-z@-jAqa8+ diff --git a/digitaleagentur/settings.py b/digitaleagentur/settings.py index 4ffdfd8..99f1eff 100644 --- a/digitaleagentur/settings.py +++ b/digitaleagentur/settings.py @@ -9,7 +9,6 @@ https://docs.djangoproject.com/en/2.2/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/2.2/ref/settings/ """ - import os # Build paths inside the project like this: os.path.join(BASE_DIR, ...) @@ -201,6 +200,4 @@ OPTIONS={ 'libraries': { 'counter_tag': 'standards.tags', }, -} - - +} \ No newline at end of file diff --git a/orga/__pycache__/views.cpython-38.pyc b/orga/__pycache__/views.cpython-38.pyc index fe87e0b7b5286119cc624863f41307ec1210622a..c67ae01986d386f52ad84412316a32a7082c51a7 100644 GIT binary patch delta 951 zcmZ8gOK;Oa5caN})JgnG--WhGpi*%wN^8OQIAQEmfHw5d z9=IU2@|8m?aiB;X;J^>yKfuBN0f`>DvFkpl*wK9ccIMmJ@p}E;dOKh|)%Bvp$I&gEtxLAC_wk8tqqIKI`vdOLx8#F7k3JcP8f+?o$k23QBA?YMHc9y%x^#5`f&T|bO> zj*35?;Y5a$Ok+ATGF~Ctd$VW7Rc3ATt>YS#h|alOm*Pvr*hY1UNc=3#B^$$N@>6+a zYy6#U1f%@%+F0@$>v46HLX)o25Of{{QwU73lDoN$DFbK+Xhg%zbIEu68&h>*Lm=x;D8B{q- zi;)*L1KNhBD~d(W65Ka+9}i*$alhJw*QQ#j9Ob{xwe<;yD4Fg)gE?15yl z?=xB8)Ul$|UtzA*CNzkS&raO$Ona`QthXvpr0Q+1?FRG?;fgc5Qe?Gj&c3fq#r31rv)j{SOE!;DkN0(g1CTGgd#3IG;*^`>XHvMb^sL@ z4&lHx+H3y;7vREy3qQkmPDn^d`~YSgB)X%0_VugTnbG>g^7m@+)b||&*PXMIg9B$4 zgzWXK-Q7?^E=cFSF=hLUs9oumx+?9C5&5$(Pd+cPEyf~!kH2M}{>tyNMg5zvu&TDi zRo2ig@sK$>746MUtls0)(J`{i(x0-9Aq^Zb*o!#S^=ain)5RtcgE}53!Culk z%C5Xr&{v0Q1T;kCL7;zDp6fT(_I3y+TCjvDL|z8lk3tSebjpCt#ko*QBED0MZ3nxuR{ec=oKc*|`uCCe5rr_*Bereiche und Aufgaben von {{user_first_name}} {{user_last_name}} {% if user|usergperm:"usermanager" %} - + + + + {% if request.user.profile.agency.dynamicprofile == False %} + + {% endif %} + + {% endif %}
@@ -61,8 +77,38 @@ {% for area in areas %} -
- {%for prio in prios %} +
+ {% if request.user.profile.agency.dynamicprofile == False %} + + {% for ex in executor %} + {% if ex.area == area %} + + {% endif %} + {% endfor %} + + {% for auth in authority %} + {% if auth.area == area %} + + {% endif %} + {% endfor %} + + {% for rep in representative %} + {% if rep.area == area %} + + + {% endif %} + {% endfor %} +
+ + {% else %} + + {% for prio in prios %} {% if prio.task.area.pk == area.pk and prio.task.visible %}
{{prio.task.name}}
@@ -70,8 +116,9 @@ {% endif %} {% endfor %}
- - {% endfor %} + + {% endif %} + {% endfor %} @@ -149,8 +196,21 @@ $( document ).ready(function() { $(".arrows_area_" + sortablearea_ids[i]).hide(); $( "#sortarea_" + sortablearea_ids[i]).sortable("disable"); } + + $(document).find(".view_0").hide(); + $(document).find(".view_1").hide(); + $(document).find(".view_2").hide(); + + $(document).find(".view_2").show(); }); +function changeView(newview){ + $(document).find(".view_0").hide(); + $(document).find(".view_1").hide(); + $(document).find(".view_2").hide(); + $(document).find(".view_" + newview).show(); + +} diff --git a/orga/views.py b/orga/views.py index ebfa8c8..538a617 100644 --- a/orga/views.py +++ b/orga/views.py @@ -6,6 +6,7 @@ from users.priomodel import Prio from tasks.models import Tasks from users.models import AgencyJob import webcolors +from standards.models import Standards @login_required def mainorga(request): @@ -68,6 +69,23 @@ def singleorga(request, pk): except: userfuncname = "Nicht vergeben" + st = Standards.objects.filter(agency=request.user.profile.agency) + + representative = [] + executor = [] + authority = [] + + for s in st: + if request.user in s.representative.all(): + representative.append(s) + + if request.user in s.executor.all(): + executor.append(s) + + if request.user in s.authority.all(): + authority.append(s) + + context = { 'active_link' : 'orga', 'areas' : areas, @@ -80,8 +98,12 @@ def singleorga(request, pk): 'imageurl' : user.profile.get_photo_url, 'compfunc' : user.profile.compfunc, 'phoneland' : user.profile.phoneland, + 'representative' : representative, + 'executor' : executor, + 'authority' : authority, 'phonemobile' : user.profile.phonemobile } + print(context) return render(request, 'orga/orga_single.html', context) else: return redirect('users-dashboard') diff --git a/standards/templates/standards/standards_management.html b/standards/templates/standards/standards_management.html index acde627..9582846 100644 --- a/standards/templates/standards/standards_management.html +++ b/standards/templates/standards/standards_management.html @@ -224,9 +224,8 @@