"""procat2 URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/2.1/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import include, path
from django.conf import settings

from lazysignup.views import convert

from dashboard.views import dashboard
from cataloglist.views import cataloglist, my_catalogs, public_catalogs
from catalogedit.views import catalogedit, get_catalog, save_catalog
from products.views import search_products, all_models

from .forms import UserCreationForm
from .views import login_guest, lazy_convert_done


urlpatterns = [
    path('guest', login_guest, name='login_guest'),
    path('', dashboard, name='home'),
    path('dashboard', dashboard, name='dashboard'),

    path('catalogs', cataloglist, name='cataloglist'),
    path('api/v1/catalogs/mine', my_catalogs, name='my_catalogs'),
    path('api/v1/catalogs/public', public_catalogs, name='public_catalogs'),

    path('catalog/new', catalogedit, name='catalogedit'),
    path('catalog/edit/<int:id>', catalogedit, name='catalogedit'),
    path('api/v1/catalogs/id/<int:id>', get_catalog, name='get_catalog'),
    path('api/v1/catalogs/save', save_catalog, name='save_catalog'),

    path('api/v1/products/search', search_products, name='search_products'),
    path('api/v1/products/models', all_models, name='all_models'),

    path('admin/', admin.site.urls),
    path("account/", include("account.urls")),
    path('convert/', convert, { 'form_class': UserCreationForm }, name='lazysignup_convert'),
    path('convert/done/', lazy_convert_done, name='lazysignup_convert_done'),

    path('quickinfo/', include('quickinfo.urls')),

    path('markup/', include('markup.urls')),
]

if settings.DJDT:
    import debug_toolbar
    urlpatterns += [
        path('debug/', include(debug_toolbar.urls)),
    ]

# accounts/login/ [name='login']
# accounts/logout/ [name='logout']
# accounts/password_change/ [name='password_change']
# accounts/password_change/done/ [name='password_change_done']
# accounts/password_reset/ [name='password_reset']
# accounts/password_reset/done/ [name='password_reset_done']
# accounts/reset/<uidb64>/<token>/ [name='password_reset_confirm']
# accounts/reset/done/ [name='password_reset_complete']
