1 # Patchwork - automated patch tracking system
2 # Copyright (C) 2008 Jeremy Kerr <jk@ozlabs.org>
4 # This file is part of the Patchwork package.
6 # Patchwork is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2 of the License, or
9 # (at your option) any later version.
11 # Patchwork is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with Patchwork; if not, write to the Free Software
18 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 from django.conf.urls import patterns, url, include
21 from django.conf import settings
22 from django.contrib import admin
23 from django.contrib.auth import views as auth_views
27 urlpatterns = patterns('',
28 url(r'^admin/', include(admin.site.urls)),
30 (r'^$', 'patchwork.views.projects'),
31 (r'^project/(?P<project_id>[^/]+)/list/$', 'patchwork.views.patch.list'),
32 (r'^project/(?P<project_id>[^/]+)/$', 'patchwork.views.project.project'),
35 (r'^patch/(?P<patch_id>\d+)/$', 'patchwork.views.patch.patch'),
36 (r'^patch/(?P<patch_id>\d+)/raw/$', 'patchwork.views.patch.content'),
37 (r'^patch/(?P<patch_id>\d+)/mbox/$', 'patchwork.views.patch.mbox'),
39 # logged-in user stuff
40 (r'^user/$', 'patchwork.views.user.profile'),
41 (r'^user/todo/$', 'patchwork.views.user.todo_lists'),
42 (r'^user/todo/(?P<project_id>[^/]+)/$', 'patchwork.views.user.todo_list'),
45 'patchwork.views.bundle.bundles'),
47 (r'^user/link/$', 'patchwork.views.user.link'),
48 (r'^user/unlink/(?P<person_id>[^/]+)/$', 'patchwork.views.user.unlink'),
51 url(r'^user/password-change/$', auth_views.password_change,
52 name='password_change'),
53 url(r'^user/password-change/done/$', auth_views.password_change_done,
54 name='password_change_done'),
57 url(r'^user/login/$', auth_views.login,
58 {'template_name': 'patchwork/login.html'},
60 url(r'^user/logout/$', auth_views.logout,
61 {'template_name': 'patchwork/logout.html'},
62 name = 'auth_logout'),
65 (r'^register/', 'patchwork.views.user.register'),
67 # public view for bundles
68 (r'^bundle/(?P<username>[^/]*)/(?P<bundlename>[^/]*)/$',
69 'patchwork.views.bundle.bundle'),
70 (r'^bundle/(?P<username>[^/]*)/(?P<bundlename>[^/]*)/mbox/$',
71 'patchwork.views.bundle.mbox'),
73 (r'^confirm/(?P<key>[0-9a-f]+)/$', 'patchwork.views.confirm'),
75 # submitter autocomplete
76 (r'^submitter/$', 'patchwork.views.submitter_complete'),
79 (r'^mail/$', 'patchwork.views.mail.settings'),
80 (r'^mail/optout/$', 'patchwork.views.mail.optout'),
81 (r'^mail/optin/$', 'patchwork.views.mail.optin'),
84 (r'^help/(?P<path>.*)$', 'patchwork.views.help'),
87 if settings.ENABLE_XMLRPC:
88 urlpatterns += patterns('',
89 (r'xmlrpc/$', 'patchwork.views.xmlrpc.xmlrpc'),
90 (r'^pwclient/$', 'patchwork.views.pwclient'),
91 (r'^project/(?P<project_id>[^/]+)/pwclientrc/$',
92 'patchwork.views.pwclientrc'),
95 # redirect from old urls
96 if settings.COMPAT_REDIR:
97 urlpatterns += patterns('',
98 (r'^user/bundle/(?P<bundle_id>[^/]+)/$',
99 'patchwork.views.bundle.bundle_redir'),
100 (r'^user/bundle/(?P<bundle_id>[^/]+)/mbox/$',
101 'patchwork.views.bundle.mbox_redir'),