# 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'^$', subject.course_overview, name='subject'),
            re_path(r'^edit/$', subject.edit, name='edit-subject'),
            re_path(r'^delete/$', subject.delete, name='delete-subject'),
        ]))
    ])),


    re_path(r'^course/new/$', course.create, name='create-course'),

    re_path(r'^course/(?P<course_id>[0-9]+)/', include([
        re_path(r'^$', course.course, name='course'),
        re_path(r'^edit/$', course.edit_course, name='edit-course'),
        re_path(r'^delete/$', course.delete, name='delete-course'),
        re_path(r'^activate/$', course.toggle,
            {'active': True}, name='activate-course'),
        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([

# 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'^$', subject.course_overview, name='subject'),
            re_path(r'^edit/$', subject.edit, name='edit-subject'),
            re_path(r'^delete/$', subject.delete, name='delete-subject'),
        ]))
    ])),


    re_path(r'^course/new/$', course.create, name='create-course'),

    re_path(r'^course/(?P<course_id>[0-9]+)/', include([
        re_path(r'^$', course.course, name='course'),
        re_path(r'^edit/$', course.edit_course, name='edit-course'),
        re_path(r'^delete/$', course.delete, name='delete-course'),
        re_path(r'^activate/$', course.toggle,
            {'active': True}, name='activate-course'),
        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'),