from django.contrib import admin
from django.urls import path, include, re_path

from room_reservation.views import DashboardView, LogoutView, RoomsView, AddRoom, RemoveRoom, ModifyRoom, \
    Reservations, AddReservation, RemoveReservation, ModifyReservation, ReservationDetails, AdminPanel, \
    EquipmentAddView, EquipmentDeleteView, RemoveEquipmentView, EquipmentUpdate, EquipmentUpdateView, AddUser, \
    RemoveUserView, UserDeleteView, ModifyUserView, LocationAddView, RemoveLocationView, LocationDeleteView, \
    LocationUpdateView, LocationUpdate

urlpatterns = [
    path('', DashboardView.as_view()),
    path('admin/', admin.site.urls),
    path('dashboard/', DashboardView.as_view()),
    path('accounts/', include('django.contrib.auth.urls')),
    path('logout/', LogoutView.as_view()),
    path('rooms/', RoomsView.as_view()),
    path('addroom/', AddRoom.as_view()),
    re_path(r'^removeroom/$', RemoveRoom.as_view()),
    re_path(r'^removeroom/(?P<room_id>\d+)/$', RemoveRoom.as_view()),
    path('reservations/', Reservations.as_view()),
    re_path(r'modifyroom/$', ModifyRoom.as_view()),
    re_path(r'^modifyroom/(?P<room_id>\d+)/$', ModifyRoom.as_view()),
    path('addreservation/', AddReservation.as_view()),
    path('removereservation/', RemoveReservation.as_view()),
    path('modifyreservation/', ModifyReservation.as_view()),
    re_path(r'^modifyreservation/(?P<reservation_id>\d+)/$', ReservationDetails.as_view()),
    path('adminpanel/', AdminPanel.as_view()),
    path('addequipment/', EquipmentAddView.as_view()),
    path('removeequipment/', RemoveEquipmentView.as_view()),
    path('<pk>/removeequipment/', EquipmentDeleteView.as_view()),
    path('modifyequipment/', EquipmentUpdateView.as_view()),
    path('<pk>/modifyequipment/', EquipmentUpdate.as_view()),

    path('adduser/', AddUser.as_view()),
    path('removeuser/', RemoveUserView.as_view()),
    path('<pk>/removeuser/', UserDeleteView.as_view()),
    path('modifyuser/', ModifyUserView.as_view()),
    # path('/modifyuser/', ModifyUser.as_view()),
    re_path(r'^modifyuser/(?P<user_id>\d+)/$', ModifyUserView.as_view()),

    path('addlocation/', LocationAddView.as_view()),
    path('removelocation/', RemoveLocationView.as_view()),
    path('<pk>/removelocation/', LocationDeleteView.as_view()),
    path('modifylocation/', LocationUpdateView.as_view()),
    path('<pk>/modifylocation/', LocationUpdate.as_view()),
]
