from django.urls import path
from django.views.generic import RedirectView, TemplateView

from . import views

app_name = "module_auth"

urlpatterns = [
    # redirect to different url 
    path('', RedirectView.as_view(url='login'), name='index'),
    path('login/', views.AdminLoginView.as_view(), name="login"),
    path('logout/', views.AdminLogoutView.as_view(), name="logout"),
    path('password-reset/', views.CustomPasswordResetView.as_view(), name='password_reset'),
    path('password-reset/done/', views.CustomPasswordResetDoneView.as_view(), name='password_reset_done'),
    path('password-reset-confirm/<uidb64>/<token>/', views.CustomPasswordResetConfirmView.as_view(), name='password_reset_confirm'),
    path('password-reset-complete/', views.CustomPasswordResetCompleteView.as_view(), name='password_reset_complete'),
    path('users/', views.UserDashView.as_view(), name='users'),
    path('users/add/', views.UserCreateOrUpdateView.as_view(), name='user_add'),
    path('users/edit/<int:pk>/', views.UserCreateOrUpdateView.as_view(), name='user_edit'),
    path('users/list/', views.UserListJson.as_view(), name='users_list'),
    path('users/action/', views.UserActionView.as_view(), name='users_action'),
    path('user/view/<int:id>/', views.UserRecordView.as_view(), name='user_view'),
    path('user/archive/list/', views.UserArchiveList.as_view(), name='user_archive'),
    path('user/count/', views.UsersCountView.as_view(), name="user_count")

]
