예제 #1
0
    ## Single-serving page URLpatterns
    url(r'^terms/$', direct_to_template, { 'template': 'terms.html' }, name='terms'),
    url(r'^about/$', AboutView.as_view(), name='about'),

    # VIEW for viewing a Note's gdrive generated html, used as iframe
    url(r'^raw/(?P<pk>\d+)$', RawNoteDetailView.as_view(), name='note_raw'),
    #url(r'^pdfview$', PDFView.as_view(), name='pdf'),
    url(r'^pdfview/(?P<pk>\d+)$', PDFView.as_view(), name='pdf'),

    # Media handling
    url(r'^media/(?P<path>.*)$', 'django.views.static.serve',
            {'document_root': settings.MEDIA_ROOT, }),

    # VIEW for displaying a single Course
    url(r'^' + SLUG.format('school_') + '/' + SLUG.format('') + '$',
        CourseDetailView.as_view(), name='course_detail'),

    ## NOTE MODEL
    # Valid url cases to the Note page
    # a: school/course/id
    # b: school/course/id/slug
    # c: s../c../slug
    # note file as id, for notes without titles yet
    url(r'^(?P<school_slug>[^/]+)/(?P<course_slug>[^/]+)/(?P<pk>[\d^/]+)$', \
        NoteView.as_view(), name='note_detail_pk'),
    # note file by note.slug
    url(r'^' + SLUG.format('school_') + '/' + SLUG.format('course_') +'/'+ SLUG.format('') +'$',
        NoteView.as_view(), name='note_detail'),
    #url(r'^(?P<school_slug>[^/]+)/(?P<course_slug>[^/]+)/(?P<slug>[^/]+)$', \
    #    NoteView.as_view(), name='note_detail'),
예제 #2
0
    ## Single-serving page URLpatterns
    url(r'^terms/$', direct_to_template, { 'template': 'terms.html' }, name='terms'),
    url(r'^about/$', AboutView.as_view(), name='about'),

    # VIEW for viewing a Note's gdrive generated html, used as iframe
    url(r'^raw/(?P<pk>\d+)$', RawNoteDetailView.as_view(), name='note_raw'),
    #url(r'^pdfview$', PDFView.as_view(), name='pdf'),
    url(r'^pdfview/(?P<pk>\d+)$', PDFView.as_view(), name='pdf'),

    # Media handling
    url(r'^media/(?P<path>.*)$', 'django.views.static.serve', 
            {'document_root': settings.MEDIA_ROOT, }),

    # VIEW for displaying a single Course
    url(r'^' + SLUG.format('school_') + '/' + SLUG.format('') + '$',
        CourseDetailView.as_view(), name='course_detail'),

    ## NOTE MODEL
    # Valid url cases to the Note page
    # a: school/course/id
    # b: school/course/id/slug
    # c: s../c../slug
    # note file as id, for notes without titles yet
    url(r'^(?P<school_slug>[^/]+)/(?P<course_slug>[^/]+)/(?P<pk>[\d^/]+)$', \
        NoteView.as_view(), name='note_detail_pk'),
    # note file by note.slug
    url(r'^' + SLUG.format('school_') + '/' + SLUG.format('course_') +'/'+ SLUG.format('') +'$',
        NoteView.as_view(), name='note_detail'),
    #url(r'^(?P<school_slug>[^/]+)/(?P<course_slug>[^/]+)/(?P<slug>[^/]+)$', \
    #    NoteView.as_view(), name='note_detail'),
예제 #3
0
 url(r"^accounts/", include("allauth.urls")),
 url(r"^accounts/profile/", ProfileView.as_view(), name="accounts_profile"),
 # Media handling
 url(r"^media/(?P<path>.*)$", "django.views.static.serve", {"document_root": settings.MEDIA_ROOT}),
 # Filepicker upload
 url(r"^api/upload$", save_fp_upload, name="upload_post"),
 # ---- JSON views ----#
 # return json list of courses for a given school
 url(r"^school/course/list/$", school_course_list, name="json_school_course_list"),
 # return json list of instructors for a given school and course
 url(r"^school/course/instructors/list/$", school_course_instructor_list, name="json_school_course_instructor_list"),
 # ---- end JSON views ----#
 url(r"^search/$", NoteSearchView.as_view(), name="note_search"),
 ## Course Model
 # VIEW for displaying a single Course
 url(r"^course/" + SLUG.format("") + "/$", CourseDetailView.as_view(), name="course_detail"),
 ## Note Model
 url(r"^ajax/courses/$", course_list_ajax, name="course_list_ajax"),
 # Ajax endpoint to thank a note
 url(r"^ajax/note/thank/(?P<pk>[\d]+)/$", thank_note, name="thank_note"),
 # Ajax endpoint to flag a note
 url(r"^ajax/note/flag/(?P<pk>[\d]+)/$", flag_note, name="flag_note"),
 # Ajax endpoint to update a notes tags
 url(r"^ajax/note/tags/(?P<pk>[\d]+)/$", edit_note_tags, name="edit_note_tags"),
 # Ajax endpoint to record that somebody downloaded a note
 url(r"^ajax/note/downloaded/(?P<pk>[\d]+)/$", downloaded_note, name="downloaded_note"),
 # Ajax endpoint to flag a course
 url(r"^ajax/course/flag/(?P<pk>[\d]+)/$", flag_course, name="flag_course"),
 # Ajax endpoint to edit a course
 url(r"^ajax/course/edit/(?P<pk>[\d]+)/$", edit_course, name="edit_course"),
 url(r"^ajax/annotations/annotations$", set_delete_keyword_annotator, name="set_keyword"),