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

from .views import event_detail, export_attendees_csv, home, organizer_dashboard, organizer_event_create, organizer_event_edit, registration_success

urlpatterns = [
    path('login/', auth_views.LoginView.as_view(template_name='core/login.html', redirect_authenticated_user=True), name='login'),
    path('logout/', auth_views.LogoutView.as_view(next_page='home'), name='logout'),
    path('', home, name='home'),
    path('events/<slug:slug>/', event_detail, name='event_detail'),
    path('events/<slug:slug>/registered/<int:registration_id>/', registration_success, name='registration_success'),
    path('dashboard/', organizer_dashboard, name='organizer_dashboard'),
    path('dashboard/events/new/', organizer_event_create, name='organizer_event_create'),
    path('dashboard/events/<slug:slug>/edit/', organizer_event_edit, name='organizer_event_edit'),
    path('dashboard/events/<slug:slug>/attendees.csv', export_attendees_csv, name='export_attendees_csv'),
]
