Bug Dateien noch gelöst, hat was mit dem Signal und den Gruppen zu tun. Ansonsten Editor-Bug für IE gesondert gelöst.
This commit is contained in:
parent
ad5173f358
commit
923e400bc3
Binary file not shown.
|
|
@ -64,17 +64,24 @@ a.disabled {
|
||||||
{% for d in dirs %}
|
{% for d in dirs %}
|
||||||
|
|
||||||
{% setbool False %}
|
{% setbool False %}
|
||||||
|
|
||||||
{% for ag in d.visibleby.all %}
|
{% for ag in d.visibleby.all %}
|
||||||
{% if user|has_group:ag.group.name %}
|
{% if user|has_group:ag.group.name %}
|
||||||
{% setbool True %}
|
{% setbool True %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
|
{{d.name}}
|
||||||
|
{{d.visibleby.all|length}}
|
||||||
|
|
||||||
{% if d.visibleby.all|length == 0 %}
|
{% if d.visibleby.all|length == 0 %}
|
||||||
|
DARF
|
||||||
{% setbool True %}
|
{% setbool True %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% getbool as groupchecker %}
|
{% getbool as groupchecker %}
|
||||||
|
{{groupchecker}}
|
||||||
|
|
||||||
<tr id="dir_{{d.pk}}" class="droppable_tr">
|
<tr id="dir_{{d.pk}}" class="droppable_tr">
|
||||||
<td id="dir_{{d.pk}}_icon"><i class="fas fa-folder" ></i>
|
<td id="dir_{{d.pk}}_icon"><i class="fas fa-folder" ></i>
|
||||||
</td>
|
</td>
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -55,7 +55,8 @@ INSTALLED_APPS = [
|
||||||
'django.contrib.messages',
|
'django.contrib.messages',
|
||||||
'django.contrib.staticfiles',
|
'django.contrib.staticfiles',
|
||||||
'bootstrap_datepicker_plus',
|
'bootstrap_datepicker_plus',
|
||||||
'django_cleanup'
|
'django_cleanup',
|
||||||
|
'django_user_agents',
|
||||||
]
|
]
|
||||||
|
|
||||||
MIDDLEWARE = [
|
MIDDLEWARE = [
|
||||||
|
|
@ -66,6 +67,7 @@ MIDDLEWARE = [
|
||||||
'django.contrib.auth.middleware.AuthenticationMiddleware',
|
'django.contrib.auth.middleware.AuthenticationMiddleware',
|
||||||
'django.contrib.messages.middleware.MessageMiddleware',
|
'django.contrib.messages.middleware.MessageMiddleware',
|
||||||
'django.middleware.clickjacking.XFrameOptionsMiddleware',
|
'django.middleware.clickjacking.XFrameOptionsMiddleware',
|
||||||
|
'django_user_agents.middleware.UserAgentMiddleware',
|
||||||
]
|
]
|
||||||
|
|
||||||
ROOT_URLCONF = 'digitaleagentur.urls'
|
ROOT_URLCONF = 'digitaleagentur.urls'
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -134,6 +134,27 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- FILE FORBIDDEN DELETE FILE -->
|
||||||
|
<div class="modal fade" id="forbiddenFileType" tabindex="-1" role="dialog" data-backdrop="static" aria-labelledby="groupDelFunction" aria-hidden="true">
|
||||||
|
<div class="modal-dialog " role="document">
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header">
|
||||||
|
<h5 class="modal-title" id="exampleModalLongTitle">Datei nicht erlaubt</h5>
|
||||||
|
<button type="button" class="close" data-dismiss="modal" aria-label="Schließen">
|
||||||
|
<span aria-hidden="true">×</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
Diesen Dateitypen dürfen Sie nicht hochladen.
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<button type="button" class="btn btn-success" data-dismiss="modal">Schließen</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
//STANDARDS
|
//STANDARDS
|
||||||
actualStandards = [];
|
actualStandards = [];
|
||||||
|
|
|
||||||
|
|
@ -65,17 +65,15 @@
|
||||||
{% if standard.visibleby.all|length == 0 %}
|
{% if standard.visibleby.all|length == 0 %}
|
||||||
{% setbool True %}
|
{% setbool True %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% getbool as groupchecker %}
|
{% getbool as groupchecker %}
|
||||||
|
|
||||||
|
|
||||||
{% getvar as varcounter %}
|
{% getvar as varcounter %}
|
||||||
{% if standard.task == task and standard.area == area and varcounter < 3 %}
|
{% if standard.task == task and standard.area == area and varcounter < 3 %}
|
||||||
{% incvar %}
|
{% incvar %}
|
||||||
{% if groupchecker %}
|
{% if groupchecker %}
|
||||||
<p class="card-text"><a href="{% url 'standard-single' standard.pk %}">{{standard.name|truncatechars:40}}</a></p>
|
<p class="card-text"><a href="{% url 'standard-single' standard.pk %}">{{standard.name|truncatechars:28}}</a></p>
|
||||||
{% else %}
|
{% else %}
|
||||||
<p class="card-text text-secondary"><i class="fas fa-lock"></i> {{standard.name|truncatechars:40}}</p>
|
<p class="card-text text-secondary"><i class="fas fa-lock"></i> {{standard.name|truncatechars:28}}</p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
|
||||||
|
|
@ -131,6 +131,27 @@
|
||||||
<a class="btn" href="{% url 'standards' %} ">Abbrechen</a>
|
<a class="btn" href="{% url 'standards' %} ">Abbrechen</a>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- FILE FORBIDDEN DELETE FILE -->
|
||||||
|
<div class="modal fade" id="forbiddenFileType" tabindex="-1" role="dialog" data-backdrop="static" aria-labelledby="groupDelFunction" aria-hidden="true">
|
||||||
|
<div class="modal-dialog " role="document">
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header">
|
||||||
|
<h5 class="modal-title" id="exampleModalLongTitle">Datei nicht erlaubt</h5>
|
||||||
|
<button type="button" class="close" data-dismiss="modal" aria-label="Schließen">
|
||||||
|
<span aria-hidden="true">×</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
Diesen Dateitypen dürfen Sie nicht hochladen.
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<button type="button" class="btn btn-success" data-dismiss="modal">Schließen</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
//STANDARD
|
//STANDARD
|
||||||
function remStandard(sid, sname){
|
function remStandard(sid, sname){
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -6,6 +6,8 @@ register = template.Library()
|
||||||
|
|
||||||
b = 0
|
b = 0
|
||||||
|
|
||||||
|
groupbool = False
|
||||||
|
|
||||||
@register.simple_tag
|
@register.simple_tag
|
||||||
def setvar(value):
|
def setvar(value):
|
||||||
global b
|
global b
|
||||||
|
|
@ -26,11 +28,10 @@ def incvar():
|
||||||
|
|
||||||
@register.filter(name='has_group')
|
@register.filter(name='has_group')
|
||||||
def has_group(user, group_name):
|
def has_group(user, group_name):
|
||||||
group = Group.objects.get(name=group_name)
|
group = Group.objects.get(name=group_name)
|
||||||
return True if group in user.groups.all() else False
|
return True if group in user.groups.all() else False
|
||||||
|
|
||||||
|
|
||||||
groupbool = False
|
|
||||||
@register.simple_tag
|
@register.simple_tag
|
||||||
def setbool(value):
|
def setbool(value):
|
||||||
global groupbool
|
global groupbool
|
||||||
|
|
|
||||||
|
|
@ -184,16 +184,19 @@ def StandardUpdate(request, id):
|
||||||
for file in allfiles:
|
for file in allfiles:
|
||||||
user_can_view_file = False
|
user_can_view_file = False
|
||||||
parentdir = DataDir.objects.get(pk=file.parent.pk)
|
parentdir = DataDir.objects.get(pk=file.parent.pk)
|
||||||
if(parentdir.is_root == False):
|
|
||||||
|
if(parentdir.is_root == False and len(parentdir.visibleby.all()) > 0):
|
||||||
for p_group in parentdir.visibleby.all():
|
for p_group in parentdir.visibleby.all():
|
||||||
if p_group.group in request.user.groups.all():
|
if p_group.group in request.user.groups.all():
|
||||||
user_can_view_file = True
|
user_can_view_file = True
|
||||||
else:
|
else:
|
||||||
user_can_view_file = True
|
user_can_view_file = True
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Check if file is in standard
|
# Check if file is in standard
|
||||||
if file not in standard.addedfiles.all():
|
if file not in standard.addedfiles.all() and user_can_view_file:
|
||||||
if user_can_view_file:
|
possibleFilesByVisible.append(file)
|
||||||
possibleFilesByVisible.append(file)
|
|
||||||
|
|
||||||
possiblestandards = Standards.objects.filter(agency=request.user.profile.agency, public=True)
|
possiblestandards = Standards.objects.filter(agency=request.user.profile.agency, public=True)
|
||||||
possiblestandards_final = []
|
possiblestandards_final = []
|
||||||
|
|
@ -336,10 +339,6 @@ def updatesbyajax(request, pk):
|
||||||
# ADD
|
# ADD
|
||||||
elif(request.GET["action"] == "s_addstandard"):
|
elif(request.GET["action"] == "s_addstandard"):
|
||||||
workingstandard.linked_standards.add(Standards.objects.get(pk=request.GET["standardid"]))
|
workingstandard.linked_standards.add(Standards.objects.get(pk=request.GET["standardid"]))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
else:
|
else:
|
||||||
success = False
|
success = False
|
||||||
|
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -50,7 +50,8 @@ def adjust_group_notifications(instance, action, reverse, model, pk_set, using,
|
||||||
# GROUPSETTINGS FOR SOME USER WAS CHANGED
|
# GROUPSETTINGS FOR SOME USER WAS CHANGED
|
||||||
if isinstance(instance, Group):
|
if isinstance(instance, Group):
|
||||||
group_touched = AgencyGroup.objects.get(group=instance)
|
group_touched = AgencyGroup.objects.get(group=instance)
|
||||||
user_touched = User.objects.get(pk=list(pk_set)[0])
|
userid = list(pk_set)[0]
|
||||||
|
user_touched = User.objects.get(pk=userid)
|
||||||
|
|
||||||
# PUSH NOTIFICATION FOR GROUOPCHANGES
|
# PUSH NOTIFICATION FOR GROUOPCHANGES
|
||||||
if(user_touched.profile.add_new_group_push):
|
if(user_touched.profile.add_new_group_push):
|
||||||
|
|
@ -96,6 +97,7 @@ def adjust_group_notifications(instance, action, reverse, model, pk_set, using,
|
||||||
fail_silently=False
|
fail_silently=False
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
# SIGNAL FOR NEWS
|
# SIGNAL FOR NEWS
|
||||||
@receiver(post_save, sender=News)
|
@receiver(post_save, sender=News)
|
||||||
def save_news(sender, instance, **kwargs):
|
def save_news(sender, instance, **kwargs):
|
||||||
|
|
|
||||||
|
|
@ -26,9 +26,16 @@
|
||||||
<link href='https://fonts.googleapis.com/css?family=Roboto&display=swap' rel='stylesheet' type='text/css'>
|
<link href='https://fonts.googleapis.com/css?family=Roboto&display=swap' rel='stylesheet' type='text/css'>
|
||||||
|
|
||||||
<!-- include summernote css/js -->
|
<!-- include summernote css/js -->
|
||||||
<link href="https://cdn.jsdelivr.net/npm/summernote@0.8.15/dist/summernote.min.css" rel="stylesheet">
|
<!--<link href="https://cdn.jsdelivr.net/npm/summernote@0.8.15/dist/summernote.min.css" rel="stylesheet">
|
||||||
<script src="https://cdn.jsdelivr.net/npm/summernote@0.8.15/dist/summernote.min.js"></script>
|
<script src="https://cdn.jsdelivr.net/npm/summernote@0.8.15/dist/summernote.min.js"></script>-->
|
||||||
|
|
||||||
|
{% if request.user_agent.browser.family == "IE" %}
|
||||||
|
<link href="https://cdn.jsdelivr.net/npm/summernote@0.8.12/dist/summernote.min.css" rel="stylesheet">
|
||||||
|
<script src="https://cdn.jsdelivr.net/npm/summernote@0.8.12/dist/summernote.min.js"></script>
|
||||||
|
{% else %}
|
||||||
|
<link href="https://cdn.jsdelivr.net/npm/summernote@0.8.15/dist/summernote.min.css" rel="stylesheet">
|
||||||
|
<script src="https://cdn.jsdelivr.net/npm/summernote@0.8.15/dist/summernote.min.js"></script>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
<!-- CROPPER -->
|
<!-- CROPPER -->
|
||||||
<link href="{% static 'users/css/cropper.min.css' %}" rel="stylesheet">
|
<link href="{% static 'users/css/cropper.min.css' %}" rel="stylesheet">
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue