server/src/remie/views.py
author ymh <ymh.work@gmail.com>
Thu, 17 Sep 2015 13:46:19 +0200
changeset 147 51e129ee6086
parent 74 daa7aa274e3f
child 165 d7e38162478a
permissions -rw-r--r--
new cas client version + correct firstname and lastname handling + new version

from django.shortcuts import render_to_response
from django.template import RequestContext
from django.views.generic import View


class RemieIframeTesterView(View):
    """
        A view for testing purposes that allows user to select which iframe view to test
    """
    template_name = "remie/iframe_tester.html"
    
    def get(self, request):
        return render_to_response(self.template_name, context_instance=RequestContext(request))


class RemieSegmentsSingleView(View):
    """
        The view with the segment-scenario for single user
    """
    template_name = "remie/iframe_segments_single.html"
    
    def get(self, request):
        project_id = request.GET.get("project_id", "") # id of the project we're working on
        current_user = request.user
        render_data = {
            "project_id": project_id,
            "current_user": current_user.username,
        }
        return render_to_response(self.template_name, render_data, context_instance=RequestContext(request))
    

class RemieSegmentsGroupView(View):
    """
        The view with the segment-scenario for group
    """
    template_name = "remie/iframe_segments_group.html"
    
    def get(self, request):
        project_id = request.GET.get("project_id", "") # id of the project we're working on
        current_user = request.user
        render_data = {
            "project_id": project_id,
            "current_user": current_user.username,
        }
        return render_to_response(self.template_name, render_data, context_instance=RequestContext(request))


class RemieMarkersView(View):
    """
        The view with the markers-scenario 
    """
    template_name = "remie/iframe_markers.html"
    
    def get(self, request):
        project_id = request.GET.get("project_id", "") # id of the project we're working on
        current_user = request.user
        render_data = {
            "project_id": project_id,
            "current_user": current_user.username,
        }
        return render_to_response(self.template_name, render_data, context_instance=RequestContext(request))


class RemieTeacherView(View):
    """
        The view with the teacher-scenario 
    """
    template_name = "remie/iframe_teacher.html"
    
    def get(self, request):
        project_id = request.GET.get("project_id", "") # id of the project we're working on
        current_user = request.user
        render_data = {
            "project_id": project_id,
            "current_user": current_user.username,
        }
        return render_to_response(self.template_name, render_data, context_instance=RequestContext(request))