server/src/remie/views.py
author durandn
Mon, 02 Nov 2015 17:35:19 +0100
changeset 178 236780ec02a4
parent 176 ba9f193121c3
child 193 ee213a823b70
permissions -rw-r--r--
Small fix to css
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
165
d7e38162478a Added 2 preview scenarii for remie + made remie iframes load jquery.js instead of jquery.min.js in an attemps to fix
durandn
parents: 74
diff changeset
    48
class RemieSegmentsPreviewView(View):
d7e38162478a Added 2 preview scenarii for remie + made remie iframes load jquery.js instead of jquery.min.js in an attemps to fix
durandn
parents: 74
diff changeset
    49
    """
d7e38162478a Added 2 preview scenarii for remie + made remie iframes load jquery.js instead of jquery.min.js in an attemps to fix
durandn
parents: 74
diff changeset
    50
        The view with the segment-scenario for previews
d7e38162478a Added 2 preview scenarii for remie + made remie iframes load jquery.js instead of jquery.min.js in an attemps to fix
durandn
parents: 74
diff changeset
    51
    """
d7e38162478a Added 2 preview scenarii for remie + made remie iframes load jquery.js instead of jquery.min.js in an attemps to fix
durandn
parents: 74
diff changeset
    52
    template_name = "remie/iframe_segments_preview.html"
d7e38162478a Added 2 preview scenarii for remie + made remie iframes load jquery.js instead of jquery.min.js in an attemps to fix
durandn
parents: 74
diff changeset
    53
    
d7e38162478a Added 2 preview scenarii for remie + made remie iframes load jquery.js instead of jquery.min.js in an attemps to fix
durandn
parents: 74
diff changeset
    54
    def get(self, request):
d7e38162478a Added 2 preview scenarii for remie + made remie iframes load jquery.js instead of jquery.min.js in an attemps to fix
durandn
parents: 74
diff changeset
    55
        project_id = request.GET.get("project_id", "") # id of the project we're working on
d7e38162478a Added 2 preview scenarii for remie + made remie iframes load jquery.js instead of jquery.min.js in an attemps to fix
durandn
parents: 74
diff changeset
    56
        current_user = request.user
d7e38162478a Added 2 preview scenarii for remie + made remie iframes load jquery.js instead of jquery.min.js in an attemps to fix
durandn
parents: 74
diff changeset
    57
        render_data = {
d7e38162478a Added 2 preview scenarii for remie + made remie iframes load jquery.js instead of jquery.min.js in an attemps to fix
durandn
parents: 74
diff changeset
    58
            "project_id": project_id,
d7e38162478a Added 2 preview scenarii for remie + made remie iframes load jquery.js instead of jquery.min.js in an attemps to fix
durandn
parents: 74
diff changeset
    59
            "current_user": current_user.username,
d7e38162478a Added 2 preview scenarii for remie + made remie iframes load jquery.js instead of jquery.min.js in an attemps to fix
durandn
parents: 74
diff changeset
    60
        }
d7e38162478a Added 2 preview scenarii for remie + made remie iframes load jquery.js instead of jquery.min.js in an attemps to fix
durandn
parents: 74
diff changeset
    61
        return render_to_response(self.template_name, render_data, context_instance=RequestContext(request))
d7e38162478a Added 2 preview scenarii for remie + made remie iframes load jquery.js instead of jquery.min.js in an attemps to fix
durandn
parents: 74
diff changeset
    62
    
d7e38162478a Added 2 preview scenarii for remie + made remie iframes load jquery.js instead of jquery.min.js in an attemps to fix
durandn
parents: 74
diff changeset
    63
74
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 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
    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 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
    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_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
    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
10
7e83c61b1f87 Setting up testing environnement for remie iframe views
durandn
parents: 3
diff changeset
    73
        render_data = {
7e83c61b1f87 Setting up testing environnement for remie iframe views
durandn
parents: 3
diff changeset
    74
            "project_id": project_id,
40
b8a024a10c4c Removed current_user from parameters for the iframe
durandn
parents: 37
diff changeset
    75
            "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
    76
        }
daa7aa274e3f Added options to hide headers in AnnotationsList and LatestAnnotation widgets + streamlined remie urls and templates for consistency
durandn
parents: 40
diff changeset
    77
        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
    78
daa7aa274e3f Added options to hide headers in AnnotationsList and LatestAnnotation widgets + streamlined remie urls and templates for consistency
durandn
parents: 40
diff changeset
    79
176
ba9f193121c3 Adjustements on Markers scenario (now displays a "teacher" markers row) + Added a new "markers_teacher" scenario to edit the teacher markers and browse user markers
durandn
parents: 165
diff changeset
    80
class RemieMarkersTeacherView(View):
ba9f193121c3 Adjustements on Markers scenario (now displays a "teacher" markers row) + Added a new "markers_teacher" scenario to edit the teacher markers and browse user markers
durandn
parents: 165
diff changeset
    81
    """
ba9f193121c3 Adjustements on Markers scenario (now displays a "teacher" markers row) + Added a new "markers_teacher" scenario to edit the teacher markers and browse user markers
durandn
parents: 165
diff changeset
    82
        The view with the markers-scenario 
ba9f193121c3 Adjustements on Markers scenario (now displays a "teacher" markers row) + Added a new "markers_teacher" scenario to edit the teacher markers and browse user markers
durandn
parents: 165
diff changeset
    83
    """
ba9f193121c3 Adjustements on Markers scenario (now displays a "teacher" markers row) + Added a new "markers_teacher" scenario to edit the teacher markers and browse user markers
durandn
parents: 165
diff changeset
    84
    template_name = "remie/iframe_markers_teacher.html"
ba9f193121c3 Adjustements on Markers scenario (now displays a "teacher" markers row) + Added a new "markers_teacher" scenario to edit the teacher markers and browse user markers
durandn
parents: 165
diff changeset
    85
    
ba9f193121c3 Adjustements on Markers scenario (now displays a "teacher" markers row) + Added a new "markers_teacher" scenario to edit the teacher markers and browse user markers
durandn
parents: 165
diff changeset
    86
    def get(self, request):
ba9f193121c3 Adjustements on Markers scenario (now displays a "teacher" markers row) + Added a new "markers_teacher" scenario to edit the teacher markers and browse user markers
durandn
parents: 165
diff changeset
    87
        project_id = request.GET.get("project_id", "") # id of the project we're working on
ba9f193121c3 Adjustements on Markers scenario (now displays a "teacher" markers row) + Added a new "markers_teacher" scenario to edit the teacher markers and browse user markers
durandn
parents: 165
diff changeset
    88
        current_user = request.user
ba9f193121c3 Adjustements on Markers scenario (now displays a "teacher" markers row) + Added a new "markers_teacher" scenario to edit the teacher markers and browse user markers
durandn
parents: 165
diff changeset
    89
        render_data = {
ba9f193121c3 Adjustements on Markers scenario (now displays a "teacher" markers row) + Added a new "markers_teacher" scenario to edit the teacher markers and browse user markers
durandn
parents: 165
diff changeset
    90
            "project_id": project_id,
ba9f193121c3 Adjustements on Markers scenario (now displays a "teacher" markers row) + Added a new "markers_teacher" scenario to edit the teacher markers and browse user markers
durandn
parents: 165
diff changeset
    91
            "current_user": current_user.username,
ba9f193121c3 Adjustements on Markers scenario (now displays a "teacher" markers row) + Added a new "markers_teacher" scenario to edit the teacher markers and browse user markers
durandn
parents: 165
diff changeset
    92
        }
ba9f193121c3 Adjustements on Markers scenario (now displays a "teacher" markers row) + Added a new "markers_teacher" scenario to edit the teacher markers and browse user markers
durandn
parents: 165
diff changeset
    93
        return render_to_response(self.template_name, render_data, context_instance=RequestContext(request))
ba9f193121c3 Adjustements on Markers scenario (now displays a "teacher" markers row) + Added a new "markers_teacher" scenario to edit the teacher markers and browse user markers
durandn
parents: 165
diff changeset
    94
ba9f193121c3 Adjustements on Markers scenario (now displays a "teacher" markers row) + Added a new "markers_teacher" scenario to edit the teacher markers and browse user markers
durandn
parents: 165
diff changeset
    95
ba9f193121c3 Adjustements on Markers scenario (now displays a "teacher" markers row) + Added a new "markers_teacher" scenario to edit the teacher markers and browse user markers
durandn
parents: 165
diff changeset
    96
165
d7e38162478a Added 2 preview scenarii for remie + made remie iframes load jquery.js instead of jquery.min.js in an attemps to fix
durandn
parents: 74
diff changeset
    97
class RemieMarkersPreviewView(View):
d7e38162478a Added 2 preview scenarii for remie + made remie iframes load jquery.js instead of jquery.min.js in an attemps to fix
durandn
parents: 74
diff changeset
    98
    """
d7e38162478a Added 2 preview scenarii for remie + made remie iframes load jquery.js instead of jquery.min.js in an attemps to fix
durandn
parents: 74
diff changeset
    99
        The view with the markers-scenario 
d7e38162478a Added 2 preview scenarii for remie + made remie iframes load jquery.js instead of jquery.min.js in an attemps to fix
durandn
parents: 74
diff changeset
   100
    """
d7e38162478a Added 2 preview scenarii for remie + made remie iframes load jquery.js instead of jquery.min.js in an attemps to fix
durandn
parents: 74
diff changeset
   101
    template_name = "remie/iframe_markers_preview.html"
d7e38162478a Added 2 preview scenarii for remie + made remie iframes load jquery.js instead of jquery.min.js in an attemps to fix
durandn
parents: 74
diff changeset
   102
    
d7e38162478a Added 2 preview scenarii for remie + made remie iframes load jquery.js instead of jquery.min.js in an attemps to fix
durandn
parents: 74
diff changeset
   103
    def get(self, request):
d7e38162478a Added 2 preview scenarii for remie + made remie iframes load jquery.js instead of jquery.min.js in an attemps to fix
durandn
parents: 74
diff changeset
   104
        project_id = request.GET.get("project_id", "") # id of the project we're working on
d7e38162478a Added 2 preview scenarii for remie + made remie iframes load jquery.js instead of jquery.min.js in an attemps to fix
durandn
parents: 74
diff changeset
   105
        current_user = request.user
d7e38162478a Added 2 preview scenarii for remie + made remie iframes load jquery.js instead of jquery.min.js in an attemps to fix
durandn
parents: 74
diff changeset
   106
        render_data = {
d7e38162478a Added 2 preview scenarii for remie + made remie iframes load jquery.js instead of jquery.min.js in an attemps to fix
durandn
parents: 74
diff changeset
   107
            "project_id": project_id,
d7e38162478a Added 2 preview scenarii for remie + made remie iframes load jquery.js instead of jquery.min.js in an attemps to fix
durandn
parents: 74
diff changeset
   108
            "current_user": current_user.username,
d7e38162478a Added 2 preview scenarii for remie + made remie iframes load jquery.js instead of jquery.min.js in an attemps to fix
durandn
parents: 74
diff changeset
   109
        }
d7e38162478a Added 2 preview scenarii for remie + made remie iframes load jquery.js instead of jquery.min.js in an attemps to fix
durandn
parents: 74
diff changeset
   110
        return render_to_response(self.template_name, render_data, context_instance=RequestContext(request))
d7e38162478a Added 2 preview scenarii for remie + made remie iframes load jquery.js instead of jquery.min.js in an attemps to fix
durandn
parents: 74
diff changeset
   111
d7e38162478a Added 2 preview scenarii for remie + made remie iframes load jquery.js instead of jquery.min.js in an attemps to fix
durandn
parents: 74
diff changeset
   112
74
daa7aa274e3f Added options to hide headers in AnnotationsList and LatestAnnotation widgets + streamlined remie urls and templates for consistency
durandn
parents: 40
diff changeset
   113
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
   114
    """
daa7aa274e3f Added options to hide headers in AnnotationsList and LatestAnnotation widgets + streamlined remie urls and templates for consistency
durandn
parents: 40
diff changeset
   115
        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
   116
    """
daa7aa274e3f Added options to hide headers in AnnotationsList and LatestAnnotation widgets + streamlined remie urls and templates for consistency
durandn
parents: 40
diff changeset
   117
    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
   118
    
daa7aa274e3f Added options to hide headers in AnnotationsList and LatestAnnotation widgets + streamlined remie urls and templates for consistency
durandn
parents: 40
diff changeset
   119
    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
   120
        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
   121
        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
   122
        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
   123
            "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
   124
            "current_user": current_user.username,
10
7e83c61b1f87 Setting up testing environnement for remie iframe views
durandn
parents: 3
diff changeset
   125
        }
7e83c61b1f87 Setting up testing environnement for remie iframe views
durandn
parents: 3
diff changeset
   126
        return render_to_response(self.template_name, render_data, context_instance=RequestContext(request))