0.8.2 für QS mit Gruppen für Passwort
|
|
@ -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__/*
|
||||
|
||||
|
|
|
|||
|
|
@ -325,7 +325,7 @@ a.disabled {
|
|||
<div class="modal-dialog " role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="exampleModalLongTitle">Zugriffe einschränken</h5>
|
||||
<h5 class="modal-title" id="exampleModalLongTitle">Zugriff einschränken</h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Schließen">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@
|
|||
-o-transition: all linear .2s;
|
||||
transition: all linear .2s;
|
||||
}
|
||||
noclickeffect:active { border-style: outset !important;}
|
||||
|
||||
.colorPickSelector:hover { transform: scale(1.1); }
|
||||
</style>
|
||||
|
|
@ -34,8 +35,8 @@
|
|||
<h5 class="mb-0" style="opacity:1.0;">
|
||||
|
||||
<small><span style="color: #FFFFFF;"><i class="fas fa-sort"></i> </span></small>
|
||||
<button class="btn btn-link " data-toggle="collapse" data-target="#area_content_{{area.pk}}" aria-expanded="false" aria-controls="area_content_{{area.pk}}"><small><span style="color: #FFFFFF;"><i class="fas fa-chevron-down"></i></span></small></button>
|
||||
<button class="btn btn-link" data-toggle="collapse" data-target="#area_content_{{area.pk}}" aria-expanded="false" aria-controls="area_content_{{area.pk}}">
|
||||
<button class="btn noclickeffect" data-toggle="collapse" data-target="#area_content_{{area.pk}}" aria-expanded="false" aria-controls="area_content_{{area.pk}}"><small><span style="color: #FFFFFF;"><i class="fas fa-chevron-down"></i></span></small></button>
|
||||
<button class="btn noclickeffect" data-toggle="collapse" data-target="#area_content_{{area.pk}}" aria-expanded="false" aria-controls="area_content_{{area.pk}}">
|
||||
<span id="areaname_{{area.pk}}" style="color: #ffffff">Bereich <b>{{area.name}} </b></span>
|
||||
</button>
|
||||
<button type="button" style="float: right" class="btn btn-light btn-sm" onclick="javascript:addArea({{area.pk}})" data-toggle="tooltip" data-placement="top" title="Bereichsnamen und -farbe ändern"><small><i class="fas fa-pen"></i></small></button>
|
||||
|
|
|
|||
|
|
@ -175,21 +175,14 @@ GRAPPELLI_CLEAN_INPUT_TYPES = False
|
|||
|
||||
# EMAILs
|
||||
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
|
||||
'''
|
||||
|
||||
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 = 'gymhum.de'
|
||||
EMAIL_PORT = 587
|
||||
EMAIL_USE_TLS = True
|
||||
EMAIL_HOST_USER = "holger.trampe"
|
||||
EMAIL_HOST_PASSWORD = "Motte2016_!"
|
||||
DEFAULT_FROM_EMAIL = "holger.trampe@gymhum.de"
|
||||
|
||||
# FOR DATEPICKER
|
||||
BOOTSTRAP4 = {
|
||||
|
|
|
|||
|
After Width: | Height: | Size: 6.7 KiB |
|
After Width: | Height: | Size: 31 KiB |
|
After Width: | Height: | Size: 78 KiB |
|
After Width: | Height: | Size: 74 KiB |
|
After Width: | Height: | Size: 85 KiB |
|
After Width: | Height: | Size: 119 KiB |
|
After Width: | Height: | Size: 190 KiB |
|
After Width: | Height: | Size: 161 KiB |
|
After Width: | Height: | Size: 161 KiB |
|
After Width: | Height: | Size: 32 KiB |
|
|
@ -10,7 +10,7 @@
|
|||
<input class="form-control" id="passwords_search" style="max-width: 400px;" size="20" type="text" onkeyup="" placeholder="Suche nach Passwort...">
|
||||
</div>
|
||||
</div></div>
|
||||
<div class="table-responsive">
|
||||
<div class="table-responsive" style="min-height: 400px;">
|
||||
<table class="table table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
|
|
@ -28,6 +28,23 @@
|
|||
</thead>
|
||||
<tbody id="table_passwords">
|
||||
{% 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 %}
|
||||
<tr>
|
||||
<td>{{ap.name }}</td>
|
||||
<td><a href="{{ap.link }}" target="_blank">{{ap.link}}</a></td>
|
||||
|
|
@ -51,6 +68,7 @@
|
|||
</a>
|
||||
<div class="dropdown-menu dropdown-menu-right shadow animated--fade-in" aria-labelledby="dropdownMenuLink">
|
||||
<a class="dropdown-item" href="{% url 'aggpass-update' ap.pk %}">Bearbeiten</a>
|
||||
<a class="dropdown-item" href="javascript:showGroupChangeModal({{ap.pk}})">Zugriff einschränken</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item text-danger" href="{% url 'pass-delete' ap.pk %}" >Löschen</a>
|
||||
</div>
|
||||
|
|
@ -59,6 +77,10 @@
|
|||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{% else %}
|
||||
<tr><td id="pass_{{ap.pk}}" class="droppable_tr" data-toggle="popover" data-placement="top" data-trigger="hover" title="Zugriffsbeschränkung" data-content="Zugriff beschränkt auf {% for passgroup in ap.visibleby.all %}{{passgroup.agencygroupname}}{% if forloop.counter < d.visibleby.all|length %}, {%endif%}{% endfor %}">
|
||||
<span class="text-secondary"><i class="fas fa-lock"></i> {{ap.name}}</span></td><td></td><td></td><td></td><td></td></tr>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
|
|
@ -68,7 +90,94 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="modal fade" id="changeGroupOfPass" tabindex="-1" role="dialog" data-backdrop="static" aria-labelledby="" aria-hidden="true">
|
||||
<div class="modal-dialog " role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="exampleModalLongTitle">Zugriff einschränken</h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Schließen">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
Welche Gruppen dürfen auf dieses Passwort zugreifen?
|
||||
<p><small>Ist keine Gruppe ausgewählt, darf jeder der Agentur diese Daten sehen!</small></p>
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
{% for g in agencygroups %}
|
||||
{% if forloop.counter|divisibleby:6 %}
|
||||
</div> <div class="col-6">
|
||||
<div class="custom-control custom-checkbox mb-2">
|
||||
<input type="checkbox" class="custom-control-input groupclass" name="group_{{g.pk}}" id="group_{{g.pk}}" onchange="javascript:changeGroup({{g.pk}}, this.checked)">
|
||||
<label class="custom-control-label" for="group_{{g.pk}}" >{{g.agencygroupname}}</label>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="custom-control custom-checkbox mb-2">
|
||||
<input type="checkbox" class="custom-control-input groupclass" name="group_{{g.pk}}" id="group_{{g.pk}}" onchange="javascript:changeGroup({{g.pk}}, this.checked)">
|
||||
<label class="custom-control-label" for="group_{{g.pk}}" >{{g.agencygroupname}}</label>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div></div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-success" data-dismiss="modal">Beenden</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<script>
|
||||
var workingpass = "";
|
||||
//GROUPS
|
||||
function showGroupChangeModal(tochangeid){
|
||||
console.log("HI!");
|
||||
$("#changeGroupOfPass").modal("toggle");
|
||||
$(".groupclass").attr("checked", false);
|
||||
workingpass = tochangeid;
|
||||
$.ajax(
|
||||
{
|
||||
type: "GET",
|
||||
url: "{% url 'ql-ajaxloaddef' %}",
|
||||
data:{
|
||||
action : "loadpassg",
|
||||
passid : workingpass
|
||||
},
|
||||
success: function( data )
|
||||
{
|
||||
for(i = 0; i < data["passgroups"].length; i++){
|
||||
$("#group_" + data["passgroups"][i]['id']).attr("checked", true);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$('#changeGroupOfPass').on('hidden.bs.modal', function (e) {
|
||||
window.location = window.location
|
||||
})
|
||||
|
||||
function changeGroup(groupid, value){
|
||||
$.ajax(
|
||||
{
|
||||
type: "GET",
|
||||
url: "{% url 'ql-ajaxloaddef' %}",
|
||||
data:{
|
||||
action : "changepassg",
|
||||
groupid : groupid,
|
||||
workingpass : workingpass,
|
||||
value : value
|
||||
},
|
||||
success: function( data )
|
||||
{
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
function showAgPass(id){
|
||||
$("#pass_" + id).toggle();
|
||||
$("#pass_cl_" + id).toggle();
|
||||
|
|
@ -102,6 +211,10 @@
|
|||
});
|
||||
});
|
||||
|
||||
$('[data-toggle="popover"]').popover();
|
||||
|
||||
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
|
|
@ -3,15 +3,15 @@
|
|||
<div class="row">
|
||||
<div class="content-section col-4">
|
||||
<a class="btn btn-primary" href="{% url 'ql-addql' %}"><i class="fas fa-plus"></i> Quicklink</a>
|
||||
|
||||
<div class="form-group mb-2 mt-3">
|
||||
<input class="form-control" id="quicklinks_search" size="50" type="text" placeholder="Suche nach Qiucklinks...">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="row mt-3">
|
||||
<div class="form-group mb-2">
|
||||
<input class="form-control" id="quicklinks_search" size="50" type="text" placeholder="Suche in Tabelle...">
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mt-3 col-9" >
|
||||
|
||||
<div class="row col-9" >
|
||||
<div class="table-responsive">
|
||||
<table class="table table-hover">
|
||||
<thead>
|
||||
|
|
@ -49,9 +49,9 @@
|
|||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% if user|usergperm:"moduleorganizer" %}
|
||||
<!-- {% if user|usergperm:"moduleorganizer" %}
|
||||
<a class="btn btn-primary" href="#" onclick="saveDefQL()">ERGO-Quicklinks laden</a>
|
||||
{% endif %}
|
||||
{% endif %}-->
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
|
|
@ -67,6 +67,7 @@ $(document).ready(function(){
|
|||
});
|
||||
|
||||
function saveDefQL(){
|
||||
/*
|
||||
$.ajax(
|
||||
{
|
||||
type: "GET",
|
||||
|
|
@ -78,6 +79,6 @@ function saveDefQL(){
|
|||
{
|
||||
location.reload();
|
||||
}
|
||||
});
|
||||
});*/
|
||||
}
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -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")
|
||||