Zwischensicherung 0.8.2 Standards optimiert Dropdpwn angepasst Ordner für Standards
This commit is contained in:
parent
7220b8185b
commit
11c5815c72
|
|
@ -29,6 +29,7 @@ class DataDir(models.Model):
|
|||
name = models.CharField(max_length=2000, default="", blank=True, null=True)
|
||||
def2 = models.CharField(max_length=2000, default="", blank=True, null=True)
|
||||
is_root = models.BooleanField(default=False)
|
||||
is_defaultstandard = models.BooleanField(default=False)
|
||||
dirs = models.ManyToManyField('self', blank=True, related_name='dirs_in_dirs', symmetrical = False)
|
||||
visibleby = models.ManyToManyField(AgencyGroup, blank=True, related_name='visible_by_user')
|
||||
date_created = models.DateTimeField(default = timezone.now)
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ a.disabled {
|
|||
<td>{{d.date_created|date:"d.m.Y G:i"}}</td>
|
||||
<td>{{d.date_last_modified|date:"d.m.Y G:i"}}</td>
|
||||
<td>
|
||||
{% if user|usergperm:"filedirmanager" and groupchecker%}
|
||||
{% if user|usergperm:"filedirmanager" and groupchecker and d.is_defaultstandard == False %}
|
||||
<div class="dropdown no-arrow">
|
||||
<a class="dropdown-toggle" href="#" role="button" id="dropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
<i class="fas fa-ellipsis-v fa-sm fa-fw text-gray-400"></i>
|
||||
|
|
@ -522,6 +522,7 @@ allowedtypes = "application/msword, application/vnd.ms-excel, application/vnd.ms
|
|||
function uploadAction(filetodo, parid){
|
||||
var formData = new FormData($("#uploadFileForm")[0]);
|
||||
formData.append("uploadedfile", filetodo);
|
||||
formData.append("uploadsource", "cloud");
|
||||
var bar = $('.bar');
|
||||
var percent = $('.percent');
|
||||
if(allowedtypes.includes(filetodo.type) && filetodo.type.length > 0){
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@ def CloudMain(request, pk):
|
|||
while( singleObj.is_root != True):
|
||||
breadcrump.append(singleObj)
|
||||
singleObj = DataDir.objects.get(pk=singleObj.parent.pk, agency=request.user.profile.agency)
|
||||
|
||||
# Navi oben einmal umdrehen
|
||||
breadcrump = breadcrump[::-1]
|
||||
|
||||
context = {
|
||||
|
|
@ -177,13 +177,13 @@ def adddirbyajax(request, parent):
|
|||
grouopsid = []
|
||||
for ag in allgroupsofdir:
|
||||
grouopsid.append({"id" : ag.pk})
|
||||
print(grouopsid)
|
||||
|
||||
data = {"gdir" : grouopsid}
|
||||
|
||||
elif request.method == 'POST':
|
||||
tempdir = False
|
||||
tempdir = DataDir.objects.get(pk=parent)
|
||||
|
||||
uploadsource = request.POST["uploadsource"]
|
||||
# VALIDATE FILE-TYPE
|
||||
file_ext = request.FILES['uploadedfile'].name.split(".")[1]
|
||||
|
||||
|
|
@ -194,7 +194,13 @@ def adddirbyajax(request, parent):
|
|||
file_ok = True
|
||||
|
||||
if(file_ok):
|
||||
tempdatafile = DataFile(file=request.FILES['uploadedfile'], name=request.FILES['uploadedfile'].name, owner=request.user, parent=tempdir, agency=request.user.profile.agency)
|
||||
datadir_parentid = 0
|
||||
if(uploadsource == "standards"):
|
||||
datadir_parentid = list(DataDir.objects.filter(is_defaultstandard=True, agency__pk=request.user.profile.agency.pk))[0]
|
||||
else:
|
||||
datadir_parentid = tempdir
|
||||
|
||||
tempdatafile = DataFile(file=request.FILES['uploadedfile'], name=request.FILES['uploadedfile'].name, owner=request.user, parent=datadir_parentid, agency=request.user.profile.agency)
|
||||
tempdatafile.save()
|
||||
data = {'savedobj_id' : tempdatafile.pk, 'savedobj_name' : tempdatafile.name}
|
||||
else:
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
|
|
@ -231,6 +231,7 @@ $('#uploadedfile').on('change', function() {
|
|||
function uploadAction(filetodo){
|
||||
var formData = new FormData();
|
||||
formData.append("uploadedfile", filetodo);
|
||||
formData.append("uploadsource", "standards");
|
||||
if(allowedtypes.includes(filetodo.type) && filetodo.type.length > 0){
|
||||
$.ajax({
|
||||
url: "{% url 'cloud-adddir' parentid %}",
|
||||
|
|
|
|||
|
|
@ -30,57 +30,49 @@
|
|||
{% endif %}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="col">
|
||||
<div class="tab-content" id="area_contents">
|
||||
{% for area in areas %}
|
||||
{% for area in areas %}
|
||||
<div class="tab-pane fade" id="t_{{area.id}}" role="tabpanel" aria-labelledby="{{area.id}}">
|
||||
<h5 class="mt-3"><a href="{% url 'standard-area' area.id %}" style="color: #000000;">Standards aus dem Bereich {{area.name}}</a></h5>
|
||||
<hr>
|
||||
{% for task in tasks %}
|
||||
|
||||
{% if task.area == area %}
|
||||
<div class="card text-center mt-1 mr-3 mb-3" style="width: 18rem; height: 12rem; float: left">
|
||||
{% for ele in standardcontent %}
|
||||
{% if ele.area == area %}
|
||||
|
||||
{% for task in ele.tasks %}
|
||||
<div class="card text-center mt-1 mr-3 mb-3" style="width: 18rem; height: 12rem; float: left">
|
||||
<div class="card-body">
|
||||
{% setvar 0 %}
|
||||
{% for standard in standards_of_agency %}
|
||||
{% getvar as varcounter %}
|
||||
{% if standard.task == task and standard.area == area%}
|
||||
{% incvar %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% getvar as varcounter %}
|
||||
<h5 class="card-title">
|
||||
<a href="{% url 'standard-task' task.pk %}" style="color: #000000;">{{task.name}}</a> <small>({{varcounter}})</small>
|
||||
</h5>
|
||||
{% setvar 0 %}
|
||||
{% for standard in standards_of_agency %}
|
||||
<!-- CHECK FOR GROUPVISIBLE -->
|
||||
{% setbool False %}
|
||||
{% for ag in standard.visibleby.all %}
|
||||
{% if request.user|has_group:ag.group.name %}
|
||||
{% setbool True %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
{% if standard.visibleby.all|length == 0 %}
|
||||
<a href="{% url 'standard-task' task.task.pk %}" style="color: #000000;">{{task.task.name}}</a> <small>({{task.standards.count}})</small>
|
||||
</h5>
|
||||
<!-- STANDARS -->
|
||||
{% for s in task.standards %}
|
||||
<!-- VISIBLE GROUPCHECK -->
|
||||
{% setbool False %}
|
||||
{% for ag in s.visibleby.all %}
|
||||
{% if request.user|has_group:ag.group.name %}
|
||||
{% setbool True %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% if s.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:28}}</a></p>
|
||||
{% getbool as groupchecker %}
|
||||
{% if forloop.counter0 < 3 %}
|
||||
{% if groupchecker %}
|
||||
<p class="card-text"><a href="{% url 'standard-single' s.pk %}">{{s.name|truncatechars:28}}</a></p>
|
||||
{% else %}
|
||||
<p class="card-text text-secondary"><i class="fas fa-lock"></i> {{standard.name|truncatechars:28}}</p>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
<p class="card-text text-secondary"><i class="fas fa-lock"></i> {{s.name|truncatechars:28}}</p>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
<div class="tab-pane fade" id="t_userown" role="tabpanel" aria-labelledby="userown">
|
||||
|
|
@ -193,6 +185,7 @@
|
|||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
|
||||
$(document).ready(function(){
|
||||
$('#area_tabs li:first-child a').tab('show');
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,224 @@
|
|||
{% extends "users/base.html" %}
|
||||
{% load counter_tag %}
|
||||
|
||||
{% block content %}
|
||||
<div class="content-section col-12">
|
||||
<h3>Standards <small><i data-toggle="tooltip" data-placement="top" title="Standards dokumentieren und erläutern verschiedenen Verfahren, strukturiert nach Bereichen und Aufgaben." class="far fa-question-circle"></i></small></h3>
|
||||
<small>Sichtbar sind alle veröffentlichten und von {{ user.first_name }} {{ user.last_name}} erstellten Standards.</small>
|
||||
<hr>
|
||||
<div class="row">
|
||||
<div class="content-section col-4">
|
||||
<a class="btn btn-primary" href="{% url 'standard-add' %}"><i class="fas fa-plus"></i> Standard</a>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<ul class="nav nav-tabs" id="area_tabs" role="tablist">
|
||||
{% for area in areas %}
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" id="{{area.id}}" data-toggle="tab" href="#t_{{area.id}}" role="tab" aria-controls="t_{{area.id}}" aria-selected="false">{{area.name}}</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" id="userown" data-toggle="tab" href="#t_userown" role="tab" aria-controls="t_userown" aria-selected="false">Eigene Standards</a>
|
||||
</li>
|
||||
{% if perms.users.standard_management %}
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" id="agencys" data-toggle="tab" href="#t_agencys" role="tab" aria-controls="t_agencys" aria-selected="false">Unveröffentlichte Standards</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="tab-content" id="area_contents">
|
||||
{% for area in areas %}
|
||||
<div class="tab-pane fade" id="t_{{area.id}}" role="tabpanel" aria-labelledby="{{area.id}}">
|
||||
<h5 class="mt-3"><a href="{% url 'standard-area' area.id %}" style="color: #000000;">Standards aus dem Bereich {{area.name}}</a></h5>
|
||||
<hr>
|
||||
{% for task in tasks %}
|
||||
|
||||
{% if task.area == area %}
|
||||
<div class="card text-center mt-1 mr-3 mb-3" style="width: 18rem; height: 12rem; float: left">
|
||||
<div class="card-body">
|
||||
{% setvar 0 %}
|
||||
{% for standard in standards_of_agency %}
|
||||
{% getvar as varcounter %}
|
||||
{% if standard.task == task and standard.area == area%}
|
||||
{% incvar %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% getvar as varcounter %}
|
||||
<h5 class="card-title">
|
||||
<a href="{% url 'standard-task' task.pk %}" style="color: #000000;">{{task.name}}</a> <small>({{varcounter}})</small>
|
||||
</h5>
|
||||
{% setvar 0 %}
|
||||
{% for standard in standards_of_agency %}
|
||||
<!-- CHECK FOR GROUPVISIBLE -->
|
||||
{% setbool False %}
|
||||
{% for ag in standard.visibleby.all %}
|
||||
{% if request.user|has_group:ag.group.name %}
|
||||
{% setbool True %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
{% 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:28}}</a></p>
|
||||
{% else %}
|
||||
<p class="card-text text-secondary"><i class="fas fa-lock"></i> {{standard.name|truncatechars:28}}</p>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
<div class="tab-pane fade" id="t_userown" role="tabpanel" aria-labelledby="userown">
|
||||
<h4 class="mt-4 mb-4">Ihre Standards</h4>
|
||||
<div class="form-group mb-2">
|
||||
<input class="form-control" id="tableSearch" size="20" type="text" placeholder="Suche in Tabelle...">
|
||||
</div>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">Titel</th>
|
||||
<th scope="col">Erstellt am</th>
|
||||
<th scope="col">Geändert von</th>
|
||||
<th scope="col">Geändert am</th>
|
||||
<th scope="col">Öffentlichkeitsstatus</th>
|
||||
<th scope="col"> </th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="tableresults">
|
||||
{% for standard in standards_of_user %}
|
||||
<tr>
|
||||
<td><a href="{% url 'standard-single' standard.pk %}">{{standard.name}}</a></td>
|
||||
<td>{{standard.created_standard_date|date:"d.m.Y, H:i"}}</td>
|
||||
<td>{{standard.last_modified_by.first_name}} {{standard.last_modified_by.last_name}}</td>
|
||||
<td>{{standard.last_modified_on|date:"d.m.Y, H:i"}}</td>
|
||||
<td>{{standard.public|yesno:"Öffentlich,Nicht öffentlich"}}</td>
|
||||
<td>
|
||||
<div class="dropdown no-arrow">
|
||||
<a class="dropdown-toggle" href="#" role="button" id="dropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
<i class="fas fa-ellipsis-v fa-sm fa-fw text-gray-400"></i>
|
||||
</a>
|
||||
<div class="dropdown-menu dropdown-menu-right shadow animated--fade-in" aria-labelledby="dropdownMenuLink">
|
||||
{% if perms.users.standard_management %}
|
||||
{% if standard.public %}
|
||||
<a class="dropdown-item" href="{% url 'standard-status' standard.pk %}">Veröffentlichung aufheben</a>
|
||||
{% else %}
|
||||
<a class="dropdown-item" href="{% url 'standard-status' standard.pk %}">Veröffentlichen</a>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% if standard.created_standard_by == request.user or perms.users.standard_management %}
|
||||
<a class="dropdown-item" href="{% url 'standard-update' standard.pk %}">Bearbeiten</a>
|
||||
{% endif %}
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item text-danger" href="{% url 'standard-delete' standard.pk %}" >Löschen</a>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="t_agencys" role="tabpanel" aria-labelledby="userown">
|
||||
<h4 class="mt-4 mb-4">Unveröffentlichte Standards</h4>
|
||||
<div class="form-group mb-2">
|
||||
<input class="form-control" id="tableSearch_s" size="20" type="text" placeholder="Suche in Tabelle...">
|
||||
</div>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">Titel</th>
|
||||
<th scope="col">Erstellt am</th>
|
||||
<th scope="col">Geändert von</th>
|
||||
<th scope="col">Geändert am</th>
|
||||
<th scope="col">Öffentlichkeitsstatus</th>
|
||||
<th scope="col"> </th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="tableresults_s">
|
||||
{% for standard in unpubstandards_of_user %}
|
||||
<tr>
|
||||
<td><a href="{% url 'standard-single' standard.pk %}">{{standard.name}}</a></td>
|
||||
<td>{{standard.created_standard_date|date:"d.m.Y, H:i"}}</td>
|
||||
<td>{{standard.last_modified_by.first_name}} {{standard.last_modified_by.last_name}}</td>
|
||||
<td>{{standard.last_modified_on|date:"d.m.Y, H:i"}}</td>
|
||||
<td>{{standard.public|yesno:"Öffentlich,Nicht öffentlich"}}</td>
|
||||
<td>
|
||||
<div class="dropdown no-arrow">
|
||||
<a class="dropdown-toggle" href="#" role="button" id="dropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
<i class="fas fa-ellipsis-v fa-sm fa-fw text-gray-400"></i>
|
||||
</a>
|
||||
<div class="dropdown-menu dropdown-menu-right shadow animated--fade-in" aria-labelledby="dropdownMenuLink">
|
||||
{% if perms.users.standard_management %}
|
||||
{% if standard.public %}
|
||||
<a class="dropdown-item" href="{% url 'standard-status' standard.pk %}">Veröffentlichung aufheben</a>
|
||||
{% else %}
|
||||
<a class="dropdown-item" href="{% url 'standard-status' standard.pk %}">Veröffentlichen</a>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% if standard.created_standard_by == request.user or perms.users.standard_management %}
|
||||
<a class="dropdown-item" href="{% url 'standard-update' standard.pk %}">Bearbeiten</a>
|
||||
{% endif %}
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item text-danger" href="{% url 'standard-delete' standard.pk %}" >Löschen</a>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
|
||||
console.log();
|
||||
|
||||
$(document).ready(function(){
|
||||
$('#area_tabs li:first-child a').tab('show');
|
||||
|
||||
$("#tableSearch").on("keyup", function() {
|
||||
var value = $(this).val().toLowerCase();
|
||||
$("#tableresults tr").filter(function() {
|
||||
$(this).toggle($(this).text().toLowerCase().indexOf(value) > -1)
|
||||
});
|
||||
});
|
||||
|
||||
$("#tableSearch_s").on("keyup", function() {
|
||||
var value = $(this).val().toLowerCase();
|
||||
$("#tableresults_s tr").filter(function() {
|
||||
$(this).toggle($(this).text().toLowerCase().indexOf(value) > -1)
|
||||
});
|
||||
});
|
||||
})
|
||||
|
||||
|
||||
$('#area_tabs a').on('click', function (e) {
|
||||
e.preventDefault()
|
||||
$(this).tab('show')
|
||||
});
|
||||
|
||||
</script>
|
||||
{% endblock content %}
|
||||
|
|
@ -100,8 +100,10 @@
|
|||
<button type="button" onclick="javascript:clearSearchfieldAddStandard()" class="btn btn-secondary" ><i class="fas fa-times"></i></button>
|
||||
</div>
|
||||
<datalist id="possstandards">
|
||||
{% for s in possiblestandards %}
|
||||
<option id="standard_{{s.pk}}" value="{{s.name|truncatechars:30}}">{{s.name|truncatechars:30}}</option>
|
||||
{% for s in possiblestandards %}
|
||||
{% if s.pk != standard.pk %}
|
||||
<option id="standard_{{s.pk}}" value="{{s.name|truncatechars:30}}">{{s.name|truncatechars:30}}</option>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</datalist>
|
||||
</div>
|
||||
|
|
@ -278,13 +280,14 @@ $('#uploadedfile').on('change', function() {
|
|||
function uploadAction(filetodo){
|
||||
var formData = new FormData();
|
||||
formData.append("uploadedfile", filetodo);
|
||||
formData.append("uploadsource", "standards");
|
||||
if(allowedtypes.includes(filetodo.type) && filetodo.type.length > 0){
|
||||
$.ajax({
|
||||
url: "{% url 'cloud-adddir' parentid %}",
|
||||
headers: {
|
||||
"X-CSRFTOKEN": "{{ csrf_token }}"
|
||||
},
|
||||
data: formData,
|
||||
data: formData,
|
||||
type: 'POST',
|
||||
cache: false,
|
||||
processData: false,
|
||||
|
|
|
|||
|
|
@ -25,10 +25,24 @@ class StandardsManagement(LoginRequiredMixin, ListView):
|
|||
# # Get all Users of the Same Agency as logged user
|
||||
areas = Areas.objects.filter(agency__pk=self.request.user.profile.agency.pk).order_by("areaorder")
|
||||
standards_of_user = Standards.objects.filter(agency__pk=self.request.user.profile.agency.pk, created_standard_by=self.request.user.pk)
|
||||
standards_of_agency = Standards.objects.filter(agency__pk=self.request.user.profile.agency.pk, public=True)
|
||||
#standards_of_agency = Standards.objects.filter(agency__pk=self.request.user.profile.agency.pk, public=True)
|
||||
unpubstandards_of_user = Standards.objects.filter(agency__pk=self.request.user.profile.agency.pk, public=False)
|
||||
tasks = Tasks.objects.filter(agency__pk=self.request.user.profile.agency.pk)
|
||||
context.update({'active_link' : 'standards', 'tasks': tasks, 'unpubstandards_of_user' : unpubstandards_of_user, 'standards_of_agency' : standards_of_agency, 'areas' : areas, 'standards_of_user' : standards_of_user})
|
||||
#tasks = Tasks.objects.filter(agency__pk=self.request.user.profile.agency.pk)
|
||||
|
||||
standardcontent = []
|
||||
|
||||
for a in areas:
|
||||
print(a)
|
||||
standardcontent.append({"area" : a, "tasks" : []})
|
||||
tasks_in_area = Tasks.objects.filter(agency__pk=self.request.user.profile.agency.pk, area__pk=a.pk).order_by("name")
|
||||
|
||||
for t in tasks_in_area:
|
||||
standardcontent[len(standardcontent)-1]['tasks'].append({"task" : t, "standards" : Standards.objects.filter(agency__pk=self.request.user.profile.agency.pk, area__pk=a.pk, task = t.pk, area = a.pk, public=True).order_by("created_standard_date")})
|
||||
|
||||
#context.update({'active_link' : 'standards', 'tasks': tasks, 'unpubstandards_of_user' : unpubstandards_of_user, 'standards_of_agency' : standards_of_agency, 'areas' : areas, 'standards_of_user' : standards_of_user, 'standardcontent' : standardcontent})
|
||||
|
||||
context.update({'active_link' : 'standards', 'unpubstandards_of_user' : unpubstandards_of_user, 'areas' : areas, 'standards_of_user' : standards_of_user, 'standardcontent' : standardcontent})
|
||||
|
||||
return context
|
||||
|
||||
|
||||
|
|
@ -99,16 +113,6 @@ def StandardAdd(request):
|
|||
|
||||
# GROUPS
|
||||
new_standard.save()
|
||||
|
||||
|
||||
'''
|
||||
|
||||
HIER WEITER MACHEN: Gruppen, Dateien und Files werden nicht gespeichert, Länge des übergebenen
|
||||
Arrays ist komisch, da Strings ankommen und es umgebaut werden muss. Wenn das Array aber LEER
|
||||
ist, gibt es '' zurück und das ist komisch...
|
||||
|
||||
|
||||
'''
|
||||
|
||||
# ADD GROUPS
|
||||
groups = normalForm.cleaned_data['checked_groups'].split(",")
|
||||
|
|
@ -144,11 +148,7 @@ def StandardAdd(request):
|
|||
normalForm = StandardAddStandard(instance=request.user)
|
||||
editorForm = StandardAddStandardEditor(instance=request.user)
|
||||
|
||||
'''
|
||||
Hier werden nur die Dateien dem aktuellen User zur Auswahl gestellt, auf die er auch Zugriff hat.
|
||||
Das geht NICHT rekursiv! Es wird nur das oberste Verzeichnis geprüft! SPÄTER!
|
||||
'''
|
||||
|
||||
|
||||
possibleFilesByVisible = []
|
||||
|
||||
allfiles = DataFile.objects.filter(agency=request.user.profile.agency)
|
||||
|
|
@ -160,7 +160,6 @@ def StandardAdd(request):
|
|||
else:
|
||||
if(checkUserDirRights(request, actParent, request.user.pk)):
|
||||
possibleFilesByVisible.append(f)
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -97,6 +97,19 @@ def toUpdate(request):
|
|||
print("AGENCY ROOT DIR CREATED")
|
||||
else:
|
||||
print("MAIN ROOT DIR FOUND - FILESMODULE READY")
|
||||
|
||||
# DEF STANDARD DIR
|
||||
defstandard = DataDir.objects.filter(is_defaultstandard=True, agency__pk=request.user.profile.agency.pk)
|
||||
|
||||
if(len(defstandard) == 0):
|
||||
print("NO DEF STANDARD FOUND - CREATE")
|
||||
rootdir = list(DataDir.objects.filter(is_root=True, agency__pk=request.user.profile.agency.pk))[0]
|
||||
defstandard = DataDir(is_defaultstandard=True, agency=request.user.profile.agency, name="Uploaddateien Standards", parent_id=rootdir.pk)
|
||||
defstandard.save()
|
||||
print("AGENCY DEF STANDARD DIR CREATED")
|
||||
else:
|
||||
print("AGENCY DEF STANDARD DIR - FILESMODULE READY")
|
||||
|
||||
'''
|
||||
|
||||
DASHBOARD-View
|
||||
|
|
|
|||
Loading…
Reference in New Issue