from . import views
from django.conf import settings
from django.urls import path
from django.conf.urls.static import static
from django.views.generic.base import RedirectView
from django.contrib.staticfiles.storage import staticfiles_storage


app_name = "kck"
urlpatterns = [
    path('favicon.ico', RedirectView.as_view(url=staticfiles_storage.url('/img/logo/favicon.ico'))),
    path("", views.index, name="index"),
    path("about", views.about, name="about"),
    path("contact", views.contact, name="contact"),
    path("services", views.services, name="services"),
    path("voucher", views.voucher, name="voucher"),
    path("services/<str:service_name>/", views.servicesType, name="services"),
    path("services/semix/product-catalog", views.semix_product_catalog, name="semix_product_catalog"),

    # Policies
    path("services/semix/terms-and-conditions", views.semix_terms, name="semix_terms"),
    path("services/semix/whistle-blowing-policy", views.semix_whistle, name="semix_whistle"),

    path("blog", views.blog, name="blog"),
    path("blog/category=<str:category>", views.catBlog, name="catBlog"),
    path("blog/<slug:slug_name>", views.readblog, name="readblog"),
    path("career", views.career, name="career"),
    path("project", views.project, name="project"),
    path("project/<slug:slug_title>", views.readproject, name="readproject"),
    path("identity/register", views.identity_register, name="identity_register"),
    path("identity/register/<str:reference_code>", views.identity_registered, name="identity_registered"),
    path('identity/register/<str:reference_code>/status', views.identity_register_status, name='identity_register_status'),


    path('identity/reupload/<str:reference_code>/request', views.identity_reupload_request, name="identity_reupload_request"),
    path('identity/reupload/<str:token>', views.identity_reupload, name="identity_reupload"),


    path("404", views.error, name="error"),
    path("robots.txt", views.robots_txt),

    path('terms/<str:company_name>/<slug:slug>/', views.legal_with_company, name='legal_with_company'),

    path('terms/<slug:slug>/', views.legal_without_company, name='legal_without_company')

]+ static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
handler404 = 'kck2021.views.error'
