Exemplo n.º 1
0
def log(request):
    if not permissionsCheck(request,False,''):
        messages.add_message(request, messages.ERROR, 'Something went wrong man!')
        return HttpResponse('Denied', status=403)
    d = {}
    from mathematics.views import getSubmission
    from mathematics.models import Submission
    qs = Submission.objects.all()
    from django.template import RequestContext
    d['mathList'] = getSubmission(qs)
    from current_events.views import getSubmission
    from current_events.models import Submission
    qs = Submission.objects.all()
    from django.template import RequestContext
    d['currentList'] = getSubmission(qs)
    from science.views import getSubmission
    from science.models import Submission
    qs = Submission.objects.all()
    from django.template import RequestContext
    d['scienceList'] = getSubmission(qs)
    from pe.views import getSubmission
    from pe.models import Submission
    qs = Submission.objects.all()
    from django.template import RequestContext
    d['peList'] = getSubmission(qs)
    return render(request,"log.html",d)
Exemplo n.º 2
0
def Mathematics(request):
    if not permissionsCheck(request,False,''):
        messages.add_message(request, messages.ERROR, 'Something went wrong man!')
        return HttpResponse('Denied', status=403)
    d = {}
    from mathematics.forms import SubmissionForm
    from django.template import RequestContext
    d['homework'] = render_to_string('form.html', {'title':'', 'description': '', 'action':'/api/mathematics/Submission/create/','formFields':SubmissionForm().as_p()},context_instance=RequestContext(request))
    return render(request,"Mathematics.html",d)
Exemplo n.º 3
0
def PE(request):
    if not permissionsCheck(request,False,''):
        messages.add_message(request, messages.ERROR, 'Something went wrong man!')
        return HttpResponse('Denied', status=403)
    d = {}
    from pe.forms import ActivityForm
    from django.template import RequestContext
    d['addSubject'] = render_to_string('form.html', {'title':'Add a New Activity', 'description': 'Add a new activty, then refresh the page. <br> <center>ex. Unicycle Ride, Bike Ride, Beach, Swimming, etc.</center>', 'action':'/api/pe/Activity/create/','formFields':ActivityForm().as_p()},context_instance=RequestContext(request))
    from pe.forms import SubmissionForm
    from django.template import RequestContext
    d['homework'] = render_to_string('form.html', {'title':'Log Your Activities', 'description': 'What did you do to move your body today?', 'action':'/api/pe/Submission/create/','formFields':SubmissionForm().as_p()},context_instance=RequestContext(request))
    return render(request,"PE.html",d)
Exemplo n.º 4
0
def Science(request):
    if not permissionsCheck(request,False,''):
        messages.add_message(request, messages.ERROR, 'Something went wrong man!')
        return HttpResponse('Denied', status=403)
    d = {}
    from science.forms import SubjectForm
    from django.template import RequestContext
    d['addSubject'] = render_to_string('form.html', {'title':'Add a new field of study', 'description': 'Is the subject you want not in the list? Add it below, and refresh the page. <br> <center>ex. Anthropology, Paleontology, Xenolinguistics, etc.</center>', 'action':'/api/science/Subject/create/','formFields':SubjectForm().as_p()},context_instance=RequestContext(request))
    from science.forms import SubmissionForm
    from django.template import RequestContext
    d['homework'] = render_to_string('form.html', {'title':'What did you watch?', 'description': 'Whether it was from <em>The Shape of Life</em> or a documentary from Netflix, log your science knowledge here.', 'action':'/api/science/Submission/create/','formFields':SubmissionForm().as_p()},context_instance=RequestContext(request))
    return render(request,"Science.html",d)
Exemplo n.º 5
0
def Home(request):
    if not permissionsCheck(request,False,''):
        messages.add_message(request, messages.ERROR, 'Something went wrong man!')
        return HttpResponse('Denied', status=403)
    d = {}
    return render(request,"Home.html",d)