""" admin urls """
from django.conf.urls import patterns, url

from . import views

urlpatterns = patterns(
    "",
    url(r"^$", views.store_admin_home, name="store_admin_home"),
    url(
        r"^add-subscription/$",
        views.add_edit_subscription,
        name="catalog_add_subscription",
    ),
    url(
        r"^edit-subscription/(?P<sku>\w+)/$",
        views.add_edit_subscription,
        name="catalog_edit_subscription",
    ),
    url(r"^add-book/$", views.add_edit_book, name="catalog_add_book"),
    url(r"^edit-book/(?P<sku>\w+)/$", views.add_edit_book, name="catalog_edit_book"),
    url(r"^add-map/$", views.add_edit_map, name="catalog_add_map"),
    url(r"^edit-map/(?P<sku>\w+)/$", views.add_edit_map, name="catalog_edit_map"),
    url(r"^add-movie/$", views.add_edit_movie, name="catalog_add_movie"),
    url(r"^edit-movie/(?P<sku>\w+)/$", views.add_edit_movie, name="catalog_edit_movie"),
    url(r"^delete/(?P<sku>\w+)/$", views.delete_item, name="catalog_delete_item"),
    url(r"^catalog/$", views.list_catalog, name="catalog_list"),
    url(
        r"^catalog/books/$",
        views.list_catalog,
        {"category": "book"},
        name="catalog_book_list",
    ),
    url(
        r"^catalog/maps/$",
        views.list_catalog,
        {"category": "map"},
        name="catalog_map_list",
    ),
    url(
        r"^catalog/movies/$",
        views.list_catalog,
        {"category": "movie"},
        name="catalog_movie_list",
    ),
    url(
        r"^catalog/subs/$",
        views.list_catalog,
        {"category": "subscription"},
        name="catalog_subscription_list",
    ),
    url(r"^orders/$", views.list_orders, name="order_list"),
    url(
        r"^order/(?P<order_number>\w+)/$",
        views.view_order_detail,
        name="view_order_detail",
    ),
    url(r"^sub/$", views.list_subscriptions, name="subscription_list"),
    url(
        r"^sub/(?P<order_number>\w+)/$",
        views.subscription_detail,
        name="subscription_detail",
    ),
    url(r"^postal/$", views.list_postal_codes, name="postal_code_list"),
    url(r"^postal/add-code/$", views.add_edit_postal_code, name="postal_code_add"),
    url(
        r"^postal/edit-code/(?P<postal_code>\w+)/$",
        views.add_edit_postal_code,
        name="postal_code_edit",
    ),
    url(
        r"^postal/delete-code/(?P<postal_code>\w+)/$",
        views.delete_postal_code,
        name="postal_code_delete",
    ),
    url(r"^add-person/$", views.add_edit_person, name="person_add"),
    url(
        r"^edit-person/(?P<person_slug>[\w\d-]+)/$",
        views.add_edit_person,
        name="person_edit",
    ),
    url(
        r"^delete-person/(?P<person_slug>[\w\d-]+)/$",
        views.delete_person,
        name="person_delete",
    ),
    url(r"^person/", views.list_persons, name="person_list"),
)
