from django.conf.urls import url
from django.conf.urls.static import static
from django.conf import settings

from . import views

app_name = 'shop'
urlpatterns = [
    # USER
    url(r'^$', views.index, name='index'),
    url(r'^about/$', views.about, name='about'),
    url(r'^articles/$', views.articles, name='articles'),
    url(r'^articles/(?P<pk>[0-9]+)/$', views.article, name='article'),
    url(r'^products/$', views.products, name='products'),
    url(r'^products/(?P<pk>[0-9]+)/$', views.product, name='product'),
    url(r'^products/(?P<pk>[0-9]+)/confirm/$', views.confirm, name='confirm'),
    url(r'^products/(?P<pk>[0-9]+)/buy/$', views.buy, name='buy'),
    url(r'^thanks$', views.thanks, name='thanks'),
    # ADMIN
    url(r'^admin/$', views.admin_home, name='admin_home'),
    url(r'^admin/login/$', views.admin_login, name='admin_login'),
    url(r'^admin/profile/$', views.admin_profile, name='admin_profile'),
    url(r'^admin/product/$', views.admin_product, name='admin_product'),
    url(r'^admin/article/$', views.admin_article, name='admin_article'),
    url(r'^admin/unpaidorder/$', views.admin_unpaidorder, name='admin_unpaidorder'),
    url(r'^admin/paidorder/$', views.admin_paidorder, name='admin_paidorder'),
    url(r'^admin/historyorder/$', views.admin_historyorder, name='admin_historyorder'),
    url(r'^admin/products/$', views.admin_product, name='admin_product'),
    url(r'^admin/products/add/$', views.admin_add_product, name='admin_add_product'),
    url(r'^admin/products/(?P<pk>[0-9]+)/edit/$', views.admin_edit_product, name='admin_edit_product'),
    url(r'^admin/products/(?P<pk>[0-9]+)/delete/$', views.admin_delete_product, name='admin_delete_product'),
] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT) + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
