from django.conf.urls.defaults import  url, patterns
from django.views.generic.simple import direct_to_template

from zorna.account import views


urlpatterns = patterns('',
                       url(r'^login/$',
                           views.login, { 'template_name': ['login.html', 'account/login.html']},
                           name='user_login'),
                       url(r'^logout/$',
                           views.logout,
                           name='user_logout'),
                       url(r'^register/$',
                           views.register,
                           name='user_register'),
                       url(r'^register/complete/email/$',
                           direct_to_template,
                           {'template': 'account/registration_complete_email.html'},
                           name='user_register_complete_email'),
                       url(r'^register/complete/noemail/$',
                           direct_to_template,
                           {'template': 'account/registration_complete_noemail.html'},
                           name='user_register_complete_noemail'),
                       url(r'^register/complete/novalidation/$',
                           direct_to_template,
                           {'template': 'account/registration_complete_novalidation.html'},
                           name='user_register_complete_novalidation'),
                       url(r'^activate/(?P<activation_key>\w+)/$',
                           views.activate_account,
                           name='account_activate'),
                       url(r'^users/add/$',
                           views.add_user,
                           name='add_user'),
                       url(r'^users/edit/(?P<user>\d+)/$',
                           views.edit_user,
                           name='edit_user'),
                       url(r'^users/password/(?P<user>\d+)/$',
                           views.edit_user_password,
                           name='edit_user_password'),
                       url(r'^users/$',
                           views.list_users,
                           name='list_users'),
                       url(r'^groups/$',
                           views.list_groups,
                           name='list_groups'),
                       url(r'^administrators/$',
                           views.list_administrators,
                           name='list_administrators'),
                       url(r'^groups/add/$',
                           views.add_group,
                           name='add_group'),
                       url(r'^groups/edit/(?P<group>\d+)/$',
                           views.edit_group,
                           name='edit_group'),
                       url(r'^groups/user/(?P<user>\d+)/$',
                           views.groups_user,
                           name='groups_user'),
                       url(r'^users/group/(?P<group>\d+)/$',
                           views.users_group,
                           name='users_group'),
                       url(r'^user/settings/$',
                           views.user_settings,
                           name='user_settings'),
                       url(r'^user/settings/profile/$',
                           views.user_settings_profile,
                           name='user_settings_profile'),
                       url(r'^user/settings/avatar/$',
                           views.user_settings_avatar,
                           name='user_settings_avatar'),
                       url(r'^user/settings/change/password/$',
                           views.change_my_password,
                           name='change_my_password'),
                       url(r'^import/users/$',
                           views.import_users_view,
                           name='import_users_view'),
                       url(r'^user/forgot/password/$',
                           views.forgot_passord,
                           name='forgot_password'),
                       url(r'^user/request/password/$',
                           views.request_password,
                           name='request_password'),
                       )
