# 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'), # ---- JSON views ----# # uploading files url(r'^ajax-upload$', ajax_uploader, name='ajax_upload'), # return json list of schools url(r'^school/list/$', school_list, name='json_school_list'), # ---- end JSON views ----# url(r'^$', CourseListView.as_view(model=Course), name='home'), )
# 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"), url(r"^ajax/annotations/search/$", get_keywords_annotator, name="get_keywords"), # 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"^note/(?P<school_slug>[^/]+)/(?P<course_slug>[^/]+)/(?P<pk>[\d^/]+)$", NoteView.as_view(), name="note_detail_pk", ), # note file by note.slug url( r"^note/" + SLUG.format("school_") + "/" + SLUG.format("course_") + "/" + SLUG.format("") + "$", NoteView.as_view(), name="note_detail", ), url( r"^note/" + SLUG.format("school_") + "/" + SLUG.format("course_") + "/" + SLUG.format("") + "/keywords/$", NoteKeywordsView.as_view(), name="note_keywords", ), url( r"^note/" + SLUG.format("school_") + "/" + SLUG.format("course_") + "/" + SLUG.format("") + "/quiz/$",