0.8.2. Zwischencommit Steckbrief Prios fertig Korrektur und aufraeumen
This commit is contained in:
parent
9f41152153
commit
69d12f8658
Binary file not shown.
|
|
@ -9,6 +9,7 @@ from django.http import HttpResponse, JsonResponse
|
|||
import json
|
||||
from django.contrib.auth.decorators import login_required
|
||||
from users.priomodel import Prio
|
||||
from tasks.models import Tasks
|
||||
|
||||
@login_required
|
||||
def area_addareas_ajax(request):
|
||||
|
|
@ -75,24 +76,10 @@ def area_neworder(request):
|
|||
neworderdata = json.loads(request.GET['finalod'])
|
||||
for ele in neworderdata:
|
||||
prio = list(Prio.objects.filter(user__pk=request.GET['userid'], task__pk=ele['id']))[0]
|
||||
task = Tasks.objects.get(pk=ele['id'])
|
||||
if(task.agency == request.user.profile.agency):
|
||||
prio.prio = ele['neworder']
|
||||
prio.save()
|
||||
|
||||
return HttpResponse("UPDATED")
|
||||
else:
|
||||
return HttpResponse("Request method is not a GET")
|
||||
|
||||
|
||||
'''
|
||||
@login_required
|
||||
def UsersPrioUpdate(request):
|
||||
tempuser = User.objects.get(pk=request.GET['userid'])
|
||||
if request.method == 'GET' and tempuser.profile.agency.pk == request.user.profile.agency.pk:
|
||||
prio = Prio.objects.filter(user__pk=request.GET['userid']).filter(task__pk=request.GET['taskid'])
|
||||
prio = list(prio)[0]
|
||||
prio.prio = request.GET['value']
|
||||
prio.save()
|
||||
return HttpResponse("udated...")
|
||||
else:
|
||||
return HttpResponse("Request method is not a GET")
|
||||
'''
|
||||
|
|
@ -80,20 +80,13 @@
|
|||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
var sortstatus = false;
|
||||
|
||||
var sortablearea_ids = [{% for area in areas %} {{area.pk}},{% endfor %}];
|
||||
|
||||
|
||||
{% if user|usergperm:"usermanager" %}
|
||||
|
||||
var sortstatus = false;
|
||||
var sortablearea_ids = [{% for area in areas %} {{area.pk}},{% endfor %}];
|
||||
{% if user|usergperm:"usermanager" %}
|
||||
|
||||
{% for area in areas %}
|
||||
|
||||
|
||||
//Initial function for draggable areas
|
||||
$( function() {
|
||||
//Initial function for draggable areas
|
||||
$( function() {
|
||||
$( "#sortarea_{{area.pk}}" ).sortable
|
||||
({
|
||||
axis:"y",
|
||||
|
|
@ -119,7 +112,7 @@ $( function() {
|
|||
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
{% endfor %}
|
||||
function activateChangeTaskOrder(){
|
||||
|
|
@ -141,7 +134,7 @@ $( function() {
|
|||
|
||||
}
|
||||
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
|
||||
</script>
|
||||
|
|
|
|||
Loading…
Reference in New Issue