|
|
@@ -2,9 +2,15 @@ from django.shortcuts import render_to_response
|
|
|
from grader.models import Lab
|
|
|
|
|
|
def index(request):
|
|
|
- return render_to_response('index.html', {'labs' : Lab.objects.all()})
|
|
|
+ return render_to_response('index.html', {
|
|
|
+ 'labs' : Lab.objects.all(),
|
|
|
+ 'authenticated' : request.user.is_authenticated(),
|
|
|
+ })
|
|
|
|
|
|
def lab(request, lab_id):
|
|
|
lab = Lab.objects.get(pk=lab_id)
|
|
|
submissions = lab.submission_set.filter(user__is_staff=False).order_by('-grade', '-time')
|
|
|
- return render_to_response('lab.html', {'lab' : lab, 'submissions' : submissions})
|
|
|
+ return render_to_response('lab.html', {
|
|
|
+ 'lab' : lab,
|
|
|
+ 'submissions' : submissions,
|
|
|
+ })
|