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.
|
|
@ -62,19 +62,26 @@ a.disabled {
|
|||
</thead>
|
||||
<tbody>
|
||||
{% for d in dirs %}
|
||||
|
||||
|
||||
{% setbool False %}
|
||||
|
||||
{% for ag in d.visibleby.all %}
|
||||
{% if user|has_group:ag.group.name %}
|
||||
{% setbool True %}
|
||||
{% endif %}
|
||||
{% if user|has_group:ag.group.name %}
|
||||
{% setbool True %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
{% if d.visibleby.all|length == 0 %}
|
||||
{% setbool True %}
|
||||
{% endif %}
|
||||
{{d.name}}
|
||||
{{d.visibleby.all|length}}
|
||||
|
||||
{% if d.visibleby.all|length == 0 %}
|
||||
DARF
|
||||
{% setbool True %}
|
||||
{% endif %}
|
||||
|
||||
{% getbool as groupchecker %}
|
||||
{{groupchecker}}
|
||||
|
||||
<tr id="dir_{{d.pk}}" class="droppable_tr">
|
||||
<td id="dir_{{d.pk}}_icon"><i class="fas fa-folder" ></i>
|
||||
</td>
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -55,7 +55,8 @@ INSTALLED_APPS = [
|
|||
'django.contrib.messages',
|
||||
'django.contrib.staticfiles',
|
||||
'bootstrap_datepicker_plus',
|
||||
'django_cleanup'
|
||||
'django_cleanup',
|
||||
'django_user_agents',
|
||||
]
|
||||
|
||||
MIDDLEWARE = [
|
||||
|
|
@ -66,6 +67,7 @@ MIDDLEWARE = [
|
|||
'django.contrib.auth.middleware.AuthenticationMiddleware',
|
||||
'django.contrib.messages.middleware.MessageMiddleware',
|
||||
'django.middleware.clickjacking.XFrameOptionsMiddleware',
|
||||
'django_user_agents.middleware.UserAgentMiddleware',
|
||||
]
|
||||
|
||||
ROOT_URLCONF = 'digitaleagentur.urls'
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -134,6 +134,27 @@
|
|||
</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">
|
||||
//STANDARDS
|
||||
actualStandards = [];
|
||||
|
|
|
|||
|
|
@ -65,17 +65,15 @@
|
|||
{% if standard.visibleby.all|length == 0 %}
|
||||
{% setbool True %}
|
||||
{% endif %}
|
||||
|
||||
{% getbool as groupchecker %}
|
||||
|
||||
|
||||
|
||||
{% getvar as varcounter %}
|
||||
{% if standard.task == task and standard.area == area and varcounter < 3 %}
|
||||
{% incvar %}
|
||||
{% 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 %}
|
||||
<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 %}
|
||||
{% endfor %}
|
||||
|
|
|
|||
|
|
@ -131,6 +131,27 @@
|
|||
<a class="btn" href="{% url 'standards' %} ">Abbrechen</a>
|
||||
</form>
|
||||
</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">
|
||||
//STANDARD
|
||||
function remStandard(sid, sname){
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -6,6 +6,8 @@ register = template.Library()
|
|||
|
||||
b = 0
|
||||
|
||||
groupbool = False
|
||||
|
||||
@register.simple_tag
|
||||
def setvar(value):
|
||||
global b
|
||||
|
|
@ -26,11 +28,10 @@ def incvar():
|
|||
|
||||
@register.filter(name='has_group')
|
||||
def has_group(user, group_name):
|
||||
group = Group.objects.get(name=group_name)
|
||||
return True if group in user.groups.all() else False
|
||||
group = Group.objects.get(name=group_name)
|
||||
return True if group in user.groups.all() else False
|
||||
|
||||
|
||||
groupbool = False
|
||||
@register.simple_tag
|
||||
def setbool(value):
|
||||
global groupbool
|
||||
|
|
@ -39,7 +40,7 @@ def setbool(value):
|
|||
|
||||
@register.simple_tag
|
||||
def getbool():
|
||||
global groupbool
|
||||
global groupbool
|
||||
return groupbool
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -181,19 +181,22 @@ def StandardUpdate(request, id):
|
|||
|
||||
allfiles = DataFile.objects.filter(agency=request.user.profile.agency)
|
||||
|
||||
for file in allfiles:
|
||||
for file in allfiles:
|
||||
user_can_view_file = False
|
||||
parentdir = DataDir.objects.get(pk=file.parent.pk)
|
||||
if(parentdir.is_root == False):
|
||||
for p_group in parentdir.visibleby.all():
|
||||
|
||||
if(parentdir.is_root == False and len(parentdir.visibleby.all()) > 0):
|
||||
for p_group in parentdir.visibleby.all():
|
||||
if p_group.group in request.user.groups.all():
|
||||
user_can_view_file = True
|
||||
user_can_view_file = True
|
||||
else:
|
||||
user_can_view_file = True
|
||||
|
||||
|
||||
|
||||
# Check if file is in standard
|
||||
if file not in standard.addedfiles.all():
|
||||
if user_can_view_file:
|
||||
possibleFilesByVisible.append(file)
|
||||
if file not in standard.addedfiles.all() and user_can_view_file:
|
||||
possibleFilesByVisible.append(file)
|
||||
|
||||
possiblestandards = Standards.objects.filter(agency=request.user.profile.agency, public=True)
|
||||
possiblestandards_final = []
|
||||
|
|
@ -336,10 +339,6 @@ def updatesbyajax(request, pk):
|
|||
# ADD
|
||||
elif(request.GET["action"] == "s_addstandard"):
|
||||
workingstandard.linked_standards.add(Standards.objects.get(pk=request.GET["standardid"]))
|
||||
|
||||
|
||||
|
||||
|
||||
else:
|
||||
success = False
|
||||
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -49,8 +49,9 @@ def adjust_group_notifications(instance, action, reverse, model, pk_set, using,
|
|||
GLOBALSENDMAILS = True
|
||||
# GROUPSETTINGS FOR SOME USER WAS CHANGED
|
||||
if isinstance(instance, Group):
|
||||
group_touched = AgencyGroup.objects.get(group=instance)
|
||||
user_touched = User.objects.get(pk=list(pk_set)[0])
|
||||
group_touched = AgencyGroup.objects.get(group=instance)
|
||||
userid = list(pk_set)[0]
|
||||
user_touched = User.objects.get(pk=userid)
|
||||
|
||||
# PUSH NOTIFICATION FOR GROUOPCHANGES
|
||||
if(user_touched.profile.add_new_group_push):
|
||||
|
|
@ -95,6 +96,7 @@ def adjust_group_notifications(instance, action, reverse, model, pk_set, using,
|
|||
html_message=msg_html,
|
||||
fail_silently=False
|
||||
)
|
||||
|
||||
|
||||
# SIGNAL FOR NEWS
|
||||
@receiver(post_save, sender=News)
|
||||
|
|
|
|||
|
|
@ -26,9 +26,16 @@
|
|||
<link href='https://fonts.googleapis.com/css?family=Roboto&display=swap' rel='stylesheet' type='text/css'>
|
||||
|
||||
<!-- 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>-->
|
||||
|
||||
{% 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 -->
|
||||
<link href="{% static 'users/css/cropper.min.css' %}" rel="stylesheet">
|
||||
|
|
|
|||
Loading…
Reference in New Issue