<gh_stars>0
from django.conf.urls import patterns, include, url
from principal.forms import ValidatingPasswordChangeForm
from django.contrib.auth import views as auth_views

# Custom error views
handler404 = 'principal.views.StaticViews.error_404'
handler500 = 'principal.views.StaticViews.error_500'

urlpatterns = patterns(
    '',
    # Translation URLS
    url(r'^i18n/', include('django.conf.urls.i18n')),
    # Application views
    url(r'^$', 'principal.views.StaticViews.home'),
    url(r'^cookies_policy$', 'principal.views.StaticViews.cookies_policy'),
    url(r'^login/$', auth_views.login, {'template_name': 'login.html'}),
    url(r'^password_change/$', auth_views.password_change, {'password_change_form': ValidatingPasswordChangeForm,'template_name': 'user/password_change.html', 'post_change_redirect': '/'}),
    url(r'^logout/$', auth_views.logout_then_login),
    url(r'^admin/certification/create', 'principal.views.CertificationViews.create_certification'),
    url(r'^admin/certification/list', 'principal.views.CertificationViews.list_certifications'),
    url(r'^admin/certification/search/$', 'principal.views.CertificationViews.search'),
    url(r'^admin/certification/delete/(?P<certification_id>[0-9]+)$', 'principal.views.CertificationViews.delete_certification'),
    url(r'^admin/certification/details/(?P<certification_id>[0-9]+)$', 'principal.views.CertificationViews.details_certification'),
    url(r'^lecturer/details/(?P<lecturer_id>[0-9]+)?$', 'principal.views.TutorialViews.view_tutorials'),
    url(r'^subject/list/', 'principal.views.SubjectViews.list_subjects'),
    url(r'^student/lecturer/list/(?P<subject_id>[0-9]+)$', 'principal.views.LecturerViews.list_lecturers'),
    url(r'^student/tutorial/create/$', 'principal.views.TutorialViews.create_tutorial'),
    url(r'^rest/lecturer/(?P<subject_id>[0-9]+)$', 'principal.views.LecturerViews.get_lecturers_json'),
    url(r'^rest/subject/all$', 'principal.views.SubjectViews.get_all_json'),
    url(r'^admin/department/list', 'principal.views.DepartmentViews.list_departments'),
    url(r'^admin/department/edit/(?P<department_id>[0-9]+)?$', 'principal.views.DepartmentViews.edit_department'),
    url(r'^admin/department/search/$', 'principal.views.DepartmentViews.search'),
    url(r'^admin/department/details/(?P<department_id>[0-9]+)$', 'principal.views.DepartmentViews.details_department'),
    url(r'^admin/user/create', 'principal.views.UserViews.create_user'),
    url(r'^admin/user/list', 'principal.views.UserViews.list_users'),
    url(r'^admin/user/delete/(?P<user_id>[0-9]+)$', 'principal.views.UserViews.delete_user'),
    url(r'^admin/user/search/$', 'principal.views.UserViews.search'),
    url(r'^admin/user/details/(?P<user_id>[0-9]+)$', 'principal.views.UserViews.details_user'),
    url(r'^profile/view/(?P<student_id>[0-9]+)?$', 'principal.views.ProfileViews.view_profile'),
    url(r'^admin/subject/create', 'principal.views.SubjectViews.create_subject'),
    url(r'^admin/subject/link/(?P<subject_id>[0-9]+)$', 'principal.views.SubjectLinkViews.create'),
    url(r'^subject/details/(?P<subject_id>[0-9]+)$', 'principal.views.SubjectViews.subject_details'),
    url(r'^admin/subject/delete/(?P<subject_id>[0-9]+)$', 'principal.views.SubjectViews.delete_subject'),
    url(r'^admin/subject/delete/users/(?P<subject_id>[0-9]+)$', 'principal.views.SubjectViews.delete_users_subject'),
    url(r'^student/profile/edit$', 'principal.views.ProfileViews.edit_profile'),
    url(r'^lecturer/tutorial/edit/(?P<tutorial_id>[0-9]+)$', 'principal.views.TutorialViews.view_tutorials'),
    url(r'^lecturer/tutorial/delete/(?P<tutorial_id>[0-9]+)$', 'principal.views.TutorialViews.delete_tutorial'),
    url(r'^lecturer/tutorial/enable', 'principal.views.TutorialViews.enable_tutorials'),
    url(r'^lecturer/tutorial/disable', 'principal.views.TutorialViews.disable_tutorials'),
    url(r'^lecturer/tutorialRequest/list', 'principal.views.TutorialRequestViews.view_requests'),
    url(r'^lecturer/request/accept/(?P<tutorial_request_id>[0-9]+)$', 'principal.views.TutorialRequestViews.accept_request'),
    url(r'^lecturer/request/reject$', 'principal.views.TutorialRequestViews.view_requests'),
    url(r'^tutorialRequest/accepted', 'principal.views.TutorialRequestViews.accepted_requests'),
    url(r'^student/tutorialRequest/all', 'principal.views.TutorialRequestViews.student_all_requests'),
    url(r'^rest/lecturer/tutorial/(?P<timestamp_from>[0-9]+)/(?P<timestamp_to>[0-9]+)/(?P<utc_offset>-?[0-9]+)$', 'principal.views.TutorialViews.tutorials_json'),
    url(r'^admin/subject/link/user/(?P<subject_id>[0-9]+)/(?P<user_id>[0-9]+)?$', 'principal.views.SubjectLinkViews.link_user_subject'),
    url(r'^admin/subject/unlink/user/(?P<subject_id>[0-9]+)/(?P<user_id>[0-9]+)$', 'principal.views.SubjectLinkViews.unlink_user_subject'),
    url(r'^admin/user/import/$', 'principal.views.UserViews.import_users'),
    url(r'^admin/department/import/$', 'principal.views.DepartmentViews.import_department'),
    url(r'^lecturer/tutorial/calendar/$', 'principal.views.TutorialRequestViews.tutorial_calendar'),
    url(r'^lecturer/student/list/$', 'principal.views.ProfileViews.lecturer_students'),
    url(r'^lecturer/profile/edit/$', 'principal.views.ProfileViews.edit_lecturer'),
    url(r'^news/((?P<new_id>[0-9]+)/(?P<method>\w{2}))?$', 'principal.views.NewViews.news'),
    url(r'^news/add$', 'principal.views.NewViews.news'),
    url(r'^new/save', 'principal.views.NewViews.news'),
    url(r'^admin/subject/import/$', 'principal.views.SubjectViews.import_subject'),
    url(r'^admin/subject/import/link/(?P<subject_id>[0-9]+)$', 'principal.views.SubjectLinkViews.import_link_subject'),
    url(r'^admin/subject/unlink/certification/(?P<subject_id>[0-9]+)/(?P<certification_id>[0-9]+)$', 'principal.views.SubjectLinkViews.unlink_certification_subject'),
    url(r'^student/tutorial/seek/(?P<lecturer_id>[0-9]+)?', 'principal.views.TutorialRequestViews.seek_tutorial'),
    url(r'^rest/tutorials', 'principal.views.TutorialRequestViews.tutorials_json'),
    url(r'^subject/search/$', 'principal.views.SubjectViews.search'),
    url(r'^lecturer/tutorial/assign', 'principal.views.TutorialRequestViews.auto_assign_tutorial'),
    url(r'^rest/lecturer/request/accept', 'principal.views.TutorialRequestViews.accept_from_mail'),
)

from django.conf.urls import patterns, include, url
from principal.forms import ValidatingPasswordChangeForm
from django.contrib.auth import views as auth_views

# Custom error views
handler404 = 'principal.views.StaticViews.error_404'
handler500 = 'principal.views.StaticViews.error_500'

urlpatterns = patterns(
    '',
    # Translation URLS
    url(r'^i18n/', include('django.conf.urls.i18n')),
    # Application views
    url(r'^$', 'principal.views.StaticViews.home'),
    url(r'^cookies_policy$', 'principal.views.StaticViews.cookies_policy'),
    url(r'^login/$', auth_views.login, {'template_name': 'login.html'}),
    url(r'^password_change/$', auth_views.password_change, {'password_change_form': ValidatingPasswordChangeForm,'template_name': 'user/password_change.html', 'post_change_redirect': '/'}),
    url(r'^logout/$', auth_views.logout_then_login),
    url(r'^admin/certification/create', 'principal.views.CertificationViews.create_certification'),
    url(r'^admin/certification/list', 'principal.views.CertificationViews.list_certifications'),
    url(r'^admin/certification/search/$', 'principal.views.CertificationViews.search'),
    url(r'^admin/certification/delete/(?P<certification_id>[0-9]+)$', 'principal.views.CertificationViews.delete_certification'),
    url(r'^admin/certification/details/(?P<certification_id>[0-9]+)$', 'principal.views.CertificationViews.details_certification'),
    url(r'^lecturer/details/(?P<lecturer_id>[0-9]+)?$', 'principal.views.TutorialViews.view_tutorials'),
    url(r'^subject/list/', 'principal.views.SubjectViews.list_subjects'),
    url(r'^student/lecturer/list/(?P<subject_id>[0-9]+)$', 'principal.views.LecturerViews.list_lecturers'),
    url(r'^student/tutorial/create/$', 'principal.views.TutorialViews.create_tutorial'),
    url(r'^rest/lecturer/(?P<subject_id>[0-9]+)$', 'principal.views.LecturerViews.get_lecturers_json'),
    url(r'^rest/subject/all$', 'principal.views.SubjectViews.get_all_json'),
    url(r'^admin/department/list', 'principal.views.DepartmentViews.list_departments'),
    url(r'^admin/department/edit/(?P<department_id>[0-9]+)?$', 'principal.views.DepartmentViews.edit_department'),
    url(r'^admin/department/search/$', 'principal.views.DepartmentViews.search'),
    url(r'^admin/department/details/(?P<department_id>[0-9]+)$', 'principal.views.DepartmentViews.details_department'),
    url(r'^admin/user/create', 'principal.views.UserViews.create_user'),
    url(r'^admin/user/list', 'principal.views.UserViews.list_users'),
    url(r'^admin/user/delete/(?P<user_id>[0-9]+)$', 'principal.views.UserViews.delete_user'),
    url(r'^admin/user/search/$', 'principal.views.UserViews.search'),
    url(r'^admin/user/details/(?P<user_id>[0-9]+)$', 'principal.views.UserViews.details_user'),
    url(r'^profile/view/(?P<student_id>[0-9]+)?$', 'principal.views.ProfileViews.view_profile'),
    url(r'^admin/subject/create', 'principal.views.SubjectViews.create_subject'),
    url(r'^admin/subject/link/(?P<subject_id>[0-9]+)$', 'principal.views.SubjectLinkViews.create'),
    url(r'^subject/details/(?P<subject_id>[0-9]+)$', 'principal.views.SubjectViews.subject_details'),
    url(r'^admin/subject/delete/(?P<subject_id>[0-9]+)$', 'principal.views.SubjectViews.delete_subject'),
    url(r'^admin/subject/delete/users/(?P<subject_id>[0-9]+)$', 'principal.views.SubjectViews.delete_users_subject'),
    url(r'^student/profile/edit$', 'principal.views.ProfileViews.edit_profile'),
    url(r'^lecturer/tutorial/edit/(?P<tutorial_id>[0-9]+)$', 'principal.views.TutorialViews.view_tutorials'),
    url(r'^lecturer/tutorial/delete/(?P<tutorial_id>[0-9]+)$', 'principal.views.TutorialViews.delete_tutorial'),
    url(r'^lecturer/tutorial/enable', 'principal.views.TutorialViews.enable_tutorials'),
    url(r'^lecturer/tutorial/disable', 'principal.views.TutorialViews.disable_tutorials'),
    url(r'^lecturer/tutorialRequest/list', 'principal.views.TutorialRequestViews.view_requests'),
    url(r'^lecturer/request/accept/(?P<tutorial_request_id>[0-9]+)$', 'principal.views.TutorialRequestViews.accept_request'),
    url(r'^lecturer/request/reject$', 'principal.views.TutorialRequestViews.view_requests'),
    url(r'^tutorialRequest/accepted', 'principal.views.TutorialRequestViews.accepted_requests'),
    url(r'^student/tutorialRequest/all', 'principal.views.TutorialRequestViews.student_all_requests'),
    url(r'^rest/lecturer/tutorial/(?P<timestamp_from>[0-9]+)/(?P<timestamp_to>[0-9]+)/(?P<utc_offset>-?[0-9]+)$', 'principal.views.TutorialViews.tutorials_json'),
    url(r'^admin/subject/link/user/(?P<subject_id>[0-9]+)/(?P<user_id>[0-9]+)?$', 'principal.views.SubjectLinkViews.link_user_subject'),
    url(r'^admin/subject/unlink/user/(?P<subject_id>[0-9]+)/(?P<user_id>[0-9]+)$', 'principal.views.SubjectLinkViews.unlink_user_subject'),
    url(r'^admin/user/import/$', 'principal.views.UserViews.import_users'),
    url(r'^admin/department/import/$', 'principal.views.DepartmentViews.import_department'),
    url(r'^lecturer/tutorial/calendar/$', 'principal.views.TutorialRequestViews.tutorial_calendar'),
    url(r'^lecturer/student/list/$', 'principal.views.ProfileViews.lecturer_students'),
    url(r'^lecturer/profile/edit/$', 'principal.views.ProfileViews.edit_lecturer'),
    url(r'^news/((?P<new_id>[0-9]+)/(?P<method>\w{2}))?$', 'principal.views.NewViews.news'),
    url(r'^news/add$', 'principal.views.NewViews.news'),
    url(r'^new/save', 'principal.views.NewViews.news'),
    url(r'^admin/subject/import/$', 'principal.views.SubjectViews.import_subject'),
    url(r'^admin/subject/import/link/(?P<subject_id>[0-9]+)$', 'principal.views.SubjectLinkViews.import_link_subject'),
    url(r'^admin/subject/unlink/certification/(?P<subject_id>[0-9]+)/(?P<certification_id>[0-9]+)$', 'principal.views.SubjectLinkViews.unlink_certification_subject'),
    url(r'^student/tutorial/seek/(?P<lecturer_id>[0-9]+)?', 'principal.views.TutorialRequestViews.seek_tutorial'),
    url(r'^rest/tutorials', 'principal.views.TutorialRequestViews.tutorials_json'),
    url(r'^subject/search/$', 'principal.views.SubjectViews.search'),
    url(r'^lecturer/tutorial/assign', 'principal.views.TutorialRequestViews.auto_assign_tutorial'),
    url(r'^rest/lecturer/request/accept', 'principal.views.TutorialRequestViews.accept_from_mail'),
)
# Custom error views # Translation URLS # Application views