summaryrefslogtreecommitdiff
path: root/urls.py
diff options
context:
space:
mode:
authorNicolás Reynolds <fauno@kiwwwi.com.ar>2010-12-31 15:42:55 -0300
committerNicolás Reynolds <fauno@kiwwwi.com.ar>2010-12-31 15:42:55 -0300
commitc9178286885d60741eb0e696c3e345e3b0dfb9e2 (patch)
tree7738211d84337e897acfd2263be0b33352becae0 /urls.py
parentebcd492d39cd0525b768a48558e50041aa0961e3 (diff)
parent84897adcdc698678f2ee8d2292cfe4271c6335e4 (diff)
Merge git://projects.archlinux.org/archweb
Conflicts: templates/public/index.html urls.py
Diffstat (limited to 'urls.py')
-rw-r--r--urls.py129
1 files changed, 49 insertions, 80 deletions
diff --git a/urls.py b/urls.py
index 886cd375..9c979d4b 100644
--- a/urls.py
+++ b/urls.py
@@ -4,7 +4,6 @@ from django.contrib import admin
from django.views.generic.simple import direct_to_template
-from main.models import Todolist
from feeds import PackageFeed, NewsFeed
import sitemaps
@@ -17,78 +16,35 @@ sitemaps = {
admin.autodiscover()
-urlpatterns = patterns('',
- (r'^packages/flaghelp/$', 'packages.views.flaghelp'),
- (r'^packages/signoffs/$', 'packages.views.signoffs'),
- (r'^packages/signoff_package/(?P<arch>[A-z0-9]+)/(?P<pkgname>[A-z0-9\-+.]+)/$',
- 'packages.views.signoff_package'),
- (r'^packages/update/$', 'packages.views.update'),
-
- # Preference is for the packages/ url below, but search is kept
- # because other projects link to it
- (r'^packages/search/$', 'packages.views.search'),
- (r'^packages/search/(?P<page>\d+)/$', 'packages.views.search'),
- (r'^packages/differences/$', 'packages.views.arch_differences'),
- (r'^packages/$', 'packages.views.search'),
- (r'^packages/(?P<page>\d+)/$', 'packages.views.search'),
-
- (r'^packages/(?P<name>[A-z0-9\-+.]+)/$',
- 'packages.views.details'),
- (r'^packages/(?P<repo>[A-z0-9\-]+)/(?P<name>[A-z0-9\-+.]+)/$',
- 'packages.views.details'),
- (r'^packages/(?P<repo>[A-z0-9\-]+)/(?P<arch>[A-z0-9]+)/(?P<name>[A-z0-9\-+.]+)/$',
- 'packages.views.details'),
- (r'^packages/(?P<repo>[A-z0-9\-]+)/(?P<arch>[A-z0-9]+)/(?P<name>[A-z0-9\-+.]+)/files/$',
- 'packages.views.files'),
- (r'^packages/(?P<repo>[A-z0-9\-]+)/(?P<arch>[A-z0-9]+)/(?P<name>[A-z0-9\-+.]+)/maintainer/$',
- 'packages.views.getmaintainer'),
- (r'^packages/(?P<repo>[A-z0-9\-]+)/(?P<arch>[A-z0-9]+)/(?P<name>[A-z0-9\-+.]+)/flag/$',
- 'packages.views.flag'),
- (r'^packages/(?P<repo>[A-z0-9\-]+)/(?P<arch>[A-z0-9]+)/(?P<name>[A-z0-9\-+.]+)/unflag/$',
- 'packages.views.unflag'),
- (r'^packages/(?P<repo>[A-z0-9\-]+)/(?P<arch>[A-z0-9]+)/(?P<name>[A-z0-9\-+.]+)/download/$',
- 'packages.views.download'),
-
- (r'^groups/$', 'packages.views.groups'),
+urlpatterns = patterns('packages.views',
+ (r'^groups/$', 'groups'),
(r'^groups/(?P<arch>[A-z0-9]+)/(?P<name>[A-z0-9\-+.]+)/$',
- 'packages.views.group_details'),
-
- (r'^todo/(\d+)/$', 'todolists.views.view'),
- (r'^todo/add/$', 'todolists.views.add'),
- (r'^todo/edit/(?P<list_id>\d+)/$', 'todolists.views.edit'),
- (r'^todo/flag/(\d+)/(\d+)/$', 'todolists.views.flag'),
- (r'^todo/delete/(?P<object_id>\d+)/$',
- 'todolists.views.delete_todolist'),
- (r'^todo/$', 'todolists.views.list'),
- (r'^todolists/$', 'todolists.views.public_list'),
-
- (r'^news/add/$', 'news.views.add'),
- (r'^news/preview/$', 'news.views.preview'),
- # old news URLs, permanent redirect view so we don't break all links
- (r'^news/(?P<object_id>\d+)/$', 'news.views.view_redirect'),
- (r'^news/(?P<slug>[-\w]+)/$', 'news.views.view'),
- (r'^news/(?P<slug>[-\w]+)/edit/$', 'news.views.edit'),
- (r'^news/(?P<slug>[-\w]+)/delete/$', 'news.views.delete'),
- (r'^news/$', 'news.views.news_list', {}, 'news-list'),
-
- (r'^mirrors/$', 'mirrors.views.mirrors', {}, 'mirrors-list'),
- (r'^mirrors/status/$', 'mirrors.views.status', {}, 'mirror-status'),
- (r'^mirrors/(?P<name>[\.\-\w]+)/$', 'mirrors.views.mirror_details'),
-
- (r'^mirrorlist/$', 'mirrors.views.generate_mirrorlist', {}, 'mirrorlist'),
- (r'^mirrorlist/all/$', 'mirrors.views.find_mirrors', {'countries': ['all']}),
- (r'^mirrorlist/all/ftp/$', 'mirrors.views.find_mirrors',
- {'countries': ['all'], 'protocols': ['ftp']}),
- (r'^mirrorlist/all/http/$', 'mirrors.views.find_mirrors',
- {'countries': ['all'], 'protocols': ['http']}),
+ 'group_details'),
- (r'^devel/$', 'devel.views.index'),
- (r'^devel/notify/$', 'devel.views.change_notify'),
- (r'^devel/profile/$', 'devel.views.change_profile'),
+ (r'^opensearch/packages/$', 'opensearch', {}, 'opensearch-packages'),
+)
+
+urlpatterns += patterns('todolists.views',
+ (r'^todolists/$', 'public_list'),
+)
- (r'^devel/newuser/$', 'devel.views.new_user_form'),
+urlpatterns += patterns('mirrors.views',
+ (r'^mirrors/status/$', 'status', {}, 'mirror-status'),
+ (r'^mirrors/status/json/$', 'status_json', {}, 'mirror-status-json'),
+
+ (r'^mirrors/$', 'mirrors', {}, 'mirrors-list'),
+ (r'^mirrors/(?P<name>[\.\-\w]+)/$', 'mirror_details'),
+
+ (r'^mirrorlist/$', 'generate_mirrorlist', {}, 'mirrorlist'),
+ (r'^mirrorlist/all/$', 'find_mirrors', {'countries': ['all']}),
+ (r'^mirrorlist/all/ftp/$', 'find_mirrors',
+ {'countries': ['all'], 'protocols': ['ftp']}),
+ (r'^mirrorlist/all/http/$', 'find_mirrors',
+ {'countries': ['all'], 'protocols': ['http']}),
+)
# Feeds and sitemaps
+urlpatterns += patterns('',
(r'^feeds/$', 'public.views.feeds', {}, 'feeds-list'),
(r'^feeds/news/$', NewsFeed()),
(r'^feeds/packages/$', PackageFeed()),
@@ -100,20 +56,23 @@ urlpatterns = patterns('',
{'sitemaps': sitemaps}),
(r'^sitemap-(?P<section>.+)\.xml$', 'django.contrib.sitemaps.views.sitemap',
{'sitemaps': sitemaps}),
+)
# Authentication / Admin
- (r'^login/$', 'django.contrib.auth.views.login', {
+urlpatterns += patterns('django.contrib.auth.views',
+ (r'^login/$', 'login', {
'template_name': 'registration/login.html'}),
- (r'^accounts/login/$', 'django.contrib.auth.views.login', {
+ (r'^accounts/login/$', 'login', {
'template_name': 'registration/login.html'}),
- (r'^logout/$', 'django.contrib.auth.views.logout', {
+ (r'^logout/$', 'logout', {
'template_name': 'registration/logout.html'}),
- (r'^accounts/logout/$', 'django.contrib.auth.views.logout', {
+ (r'^accounts/logout/$', 'logout', {
'template_name': 'registration/logout.html'}),
- (r'^admin/', include(admin.site.urls)),
+)
-# (mostly) Static Pages
- (r'^$', 'public.views.index', {}, 'index'),
+# Public pages
+urlpatterns += patterns('public.views',
+ (r'^$', 'index', {}, 'index'),
(r'^about/$', direct_to_template, {'template': 'public/about.html'}, 'page-about'),
(r'^art/$', direct_to_template, {'template': 'public/art.html'}, 'page-art'),
(r'^svn/$', direct_to_template, {'template': 'public/svn.html'}, 'page-svn'),
@@ -121,12 +80,22 @@ urlpatterns = patterns('',
(r'^fellows/$', 'public.views.userlist', { 'type':'Fellows' }, 'page-fellows'),
(r'^donate/$', 'public.views.donate', {}, 'page-donate'),
(r'^download/$', 'public.views.download', {}, 'page-download'),
- (r'^opensearch/packages/$', 'packages.views.opensearch', {}, 'opensearch-packages'),
+)
-# Some django internals we use
+# Includes and other remaining stuff
+urlpatterns += patterns('',
+ (r'^admin/', include(admin.site.urls)),
(r'^jsi18n/$', 'django.views.i18n.null_javascript_catalog'),
-# Static content
- (r'^media/(.*)$', 'django.views.static.serve', {'document_root': settings.DEPLOY_PATH+'/media'})
+
+ (r'^devel/', include('devel.urls')),
+ (r'^news/', include('news.urls')),
+ (r'^packages/', include('packages.urls')),
+ (r'^todo/', include('todolists.urls')),
)
-
+
+if settings.DEBUG == True:
+ urlpatterns += patterns('',
+ (r'^media/(.*)$', 'django.views.static.serve',
+ {'document_root': settings.DEPLOY_PATH+'/media'}))
+
# vim: set ts=4 sw=4 et: