from django.urls import path
from .views import *
from . import views

urlpatterns = [
    path('', PostListView.as_view(), name='blog-home'),
    path('post/<int:pk>/', views.post_detail, name='post-detail'),
    path('post/new/', PostCreateView.as_view(), name='post-create'),
    path('post/<int:pk>/update', PostUpdateView.as_view(), name='post-update'),
    path('post/<int:pk>/delete', PostDeleteView.as_view(), name='post-delete'),
    path('user/<str:username>/', UserPostListView.as_view(), name='user-posts'),
    path('category/posts/<int:pk>',PostCategoryListView.as_view(), name='posts_by_category'),
    # path('categoryDetail/<int:pk>/', categoryView, name='category'),
    path('blogCategories/', blogCategories, name='blog-categories'),
    path('category/<int:pk>/', CategoryDetailView.as_view(), name='category-detail'),
    path('category/new/', CategoryCreateView.as_view(), name='category-create'),
    path('category/<int:pk>/update', CategoryUpdateView.as_view(), name='category-update'),
    path('category/<int:pk>/delete', CategoryDeleteView.as_view(), name='category-delete'),
    path('lastFivePosts/', views.LastFivePosts, name='last_five_posts'),
    path('LatestJobs/', views.LatestJobs, name='latest_jobs'),
    path('search', views.search, name='search_post'),
    path('fav/<int:id>/', views.favourite_post, name='favourite_post'),
    path('favourites/', views.post_favourite_list, name='favourite'),
    path('comment/<int:id>', views.delete_comment, name='delete-comment'),
]