from django.contrib.auth import views as auth_views
from django.urls import path

from .views import (
    calendar_embed,
    calendar_page,
    event_create,
    event_dashboard,
    event_dashboard_detail,
    event_delete,
    event_export,
    event_import_preview,
    event_import_restore,
    event_detail,
    event_edit,
    event_list,
    home,
)

urlpatterns = [
    path('', home, name='home'),
    path('calendar/', calendar_page, name='calendar_page'),
    path('calendar/embed/', calendar_embed, name='calendar_embed'),
    path('events/', event_list, name='event_list'),
    path('events/<slug:slug>/', event_detail, name='event_detail'),
    path('dashboard/events/', event_dashboard, name='event_dashboard'),
    path('dashboard/events/export/', event_export, name='event_export'),
    path('dashboard/events/import/preview/', event_import_preview, name='event_import_preview'),
    path('dashboard/events/import/restore/', event_import_restore, name='event_import_restore'),
    path('dashboard/events/new/', event_create, name='event_create'),
    path('dashboard/events/<slug:slug>/edit/', event_edit, name='event_edit'),
    path('dashboard/events/<slug:slug>/delete/', event_delete, name='event_delete'),
    path('dashboard/events/<slug:slug>/', event_dashboard_detail, name='event_dashboard_detail'),
    path(
        'login/',
        auth_views.LoginView.as_view(template_name='registration/login.html', redirect_authenticated_user=True),
        name='login',
    ),
    path('logout/', auth_views.LogoutView.as_view(), name='logout'),
]
