"""Alion URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/3.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 path

from django.conf import settings
from django.conf.urls import include, url
from django.conf.urls.static import static
from alion_app import urls as alion_urls
from django.conf.urls.i18n import i18n_patterns

from alion_app.views import DashboardPageView, EditBookingView, EditRoomView, RoomsDXPageView, StatisticsPageView, \
    RoomAvailabilityFormView, CreateBooking, CreateRoom, StatisticsIncomePageView

urlpatterns = [
    path('admin994/', admin.site.urls),
    url(r'^i18n/', include('django.conf.urls.i18n')),
]
urlpatterns += i18n_patterns(
    path('', include(alion_urls, namespace='alion_site')),
    path('captcha/', include('captcha.urls')),
) + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)

urlpatterns += [
    path('dx/', DashboardPageView.as_view(), name='dx'),
    path('dx/<int:pk>/update', EditBookingView.as_view(), name='edit_booking'),
    path('dx/rooms/', RoomsDXPageView.as_view(), name='rooms_dx'),
    path('dx/room_availability', RoomAvailabilityFormView.as_view(), name='room_availability'),
    path('dx/room/<int:pk>/update', EditRoomView.as_view(), name='edit_room'),
    path('dx/statistics/', StatisticsPageView.as_view(), name='stats_dx'),
    path('dx/statistics/income', StatisticsIncomePageView.as_view(), name='stats_income_dx'),
    path('dx/create_booking', CreateBooking.as_view(), name='create_booking'),
    path('dx/create_room', CreateRoom.as_view(), name='create_room'),
    path('accounts/', include('django.contrib.auth.urls')),
] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
