"""coursebook URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/2.2/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
# from django.contrib import admin
# from django.urls import path

# urlpatterns = [
#     path('admin/', admin.site.urls),
# ]

from django.contrib import admin  
from django.urls import path  
from discussion import views  
from django.conf.urls import include

urlpatterns = [  
    path('admin/doc/', include('django.contrib.admindocs.urls')),
    path('admin/', admin.site.urls),  
    
    path('', views.default), 
    path('subjects/', views.show_subjects),
    path('available_subjects/', views.show_all_subjects),
    path('pending_subjects/', views.show_pending_subjects),
    path('reject_subject/<str:sub_code>', views.reject_subject),
    path('request_subject/<str:sub_code>', views.request_subject),
    path('withdraw_subject/<str:sub_code>', views.withdraw_subject),

    path('topics/<str:id>', views.show_topics),
    path('threads/<int:id>', views.show_threads),
    path('threads/like/<int:thread_id>/<int:topic_id>', views.update_thread_like_count),
    path('threads/dislike/<int:thread_id>/<int:topic_id>', views.update_thread_dislike_count),
    # path('search/<int:topic_id>', views.search),

    path('login', views.login),
    path('signup', views.signup),
    path('logout', views.logout),

    path('prof/', views.prof_home),
    path('prof/subjects/', views.prof_subjects),
    path('prof/student_list/<str:sub_code>', views.student_list),
    path('prof/student/accept/<str:sub_code>/<int:pid>', views.accept_student),
    path('prof/student/reject/<str:sub_code>/<int:pid>', views.reject_student),
    
    # path('add_thread/<int:id>', views.add_message),
]
  
