from django.urls import path
from django.conf.urls import url

from . import views

urlpatterns = [
    path('', views.PostListView.as_view(), name='homeview'),
    path('posts/', views.PostListView.as_view(), name='postlistview'),
    url(r'^posts/(?P<operation>.+)/(?P<group>.+)/(?P<category>.+)/(?P<page>\d+)/$',
        views.ArticleList.as_view(), name='groupArticleListView'),
    url(r'^post/(?P<operation>.+)/(?P<slug>.+)/$',
        views.ArticleDetail.as_view(), name='articledetailview'),
    url(r'^rate/(?P<id>\d+)/(?P<review>\d+)/$',
        views.RatingView.as_view(), name='ratingview'),
    url(r'^prerender/(?P<order>.+)/$',
        views.Prerender.as_view(), name='prerenderview'),
    path('search/', views.Search.as_view(), name='searchview'),
    url(r'^writer/delete/(?P<id>\d+)/$',
        views.DeletePost.as_view(), name='deletepostview'),
    path('writer/add/', views.AddPost.as_view(), name='addpostview'),
    url(r'^writer/addslide/(?P<id>\d+)/$',
        views.SlideImageView.as_view(), name='addslideview'),
    path('upload/', views.BodyImageView.as_view(), name='bodyimageview'),
    path('writer/tagsearch/', views.SearchTags.as_view(), name='searchtagsview'),
    url(r'writer/validation/(?P<operation>.+)/$',
        views.TitleValidation.as_view(), name='titlevalidationview'),
    path('writer/featured/',
         views.FeaturedPosts.as_view(), name="featuredpostsview"),
    path('writer/categorieslist/', views.CategoriesList.as_view(),
         name='categorieslistview'),
    url(r'^writer/categorydelete/(?P<slug>.+)/$',
        views.CategoryDelete.as_view(), name='categorydeleteview'),
    path('writer/categoryadd/', views.CategoryAdd.as_view(), name='categoryaddview'),
    url(r'^writer/categorydetail/(?P<slug>.+)/$',
        views.CategoryDetail.as_view(), name='categorydetailview'),
    path('writer/quoteslist/', views.QuotesList.as_view(), name='quoteslistview'),
    url(r'^writer/quotedelete/(?P<id>\d+)/$',
        views.QuoteDelete.as_view(), name='quotedeleteview'),
    path('writer/quoteadd/', views.QuoteAdd.as_view(), name='quoteaddview'),
    url(r'^writer/quotedetail/(?P<pk>\d+)/$',
        views.QuoteDetail.as_view(), name='quotedetailview'),
    path('writer/postlist/', views.WriterPostList.as_view(),
         name='writerpostlistview'),
    url(r'^postviews/(?P<id>\d+)/$', views.ViewsAdd.as_view(), name="addviewview"),
    url(r'^training/(?P<id>\d+)/(?P<operation>[a-z]+)/$',
        views.TrainingGroupView.as_view(), name='traininggroupview')
]
