From 166b6ff1fcd5c0a061afa25872dda827b5a3b55c Mon Sep 17 00:00:00 2001 From: "holger.trampe" Date: Thu, 26 Mar 2020 18:48:23 +0100 Subject: [PATCH] =?UTF-8?q?0.8.2=20f=C3=BCr=20QS=20mit=20Gruppen=20f=C3=BC?= =?UTF-8?q?r=20Passwort?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 18 +-- cloud/templates/cloud/cloud_main.html | 2 +- .../dasettings/structure_content.html | 5 +- .../__pycache__/settings.cpython-38.pyc | Bin 3823 -> 3823 bytes digitaleagentur/settings.py | 9 +- media/agencymain/Anhui_China_1920x1080.jpg | Bin 0 -> 6827 bytes media/agencymain/Antarctica_1920x1080.jpg | Bin 0 -> 31865 bytes .../Antigua_Guatemala_1920x1080.jpg | Bin 0 -> 79446 bytes .../Antongil_Bay_Madagascar_1920x1080.jpg | Bin 0 -> 75780 bytes .../agencymain/Antwerp_Belgium_1920x1080.jpg | Bin 0 -> 86919 bytes .../Aphrodites_Rock_Cyprus_1920x1080.jpg | Bin 0 -> 122238 bytes .../Arches_National_Park_Utah_1920x1080.jpg | Bin 0 -> 194415 bytes ...s_National_Park_Utah_1920x1080_VcUgLSI.jpg | Bin 0 -> 164767 bytes ...s_National_Park_Utah_1920x1080_dp5GiUe.jpg | Bin 0 -> 164790 bytes .../Atitlan_Lake_Guatemala_1920x1080.jpg | Bin 0 -> 33226 bytes organizer/__pycache__/views.cpython-38.pyc | Bin 8033 -> 8768 bytes .../organizer/passwords_content.html | 115 +++++++++++++++++- .../organizer/quicklinks_content.html | 19 +-- organizer/views.py | 29 ++++- standards/__pycache__/urls.cpython-38.pyc | Bin 1198 -> 1198 bytes users/templates/users/base.html | 2 +- 21 files changed, 166 insertions(+), 33 deletions(-) create mode 100644 media/agencymain/Anhui_China_1920x1080.jpg create mode 100644 media/agencymain/Antarctica_1920x1080.jpg create mode 100644 media/agencymain/Antigua_Guatemala_1920x1080.jpg create mode 100644 media/agencymain/Antongil_Bay_Madagascar_1920x1080.jpg create mode 100644 media/agencymain/Antwerp_Belgium_1920x1080.jpg create mode 100644 media/agencymain/Aphrodites_Rock_Cyprus_1920x1080.jpg create mode 100644 media/agencymain/Arches_National_Park_Utah_1920x1080.jpg create mode 100644 media/agencymain/Arches_National_Park_Utah_1920x1080_VcUgLSI.jpg create mode 100644 media/agencymain/Arches_National_Park_Utah_1920x1080_dp5GiUe.jpg create mode 100644 media/agencymain/Atitlan_Lake_Guatemala_1920x1080.jpg diff --git a/.gitignore b/.gitignore index 8499533..bab5860 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,6 @@ media/agencydata/* -media/agencymain/* !media/agencymain/default.jpg +!media/agencymain/ag_default.jpg !media/agencymain/linkdefault.png digitaleagentur/__pycache__/* @@ -14,14 +14,6 @@ areas/migrations/* !areas/migrations/__init__.py areas/__pycache__/* -news/migrations/* -!news/migrations/__init__.py -news/__pycache__/* - -quicklinks/migrations/* -!quicklinks/migrations/__init__.py -quicklinks/__pycache__/* - standards/migrations/* !standards/migrations/__init__.py standards/__pycache__/* @@ -43,6 +35,14 @@ notificsys/migrations/* notificsys/__pycache__/* dasettings/migrations/* + +news/migrations/* +!news/migrations/__init__.py +news/__pycache__/* + +quicklinks/migrations/* +!quicklinks/migrations/__init__.py +quicklinks/__pycache__/* !dasettings/migrations/__init__.py dasettings/__pycache__/* diff --git a/cloud/templates/cloud/cloud_main.html b/cloud/templates/cloud/cloud_main.html index 208efbf..79cc29b 100644 --- a/cloud/templates/cloud/cloud_main.html +++ b/cloud/templates/cloud/cloud_main.html @@ -325,7 +325,7 @@ a.disabled { -
+
@@ -28,6 +28,23 @@ {% for ap in agpass %} + + + {% setbool False %} + + {% for passgrous in ap.visibleby.all %} + {% if user|has_group:passgrous.group.name %} + {% setbool True %} + {% endif %} + {% endfor %} + + {% if ap.visibleby.all|length == 0 %} + {% setbool True %} + {% endif %} + + {% getbool as groupchecker %} + + {% if groupchecker %} @@ -51,6 +68,7 @@ @@ -59,6 +77,10 @@ + {% else %} + + {% endif %} {% endfor %}
{{ap.name }} {{ap.link}}
+  {{ap.name}}
@@ -68,7 +90,94 @@
+ + + + diff --git a/organizer/views.py b/organizer/views.py index 4a9fd43..4832ff8 100644 --- a/organizer/views.py +++ b/organizer/views.py @@ -5,9 +5,11 @@ from .models import QuickLinks, AGContacts, AGPassword from .forms import OrganizerAddQlForm, OrganizerAddContact, OrganizerUpdateContact, AddAGPassword from django.contrib import messages from django.shortcuts import redirect -from django.http import HttpResponse, HttpResponseRedirect +from django.http import HttpResponse, HttpResponseRedirect, JsonResponse from django.contrib.auth.decorators import login_required from django.urls import reverse_lazy +from users.models import AgencyGroup + # Create your views here. class OrganizerManagement(LoginRequiredMixin, ListView): @@ -18,7 +20,7 @@ class OrganizerManagement(LoginRequiredMixin, ListView): def get_context_data(self, **kwargs): context = super().get_context_data(**kwargs) quicklinks = QuickLinks.objects.filter(agency__pk=self.request.user.profile.agency.pk).order_by('name') - context.update({'active_link' : 'organizer', 'quicklinks' : quicklinks, 'contacts' : AGContacts.objects.filter(agency__pk=self.request.user.profile.agency.pk).order_by('last_name'), 'agpass' : AGPassword.objects.filter(agency__pk=self.request.user.profile.agency.pk).order_by('name')}) + context.update({'active_link' : 'organizer', 'quicklinks' : quicklinks, 'contacts' : AGContacts.objects.filter(agency__pk=self.request.user.profile.agency.pk).order_by('last_name'), 'agpass' : AGPassword.objects.filter(agency__pk=self.request.user.profile.agency.pk).order_by('name'), 'agencygroups' : AgencyGroup.objects.filter(agency__pk=self.request.user.profile.agency.pk).order_by('agencygroupname') }) return context class OrganizerAdd(LoginRequiredMixin, CreateView): @@ -193,4 +195,27 @@ def loaddefaultql(request): tempql = QuickLinks(agency=request.user.profile.agency, name=ele[0], link=ele[1]) tempql.save() return redirect("ql-addql") + elif request.GET["action"] == "loadpassg": + data = {} + agpass = list(AGPassword.objects.filter(pk=request.GET["passid"], agency=request.user.profile.agency)) + if(len(agpass) == 1): + agpass_ele = agpass[0] + groupsid = [] + for ag in agpass_ele.visibleby.all(): + groupsid.append({"id" : ag.pk}) + data = {'success' : True, 'passgroups' : groupsid} + else: + data = {'success' : False} + return JsonResponse(data) + elif request.GET["action"] == "changepassg": + groupid = request.GET.get('groupid') + workingpass = request.GET.get('workingpass') + value = request.GET.get('value') + if(value == "true"): + AGPassword.objects.get(pk=workingpass, agency=request.user.profile.agency).visibleby.add(AgencyGroup.objects.get(pk=groupid, agency=request.user.profile.agency)) + else: + AGPassword.objects.get(pk=workingpass, agency=request.user.profile.agency).visibleby.remove(AgencyGroup.objects.get(pk=groupid, agency=request.user.profile.agency)) + + data = {'success' : False} + return JsonResponse(data) return redirect("ql-addql") \ No newline at end of file diff --git a/standards/__pycache__/urls.cpython-38.pyc b/standards/__pycache__/urls.cpython-38.pyc index a2dd1f201ebcd41b682219da0dd0d3bff40af834..edc950ca2a63646217c252580cd2ba2ea14d3b65 100644 GIT binary patch delta 20 acmZ3-xsH=Nl$V!_0SMNdsoBWAm<0eb#RW - \ No newline at end of file + \ No newline at end of file