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

from . import views, forms
from . import actions

app_name = 'multimail'
urlpatterns = [
    path('', views.dispatchIndex, name='index'),

    path('domains/', views.DomainListView.as_view(), name='domains'),
    path('domain/new/', forms.new_domain, name='new_domain'),
    path('domain/<int:domain_id>/', forms.edit_domain, name='edit_domain'),
    path('domain/<int:domain_id>/delete', actions.delete_domain, name='delete_domain'),

    path('mailboxes/', views.MailboxListView.as_view(), name='mailboxes'),
    path('mailbox/new/', forms.new_mailbox, name='new_mailbox'),
    path('mailbox/<int:mailbox_id>/', forms.edit_mailbox, name='edit_mailbox'),
    path('mailbox/<int:mailbox_id>/delete', actions.delete_mailbox, name='delete_mailbox'),

    path('aliases/', views.AliasListView.as_view(), name='aliases'),
    path('alias/new/', forms.new_alias, name='new_alias'),
    path('alias/<int:alias_id>/', forms.edit_alias, name='edit_alias'),
    path('alias/<int:alias_id>/delete', actions.delete_alias, name='delete_alias'),

    path('login/', views.UserLoginView.as_view(), name='login'),
    path('logout/', actions.logout, name='logout'),
]