from django.conf.urls import patterns, url

from .views import WinoseUsersListView, WinoseUserDetailView, WinoseUserCreateView, WinoseUserUpdateView
from .models import WinoseUser

urlpatterns = patterns('',
                       url(regex=r'^$',
                           view=WinoseUsersListView.as_view(),
                           name=WinoseUser.overview_url),
                       url(regex=r'^(?P<pk>\d+)/$',
                           view=WinoseUserDetailView.as_view(),
                           name=WinoseUser.detail_url),
                       url(regex=r'^create/$',
                           view=WinoseUserCreateView.as_view(),
                           name=WinoseUser.create_url),
                       url(regex=r'^update/(?P<pk>\d+)/$',
                           view=WinoseUserUpdateView.as_view(),
                           name=WinoseUser.update_url),
                       url(regex=r'^login/$', view='django.contrib.auth.views.login',
                           name='login_page',
                           kwargs={'template_name': 'users/login.html'}),
                       url(regex=r'^logout/$', view='django.contrib.auth.views.logout',
                           name='logout_page',
                           kwargs={'next_page': 'homepage'}),
                       url(regex=r'^change_password/$',
                           view='django.contrib.auth.views.password_change',
                           name='change_password',
                           kwargs={'template_name': 'users/change_pw.html'}),
                       url(regex=r'^pw_change_done/',
                           view='django.contrib.auth.views.password_change_done',
                           name='password_change_done',
                           kwargs={'template_name': 'users/change_pw_done.html'}),
)