2012-02-27 09:49:20 +01:00
|
|
|
from django.conf.urls.defaults import patterns, include, url
|
2012-03-06 15:30:32 +01:00
|
|
|
from django.utils.translation import ugettext_lazy as _
|
2012-02-27 10:07:13 +01:00
|
|
|
from django.contrib import admin
|
2012-03-06 15:53:53 +01:00
|
|
|
from django.contrib.auth import views as auth_views
|
|
|
|
from django.views.generic.simple import direct_to_template
|
|
|
|
|
|
|
|
from registration.views import activate
|
|
|
|
from registration.views import register
|
2012-03-06 15:15:28 +01:00
|
|
|
|
|
|
|
from accounts.forms import RegistrationForm
|
|
|
|
|
2012-02-27 10:07:13 +01:00
|
|
|
admin.autodiscover()
|
2012-02-27 09:49:20 +01:00
|
|
|
|
|
|
|
urlpatterns = patterns('',
|
2012-02-29 11:11:42 +01:00
|
|
|
url(r'^$', 'trans.views.home'),
|
|
|
|
url(r'^projects/(?P<project>[^/]*)/$', 'trans.views.show_project'),
|
|
|
|
url(r'^projects/(?P<project>[^/]*)/(?P<subproject>[^/]*)/$', 'trans.views.show_subproject'),
|
|
|
|
url(r'^projects/(?P<project>[^/]*)/(?P<subproject>[^/]*)/(?P<lang>[^/]*)/$', 'trans.views.show_translation'),
|
|
|
|
url(r'^projects/(?P<project>[^/]*)/(?P<subproject>[^/]*)/(?P<lang>[^/]*)/translate/$', 'trans.views.translate'),
|
2012-03-01 17:09:03 +01:00
|
|
|
url(r'^projects/(?P<project>[^/]*)/(?P<subproject>[^/]*)/(?P<lang>[^/]*)/download/$', 'trans.views.download_translation'),
|
2012-03-04 09:37:22 +01:00
|
|
|
url(r'^projects/(?P<project>[^/]*)/(?P<subproject>[^/]*)/(?P<lang>[^/]*)/upload/$', 'trans.views.upload_translation'),
|
2012-02-27 11:53:02 +01:00
|
|
|
|
2012-03-02 16:01:53 +01:00
|
|
|
url(r'^js/get/(?P<checksum>[^/]*)/$', 'trans.views.get_string'),
|
|
|
|
|
2012-02-29 13:11:39 +01:00
|
|
|
# Admin interface
|
2012-02-27 11:53:02 +01:00
|
|
|
url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
|
|
|
|
url(r'^admin/', include(admin.site.urls)),
|
2012-02-29 13:11:39 +01:00
|
|
|
|
2012-02-29 15:03:45 +01:00
|
|
|
# Auth
|
2012-03-06 15:53:53 +01:00
|
|
|
url(r'^accounts/register/$', register, {
|
2012-03-06 15:34:39 +01:00
|
|
|
'form_class': RegistrationForm,
|
|
|
|
'extra_context': {'title': _('User registration')}},
|
2012-03-06 15:38:52 +01:00
|
|
|
name='weblate_register'),
|
2012-03-06 15:53:53 +01:00
|
|
|
url(r'^accounts/register/complete/$',
|
|
|
|
direct_to_template,
|
2012-03-06 15:57:47 +01:00
|
|
|
{
|
|
|
|
'template': 'registration/registration_complete.html',
|
|
|
|
'extra_context': {'title': _('User registration')},
|
|
|
|
},
|
2012-03-06 15:53:53 +01:00
|
|
|
name='registration_complete'),
|
|
|
|
url(r'^accounts/activate/(?P<activation_key>\w+)/$',
|
|
|
|
activate,
|
2012-03-06 15:57:47 +01:00
|
|
|
{'extra_context': {'title': _('Account activation')}},
|
2012-03-06 15:53:53 +01:00
|
|
|
name='registration_activate'),
|
|
|
|
url(r'^accounts/login/$',
|
|
|
|
auth_views.login,
|
2012-03-06 15:57:47 +01:00
|
|
|
{
|
|
|
|
'template_name': 'registration/login.html',
|
|
|
|
'extra_context': {'title': _('Login')},
|
|
|
|
},
|
2012-03-06 15:53:53 +01:00
|
|
|
name='auth_login'),
|
|
|
|
url(r'^accounts/logout/$',
|
|
|
|
auth_views.logout,
|
2012-03-06 15:57:47 +01:00
|
|
|
{
|
|
|
|
'template_name': 'registration/logout.html',
|
|
|
|
'extra_context': {'title': _('Logged out')},
|
|
|
|
},
|
2012-03-06 15:53:53 +01:00
|
|
|
name='auth_logout'),
|
|
|
|
url(r'^accounts/password/change/$',
|
|
|
|
auth_views.password_change,
|
2012-03-06 15:57:47 +01:00
|
|
|
{'extra_context': {'title': _('Change password')}},
|
2012-03-06 15:53:53 +01:00
|
|
|
name='auth_password_change'),
|
|
|
|
url(r'^accounts/password/change/done/$',
|
|
|
|
auth_views.password_change_done,
|
2012-03-06 15:57:47 +01:00
|
|
|
{'extra_context': {'title': _('Password changed')}},
|
2012-03-06 15:53:53 +01:00
|
|
|
name='auth_password_change_done'),
|
|
|
|
url(r'^accounts/password/reset/$',
|
|
|
|
auth_views.password_reset,
|
2012-03-06 15:59:08 +01:00
|
|
|
{'extra_context': {'title': _('Password reset')}},
|
2012-03-06 15:53:53 +01:00
|
|
|
name='auth_password_reset'),
|
|
|
|
url(r'^accounts/password/reset/confirm/(?P<uidb36>[0-9A-Za-z]+)-(?P<token>.+)/$',
|
|
|
|
auth_views.password_reset_confirm,
|
2012-03-06 15:59:08 +01:00
|
|
|
{'extra_context': {'title': _('Password reset')}},
|
2012-03-06 15:53:53 +01:00
|
|
|
name='auth_password_reset_confirm'),
|
|
|
|
url(r'^accounts/password/reset/complete/$',
|
|
|
|
auth_views.password_reset_complete,
|
2012-03-06 15:59:08 +01:00
|
|
|
{'extra_context': {'title': _('Password reset')}},
|
2012-03-06 15:53:53 +01:00
|
|
|
name='auth_password_reset_complete'),
|
|
|
|
url(r'^accounts/password/reset/done/$',
|
|
|
|
auth_views.password_reset_done,
|
2012-03-06 15:59:08 +01:00
|
|
|
{'extra_context': {'title': _('Password reset')}},
|
2012-03-06 15:53:53 +01:00
|
|
|
name='auth_password_reset_done'),
|
2012-03-02 16:16:20 +01:00
|
|
|
url(r'^accounts/profile/', 'accounts.views.profile'),
|
2012-02-29 15:03:45 +01:00
|
|
|
|
2012-03-05 10:55:21 +01:00
|
|
|
url(r'^contact/', 'accounts.views.contact'),
|
|
|
|
|
2012-02-29 13:11:39 +01:00
|
|
|
# Media files
|
|
|
|
url(r'^media/(?P<path>.*)$', 'django.views.static.serve',
|
|
|
|
{'document_root': './media'}),
|
2012-02-27 09:49:20 +01:00
|
|
|
)
|