# Path: course/views/index.py
# def index(request):
#     return render(
#         request,
#         'index.html',
#         {
#             'title': _('Welcome'),
#             'news': news.News.objects.order_by('-id')
#         }
#     )
# 
# Path: course/views/subject.py
# def course_overview(request, subjectname):
# def subject_overview(request):
# def create(request):
# def edit(request, subjectname):
# def delete(request, subjectname):
# 
# Path: course/views/course.py
# def course(request: HttpRequest, course_id: str):
#     """
#     Controller for single course info page
# 
#     :param request: request object
#     :param course_id: id for the course
#     :return:
#     """
#     try:
#         current_course = Course.objects.get(id=course_id)
# 
#         if hasattr(request.user, 'userinformation'):
#             user = request.user.userinformation
# 
#             if isinstance(user, UserInformation):
#                 context = current_course.as_context(user)
#             else:
#                 context = current_course.as_context()
#         else:
#             context = current_course.as_context()
# 
#         session = request.session
#         if 'enroll-error' in session:
#             context['error'] = session['enroll-error']
#             del session['enroll-error']
# 
#         return render(
#             request,
#             'course/info.html',
#             context
#         )
#     except Course.DoesNotExist:
#         return db_error(_('Requested course does not exist.'))
# 
# Path: course/views/enroll.py
# def add(request, course_id):
# def remove(request, course_id):
# 
# Path: course/views/time.py
# def edit_slot(request: HttpRequest, course_id):
# def remove_slot(request, course_id, slot_id):
# 
# Path: course/views/news.py
# def create(request):
# def edit(request: HttpRequest, news_id: str):
# def delete(request: HttpRequest, news_id: str):


from django.urls import include, path, re_path
from django.contrib import admin
from course.views import index, subject, course, enroll, time, news
        re_path(r'^deactivate/$', course.toggle,
            {'active': False}, name='deactivate-course'),
        re_path(r'^participants/$', course.participants_list,
            name='course-participants'),
        re_path(r'^notify/', include([
            re_path(r'^$', course.notify, name='notify-course'),
            re_path(r'^done/$', course.notify_done, name='notify-course-done'),
        ])),
        re_path(r'^contact/', include([
            re_path(r'^$', course.contact_teachers, name='contact-teachers'),
            re_path(r'^done/$', course.notify_done, name='contact-teachers-done'),
        ])),
        re_path(r'^register/', include([
            re_path(r'^$', enroll.add, name='register-course'),
            re_path(r'^remove/', include([
                re_path(r'^$', enroll.remove, name='unregister-course'),
                re_path(r'^(?P<student_id>[0-9]+)/$',
                    course.remove_student, name='unregister-course'),
            ])),
        ])),
        re_path(r'^schedule/', include([
            re_path(r'^edit/$', time.edit_slot, name='course-edit-slot'),
            re_path(r'^remove/(?P<slot_id>[0-9]+)/$',
                time.remove_slot, name='course-remove-slot'),
        ])),
        re_path(r'^teachers/', include([
            re_path(r'^add/$', course.add_teacher, name='add-teacher'),
            re_path(r'^remove/(?P<teacher_id>[0-9]+)/$',
                course.remove_teacher, name='remove-teacher'),
        ])),

# Path: course/views/index.py
# def index(request):
#     return render(
#         request,
#         'index.html',
#         {
#             'title': _('Welcome'),
#             'news': news.News.objects.order_by('-id')
#         }
#     )
# 
# Path: course/views/subject.py
# def course_overview(request, subjectname):
# def subject_overview(request):
# def create(request):
# def edit(request, subjectname):
# def delete(request, subjectname):
# 
# Path: course/views/course.py
# def course(request: HttpRequest, course_id: str):
#     """
#     Controller for single course info page
# 
#     :param request: request object
#     :param course_id: id for the course
#     :return:
#     """
#     try:
#         current_course = Course.objects.get(id=course_id)
# 
#         if hasattr(request.user, 'userinformation'):
#             user = request.user.userinformation
# 
#             if isinstance(user, UserInformation):
#                 context = current_course.as_context(user)
#             else:
#                 context = current_course.as_context()
#         else:
#             context = current_course.as_context()
# 
#         session = request.session
#         if 'enroll-error' in session:
#             context['error'] = session['enroll-error']
#             del session['enroll-error']
# 
#         return render(
#             request,
#             'course/info.html',
#             context
#         )
#     except Course.DoesNotExist:
#         return db_error(_('Requested course does not exist.'))
# 
# Path: course/views/enroll.py
# def add(request, course_id):
# def remove(request, course_id):
# 
# Path: course/views/time.py
# def edit_slot(request: HttpRequest, course_id):
# def remove_slot(request, course_id, slot_id):
# 
# Path: course/views/news.py
# def create(request):
# def edit(request: HttpRequest, news_id: str):
# def delete(request: HttpRequest, news_id: str):


# Path: course/urls.py
from django.urls import include, path, re_path
from django.contrib import admin
from course.views import index, subject, course, enroll, time, news

        re_path(r'^deactivate/$', course.toggle,
            {'active': False}, name='deactivate-course'),
        re_path(r'^participants/$', course.participants_list,
            name='course-participants'),
        re_path(r'^notify/', include([
            re_path(r'^$', course.notify, name='notify-course'),
            re_path(r'^done/$', course.notify_done, name='notify-course-done'),
        ])),
        re_path(r'^contact/', include([
            re_path(r'^$', course.contact_teachers, name='contact-teachers'),
            re_path(r'^done/$', course.notify_done, name='contact-teachers-done'),
        ])),
        re_path(r'^register/', include([
            re_path(r'^$', enroll.add, name='register-course'),
            re_path(r'^remove/', include([
                re_path(r'^$', enroll.remove, name='unregister-course'),
                re_path(r'^(?P<student_id>[0-9]+)/$',
                    course.remove_student, name='unregister-course'),
            ])),
        ])),
        re_path(r'^schedule/', include([
            re_path(r'^edit/$', time.edit_slot, name='course-edit-slot'),
            re_path(r'^remove/(?P<slot_id>[0-9]+)/$',
                time.remove_slot, name='course-remove-slot'),
        ])),
        re_path(r'^teachers/', include([
            re_path(r'^add/$', course.add_teacher, name='add-teacher'),
            re_path(r'^remove/(?P<teacher_id>[0-9]+)/$',
                course.remove_teacher, name='remove-teacher'),
        ])),

        re_path(r'^attendee-list/$', course.attendee_list, name='attendee-list'),