diff --git a/dasettings/templates/dasettings/agency_content.html b/dasettings/templates/dasettings/agency_content.html index 9784143..584dccc 100644 --- a/dasettings/templates/dasettings/agency_content.html +++ b/dasettings/templates/dasettings/agency_content.html @@ -15,7 +15,7 @@
{% for formfield in agencyform %} - {% if forloop.counter|divisibleby:5 %} + {% if forloop.counter|divisibleby:6 %}
{{formfield|as_crispy_field}} diff --git a/digitaleagentur/__pycache__/settings.cpython-38.pyc b/digitaleagentur/__pycache__/settings.cpython-38.pyc index e12786e..39f9bc6 100644 Binary files a/digitaleagentur/__pycache__/settings.cpython-38.pyc and b/digitaleagentur/__pycache__/settings.cpython-38.pyc differ diff --git a/digitaleagentur/settings.py b/digitaleagentur/settings.py index 99f1eff..6d7e5be 100644 --- a/digitaleagentur/settings.py +++ b/digitaleagentur/settings.py @@ -14,33 +14,31 @@ import os # Build paths inside the project like this: os.path.join(BASE_DIR, ...) BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) - -############################################## PROD ##################################### -BASE_URL = "https://digitale-agentur.com/" +############################################## DEV ##################################### +BASE_URL = "https://dev01.digitale-agentur.com/" CRONAPIKEY = "gCddsaz6NOnE9QbXZM5LasdEk122D" # SECURITY WARNING: don't run with debug turned on in production! -DEBUG = False +DEBUG = True -# MAIL PROD +# MAIL DEV EMAIL_HOST = 'smtp.strato.de' EMAIL_PORT = 587 EMAIL_USE_TLS = True -EMAIL_HOST_USER = "support@digitale-agentur.com" -EMAIL_HOST_PASSWORD = "aPx9m3!7x3m@8o!t" -DEFAULT_FROM_EMAIL = "support@digitale-agentur.com" +EMAIL_HOST_USER = "support@dev01.digitale-agentur.com" +EMAIL_HOST_PASSWORD = "support@dev01.digitale-agentur.com" +DEFAULT_FROM_EMAIL = "support@dev01.digitale-agentur.com" -# PROD +# DEV DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', - 'NAME' : 'digitaleagentur', - 'USER' : 'digitaleagentur', - 'PASSWORD' : 'H9hzbzyBqtUCnZlIwL1qSrzh', + 'NAME' : 'digitaleagentur_dev01', + 'USER' : 'digitaleagentur_dev01', + 'PASSWORD' : 't3TvtGAOkFHYXdJlUMIu9u3U', 'PORT' : 3306 } } - -############################################## PROD ##################################### +############################################## DEV ##################################### # Nach zehn Stunden läuft der Cookie ab! diff --git a/orga/__pycache__/views.cpython-38.pyc b/orga/__pycache__/views.cpython-38.pyc index c67ae01..6363547 100644 Binary files a/orga/__pycache__/views.cpython-38.pyc and b/orga/__pycache__/views.cpython-38.pyc differ diff --git a/orga/templates/orga/orga_single.html b/orga/templates/orga/orga_single.html index fa75491..7dc5abc 100644 --- a/orga/templates/orga/orga_single.html +++ b/orga/templates/orga/orga_single.html @@ -6,13 +6,13 @@
-

Bereiche und Aufgaben von {{user_first_name}} {{user_last_name}} +

Bereiche und Tätigkeiten von {{user_first_name}} {{user_last_name}} {% if user|usergperm:"usermanager" %} - {% if request.user.profile.agency.dynamicprofile == False %} + {% if request.user.profile.agency.dynamicprofile %}


+

{{ user_first_name }} {{ user_last_name }} + + {% if request.user.profile.agency.dynamicprofile %} + + als Verantwortlicher + + + {% endif %} +

@@ -78,35 +87,32 @@ {% for area in areas %} - {% else %} + + {% endfor %} + {% else %} {% for prio in prios %} {% if prio.task.area.pk == area.pk and prio.task.visible %} @@ -197,19 +203,29 @@ $( document ).ready(function() { $( "#sortarea_" + sortablearea_ids[i]).sortable("disable"); } + + //AUTH $(document).find(".view_0").hide(); + //EX $(document).find(".view_1").hide(); + //REP $(document).find(".view_2").hide(); - $(document).find(".view_2").show(); + $(document).find(".view_0").show(); + }); function changeView(newview){ + $(document).find(".view_0").hide(); $(document).find(".view_1").hide(); $(document).find(".view_2").hide(); $(document).find(".view_" + newview).show(); - + + $(document).find("#view_info_0").hide(); + $(document).find("#view_info_1").hide(); + $(document).find("#view_info_2").hide(); + $(document).find("#view_info_" + newview).show(); } diff --git a/orga/views.py b/orga/views.py index 538a617..39f613c 100644 --- a/orga/views.py +++ b/orga/views.py @@ -55,6 +55,20 @@ def singleorga(request, pk): if(user.profile.agency.pk==request.user.profile.agency.pk): 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')) + alltasks = Tasks.objects.filter(agency__pk=request.user.profile.agency.pk).order_by('name') + + ''' + Hier werden die Tasks entsprechend ihrer Prio gespeichert, anschließend werden noch die übrigen Tasks übertragen, die noch keinen Prio-Eintrag haben. Diese haben 0 und landen dementsprechend hinten. + ''' + + tasks = [] + for p in prios: + tasks.append(p.task) + + for at in alltasks: + if at not in tasks: + tasks.append(at) + i = 0 for area in areas: areas[i].hex = areas[i].color @@ -69,22 +83,6 @@ 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', @@ -98,9 +96,10 @@ def singleorga(request, pk): 'imageurl' : user.profile.get_photo_url, 'compfunc' : user.profile.compfunc, 'phoneland' : user.profile.phoneland, - 'representative' : representative, - 'executor' : executor, - 'authority' : authority, + 'tasks' : tasks, + #'representative' : representative, + #'executor' : executor, + #'authority' : authority, 'phonemobile' : user.profile.phonemobile } print(context) diff --git a/standards/templatetags/__pycache__/counter_tag.cpython-38.pyc b/standards/templatetags/__pycache__/counter_tag.cpython-38.pyc index c786c9b..59ca8c1 100644 Binary files a/standards/templatetags/__pycache__/counter_tag.cpython-38.pyc and b/standards/templatetags/__pycache__/counter_tag.cpython-38.pyc differ diff --git a/standards/templatetags/counter_tag.py b/standards/templatetags/counter_tag.py index 08f0103..a341a8d 100644 --- a/standards/templatetags/counter_tag.py +++ b/standards/templatetags/counter_tag.py @@ -215,3 +215,47 @@ def getifuserdidcomment(standard, user): didcomment = True return didcomment + + +@register.simple_tag +def isUserInAuth(task, area, user): + st_auth = Standards.objects.filter(agency=user.profile.agency, task=task, area=area) + + found = False + + for st in st_auth: + if user in st.authority.all(): + found = True + print("AUTH FOUND") + break + + return found + +@register.simple_tag +def isUserInEx(task, area, user): + st_auth = Standards.objects.filter(agency=user.profile.agency, task=task, area=area) + + found = False + + for st in st_auth: + if user in st.executor.all(): + found = True + print("EX FOUND") + break + + return found + + +@register.simple_tag +def isUserInRep(task, area, user): + st_auth = Standards.objects.filter(agency=user.profile.agency, task=task, area=area) + + found = False + + for st in st_auth: + if user in st.representative.all(): + found = True + print("REP FOUND") + break + + return found \ No newline at end of file diff --git a/users/usersforms.py b/users/usersforms.py index 26f7f4b..e7c8fd1 100644 --- a/users/usersforms.py +++ b/users/usersforms.py @@ -78,9 +78,10 @@ class AgencyUpdateForm(forms.ModelForm): "city" : "Stadt", "agency_email" : "E-Mail", "phone" : "Telefon", + "dynamicprofile" : "Dynamischer Steckbrief", "agencypic" : "Agenturbild" } - fields = ['name','inhaber','agency_email', 'phone', 'street', 'plz', 'city', 'agencypic', 'x', 'y', 'width', 'height', 'rotation'] + fields = ['name','inhaber','agency_email', 'phone', 'street', 'plz', 'city', 'dynamicprofile', 'agencypic', 'x', 'y', 'width', 'height', 'rotation'] def save(self): photo = super(AgencyUpdateForm, self).save()
- {% if request.user.profile.agency.dynamicprofile == False %} + {% if request.user.profile.agency.dynamicprofile %} - {% for ex in executor %} - {% if ex.area == area %} - + {% for task in tasks %} + {% isUserInAuth task area request.user as checkIsUserAuth %} + {% if task.area.pk == area.pk and task.visible and checkIsUserAuth %} + {% endif %} - {% endfor %} - {% for auth in authority %} - {% if auth.area == area %} - + {% isUserInEx task area request.user as checkIsUserEx %} + {% if task.area.pk == area.pk and task.visible and checkIsUserEx %} + {% endif %} - {% endfor %} - {% for rep in representative %} - {% if rep.area == area %} - - + {% isUserInRep task area request.user as checkIsUserRep %} + {% if task.area.pk == area.pk and task.visible and checkIsUserRep %} + {% endif %} - {% endfor %} -
-