server/src/remie/views.py
author ymh <ymh.work@gmail.com>
Fri, 28 Aug 2015 18:08:21 +0200
changeset 86 a6ad1c4f7e70
parent 74 daa7aa274e3f
child 165 d7e38162478a
permissions -rw-r--r--
Added tag 00.00.12 for changeset 975c6a1fa0b8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10
7e83c61b1f87 Setting up testing environnement for remie iframe views
durandn
parents: 3
diff changeset
     1
from django.shortcuts import render_to_response
7e83c61b1f87 Setting up testing environnement for remie iframe views
durandn
parents: 3
diff changeset
     2
from django.template import RequestContext
7e83c61b1f87 Setting up testing environnement for remie iframe views
durandn
parents: 3
diff changeset
     3
from django.views.generic import View
7e83c61b1f87 Setting up testing environnement for remie iframe views
durandn
parents: 3
diff changeset
     4
7e83c61b1f87 Setting up testing environnement for remie iframe views
durandn
parents: 3
diff changeset
     5
7e83c61b1f87 Setting up testing environnement for remie iframe views
durandn
parents: 3
diff changeset
     6
class RemieIframeTesterView(View):
7e83c61b1f87 Setting up testing environnement for remie iframe views
durandn
parents: 3
diff changeset
     7
    """
7e83c61b1f87 Setting up testing environnement for remie iframe views
durandn
parents: 3
diff changeset
     8
        A view for testing purposes that allows user to select which iframe view to test
7e83c61b1f87 Setting up testing environnement for remie iframe views
durandn
parents: 3
diff changeset
     9
    """
7e83c61b1f87 Setting up testing environnement for remie iframe views
durandn
parents: 3
diff changeset
    10
    template_name = "remie/iframe_tester.html"
7e83c61b1f87 Setting up testing environnement for remie iframe views
durandn
parents: 3
diff changeset
    11
    
7e83c61b1f87 Setting up testing environnement for remie iframe views
durandn
parents: 3
diff changeset
    12
    def get(self, request):
7e83c61b1f87 Setting up testing environnement for remie iframe views
durandn
parents: 3
diff changeset
    13
        return render_to_response(self.template_name, context_instance=RequestContext(request))
3
fc0f3e398166 Creation of Django server project
ymh <ymh.work@gmail.com>
parents:
diff changeset
    14
74
daa7aa274e3f Added options to hide headers in AnnotationsList and LatestAnnotation widgets + streamlined remie urls and templates for consistency
durandn
parents: 40
diff changeset
    15
daa7aa274e3f Added options to hide headers in AnnotationsList and LatestAnnotation widgets + streamlined remie urls and templates for consistency
durandn
parents: 40
diff changeset
    16
class RemieSegmentsSingleView(View):
daa7aa274e3f Added options to hide headers in AnnotationsList and LatestAnnotation widgets + streamlined remie urls and templates for consistency
durandn
parents: 40
diff changeset
    17
    """
daa7aa274e3f Added options to hide headers in AnnotationsList and LatestAnnotation widgets + streamlined remie urls and templates for consistency
durandn
parents: 40
diff changeset
    18
        The view with the segment-scenario for single user
10
7e83c61b1f87 Setting up testing environnement for remie iframe views
durandn
parents: 3
diff changeset
    19
    """
74
daa7aa274e3f Added options to hide headers in AnnotationsList and LatestAnnotation widgets + streamlined remie urls and templates for consistency
durandn
parents: 40
diff changeset
    20
    template_name = "remie/iframe_segments_single.html"
daa7aa274e3f Added options to hide headers in AnnotationsList and LatestAnnotation widgets + streamlined remie urls and templates for consistency
durandn
parents: 40
diff changeset
    21
    
daa7aa274e3f Added options to hide headers in AnnotationsList and LatestAnnotation widgets + streamlined remie urls and templates for consistency
durandn
parents: 40
diff changeset
    22
    def get(self, request):
daa7aa274e3f Added options to hide headers in AnnotationsList and LatestAnnotation widgets + streamlined remie urls and templates for consistency
durandn
parents: 40
diff changeset
    23
        project_id = request.GET.get("project_id", "") # id of the project we're working on
daa7aa274e3f Added options to hide headers in AnnotationsList and LatestAnnotation widgets + streamlined remie urls and templates for consistency
durandn
parents: 40
diff changeset
    24
        current_user = request.user
daa7aa274e3f Added options to hide headers in AnnotationsList and LatestAnnotation widgets + streamlined remie urls and templates for consistency
durandn
parents: 40
diff changeset
    25
        render_data = {
daa7aa274e3f Added options to hide headers in AnnotationsList and LatestAnnotation widgets + streamlined remie urls and templates for consistency
durandn
parents: 40
diff changeset
    26
            "project_id": project_id,
daa7aa274e3f Added options to hide headers in AnnotationsList and LatestAnnotation widgets + streamlined remie urls and templates for consistency
durandn
parents: 40
diff changeset
    27
            "current_user": current_user.username,
daa7aa274e3f Added options to hide headers in AnnotationsList and LatestAnnotation widgets + streamlined remie urls and templates for consistency
durandn
parents: 40
diff changeset
    28
        }
daa7aa274e3f Added options to hide headers in AnnotationsList and LatestAnnotation widgets + streamlined remie urls and templates for consistency
durandn
parents: 40
diff changeset
    29
        return render_to_response(self.template_name, render_data, context_instance=RequestContext(request))
daa7aa274e3f Added options to hide headers in AnnotationsList and LatestAnnotation widgets + streamlined remie urls and templates for consistency
durandn
parents: 40
diff changeset
    30
    
daa7aa274e3f Added options to hide headers in AnnotationsList and LatestAnnotation widgets + streamlined remie urls and templates for consistency
durandn
parents: 40
diff changeset
    31
daa7aa274e3f Added options to hide headers in AnnotationsList and LatestAnnotation widgets + streamlined remie urls and templates for consistency
durandn
parents: 40
diff changeset
    32
class RemieSegmentsGroupView(View):
10
7e83c61b1f87 Setting up testing environnement for remie iframe views
durandn
parents: 3
diff changeset
    33
    """
74
daa7aa274e3f Added options to hide headers in AnnotationsList and LatestAnnotation widgets + streamlined remie urls and templates for consistency
durandn
parents: 40
diff changeset
    34
        The view with the segment-scenario for group
daa7aa274e3f Added options to hide headers in AnnotationsList and LatestAnnotation widgets + streamlined remie urls and templates for consistency
durandn
parents: 40
diff changeset
    35
    """
daa7aa274e3f Added options to hide headers in AnnotationsList and LatestAnnotation widgets + streamlined remie urls and templates for consistency
durandn
parents: 40
diff changeset
    36
    template_name = "remie/iframe_segments_group.html"
10
7e83c61b1f87 Setting up testing environnement for remie iframe views
durandn
parents: 3
diff changeset
    37
    
7e83c61b1f87 Setting up testing environnement for remie iframe views
durandn
parents: 3
diff changeset
    38
    def get(self, request):
7e83c61b1f87 Setting up testing environnement for remie iframe views
durandn
parents: 3
diff changeset
    39
        project_id = request.GET.get("project_id", "") # id of the project we're working on
40
b8a024a10c4c Removed current_user from parameters for the iframe
durandn
parents: 37
diff changeset
    40
        current_user = request.user
74
daa7aa274e3f Added options to hide headers in AnnotationsList and LatestAnnotation widgets + streamlined remie urls and templates for consistency
durandn
parents: 40
diff changeset
    41
        render_data = {
daa7aa274e3f Added options to hide headers in AnnotationsList and LatestAnnotation widgets + streamlined remie urls and templates for consistency
durandn
parents: 40
diff changeset
    42
            "project_id": project_id,
daa7aa274e3f Added options to hide headers in AnnotationsList and LatestAnnotation widgets + streamlined remie urls and templates for consistency
durandn
parents: 40
diff changeset
    43
            "current_user": current_user.username,
daa7aa274e3f Added options to hide headers in AnnotationsList and LatestAnnotation widgets + streamlined remie urls and templates for consistency
durandn
parents: 40
diff changeset
    44
        }
daa7aa274e3f Added options to hide headers in AnnotationsList and LatestAnnotation widgets + streamlined remie urls and templates for consistency
durandn
parents: 40
diff changeset
    45
        return render_to_response(self.template_name, render_data, context_instance=RequestContext(request))
daa7aa274e3f Added options to hide headers in AnnotationsList and LatestAnnotation widgets + streamlined remie urls and templates for consistency
durandn
parents: 40
diff changeset
    46
daa7aa274e3f Added options to hide headers in AnnotationsList and LatestAnnotation widgets + streamlined remie urls and templates for consistency
durandn
parents: 40
diff changeset
    47
daa7aa274e3f Added options to hide headers in AnnotationsList and LatestAnnotation widgets + streamlined remie urls and templates for consistency
durandn
parents: 40
diff changeset
    48
class RemieMarkersView(View):
daa7aa274e3f Added options to hide headers in AnnotationsList and LatestAnnotation widgets + streamlined remie urls and templates for consistency
durandn
parents: 40
diff changeset
    49
    """
daa7aa274e3f Added options to hide headers in AnnotationsList and LatestAnnotation widgets + streamlined remie urls and templates for consistency
durandn
parents: 40
diff changeset
    50
        The view with the markers-scenario 
daa7aa274e3f Added options to hide headers in AnnotationsList and LatestAnnotation widgets + streamlined remie urls and templates for consistency
durandn
parents: 40
diff changeset
    51
    """
daa7aa274e3f Added options to hide headers in AnnotationsList and LatestAnnotation widgets + streamlined remie urls and templates for consistency
durandn
parents: 40
diff changeset
    52
    template_name = "remie/iframe_markers.html"
daa7aa274e3f Added options to hide headers in AnnotationsList and LatestAnnotation widgets + streamlined remie urls and templates for consistency
durandn
parents: 40
diff changeset
    53
    
daa7aa274e3f Added options to hide headers in AnnotationsList and LatestAnnotation widgets + streamlined remie urls and templates for consistency
durandn
parents: 40
diff changeset
    54
    def get(self, request):
daa7aa274e3f Added options to hide headers in AnnotationsList and LatestAnnotation widgets + streamlined remie urls and templates for consistency
durandn
parents: 40
diff changeset
    55
        project_id = request.GET.get("project_id", "") # id of the project we're working on
daa7aa274e3f Added options to hide headers in AnnotationsList and LatestAnnotation widgets + streamlined remie urls and templates for consistency
durandn
parents: 40
diff changeset
    56
        current_user = request.user
10
7e83c61b1f87 Setting up testing environnement for remie iframe views
durandn
parents: 3
diff changeset
    57
        render_data = {
7e83c61b1f87 Setting up testing environnement for remie iframe views
durandn
parents: 3
diff changeset
    58
            "project_id": project_id,
40
b8a024a10c4c Removed current_user from parameters for the iframe
durandn
parents: 37
diff changeset
    59
            "current_user": current_user.username,
74
daa7aa274e3f Added options to hide headers in AnnotationsList and LatestAnnotation widgets + streamlined remie urls and templates for consistency
durandn
parents: 40
diff changeset
    60
        }
daa7aa274e3f Added options to hide headers in AnnotationsList and LatestAnnotation widgets + streamlined remie urls and templates for consistency
durandn
parents: 40
diff changeset
    61
        return render_to_response(self.template_name, render_data, context_instance=RequestContext(request))
daa7aa274e3f Added options to hide headers in AnnotationsList and LatestAnnotation widgets + streamlined remie urls and templates for consistency
durandn
parents: 40
diff changeset
    62
daa7aa274e3f Added options to hide headers in AnnotationsList and LatestAnnotation widgets + streamlined remie urls and templates for consistency
durandn
parents: 40
diff changeset
    63
daa7aa274e3f Added options to hide headers in AnnotationsList and LatestAnnotation widgets + streamlined remie urls and templates for consistency
durandn
parents: 40
diff changeset
    64
class RemieTeacherView(View):
daa7aa274e3f Added options to hide headers in AnnotationsList and LatestAnnotation widgets + streamlined remie urls and templates for consistency
durandn
parents: 40
diff changeset
    65
    """
daa7aa274e3f Added options to hide headers in AnnotationsList and LatestAnnotation widgets + streamlined remie urls and templates for consistency
durandn
parents: 40
diff changeset
    66
        The view with the teacher-scenario 
daa7aa274e3f Added options to hide headers in AnnotationsList and LatestAnnotation widgets + streamlined remie urls and templates for consistency
durandn
parents: 40
diff changeset
    67
    """
daa7aa274e3f Added options to hide headers in AnnotationsList and LatestAnnotation widgets + streamlined remie urls and templates for consistency
durandn
parents: 40
diff changeset
    68
    template_name = "remie/iframe_teacher.html"
daa7aa274e3f Added options to hide headers in AnnotationsList and LatestAnnotation widgets + streamlined remie urls and templates for consistency
durandn
parents: 40
diff changeset
    69
    
daa7aa274e3f Added options to hide headers in AnnotationsList and LatestAnnotation widgets + streamlined remie urls and templates for consistency
durandn
parents: 40
diff changeset
    70
    def get(self, request):
daa7aa274e3f Added options to hide headers in AnnotationsList and LatestAnnotation widgets + streamlined remie urls and templates for consistency
durandn
parents: 40
diff changeset
    71
        project_id = request.GET.get("project_id", "") # id of the project we're working on
daa7aa274e3f Added options to hide headers in AnnotationsList and LatestAnnotation widgets + streamlined remie urls and templates for consistency
durandn
parents: 40
diff changeset
    72
        current_user = request.user
daa7aa274e3f Added options to hide headers in AnnotationsList and LatestAnnotation widgets + streamlined remie urls and templates for consistency
durandn
parents: 40
diff changeset
    73
        render_data = {
daa7aa274e3f Added options to hide headers in AnnotationsList and LatestAnnotation widgets + streamlined remie urls and templates for consistency
durandn
parents: 40
diff changeset
    74
            "project_id": project_id,
daa7aa274e3f Added options to hide headers in AnnotationsList and LatestAnnotation widgets + streamlined remie urls and templates for consistency
durandn
parents: 40
diff changeset
    75
            "current_user": current_user.username,
10
7e83c61b1f87 Setting up testing environnement for remie iframe views
durandn
parents: 3
diff changeset
    76
        }
7e83c61b1f87 Setting up testing environnement for remie iframe views
durandn
parents: 3
diff changeset
    77
        return render_to_response(self.template_name, render_data, context_instance=RequestContext(request))