"""URLS to access upcoming events and the event archive."""
from django.conf.urls import url
from django.views.generic import RedirectView
from . import views

urlpatterns = [
    url(r'^$', RedirectView.as_view(url='/events/upcoming/', permanent=True)),
    url(r'^(?P<year>[\d]{4})/$', views.EventArchiveYear.as_view(),
        name='event-archive'),
    url(r'^(?P<year>[\d]{4})/(?P<month>[\d]+)/$',
        views.EventArchiveMonth.as_view(),
        name='event-archive'),
    url(r'^(?P<year>[\d]{4})/(?P<month>[\d]+)/(?P<pk>[\d]+)/$',
        views.EventDetail.as_view(), name='event-detail'),
    url(r'^(?P<year>[\d]{4})/(?P<month>[\d]+)/(?P<pk>[\d]+)/add_dates/$',
        views.EventSeriesForm.as_view(), name='eventseries-form'),
    url(r'^(?P<year>[\d]{4})/(?P<month>[\d]+)/(?P<pk>[\d]+)/edit/$',
        views.EventForm.as_view(), name='event-form'),
    url(r'^add/$', views.EventForm.as_view(), name='event-form'),
    url(r'^archive/$', views.EventArchiveIndex.as_view(), name='event-archive'),
    url(r'^upcoming/$', views.UpcomingEvents.as_view(), name='upcoming-events'),
]
