summaryrefslogtreecommitdiff
path: root/urls.py
blob: 5ba6ff7477c14072b02016b08dbd96b91fb72a57 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
from django.conf.urls.defaults import *
from django.conf import settings
from django.views.decorators.cache import cache_page
from django.views.generic.create_update import delete_object
from django.contrib.auth.decorators import permission_required
from archweb_dev.main.models import News, Todolist

urlpatterns = patterns('',
# Dynamic Stuff
    (r'^packages/unflag/(\d+)/$',        'archweb_dev.packages.views.unflag'),
    (r'^packages/files/(\d+)/$',         'archweb_dev.packages.views.files'),
    (r'^packages/search/$',              'archweb_dev.packages.views.search'),
    (r'^packages/search/([A-z0-9]+)/$',  'archweb_dev.packages.views.search'),
    (r'^packages/update/$',              'archweb_dev.packages.views.update'),
    (r'^packages/(?P<pkgid>\d+)/$',      'archweb_dev.packages.views.details'),
    (r'^packages/(?P<name>[A-z0-9]+)/$', 'archweb_dev.packages.views.details'),
    (r'^packages/(?P<repo>[A-z0-9]+)/(?P<name>[A-z0-9]+)/$',
        'archweb_dev.packages.views.details'),
    (r'^packages/(?P<repo>[A-z0-9]+)/(?P<arch>[A-z0-9]+)/(?P<name>[A-z0-9-]+)/$',
        'archweb_dev.packages.views.details'),
    (r'^packages/$',                     'archweb_dev.packages.views.search'),

    (r'^todo/(\d+)/$',              'archweb_dev.todolists.views.view'),
    (r'^todo/add/$',                'archweb_dev.todolists.views.add'),
    (r'^todo/edit/(?P<list_id>\d+)/$',  'archweb_dev.todolists.views.edit'),
    (r'^todo/flag/(\d+)/(\d+)/$',   'archweb_dev.todolists.views.flag'),
    (r'^todo/delete/(?P<object_id>\d+)/$', permission_required(
        'main.delete_todolist')(delete_object), {
            'model': Todolist,
            'template_name': 'todolists/todolist_confirm_delete.html',
            'post_delete_redirect': '/todo/'
        }),
    (r'^todo/$',                    'archweb_dev.todolists.views.list'),

    (r'^news/(\d+)/$',         'archweb_dev.news.views.view'),
    (r'^news/add/$',           'archweb_dev.news.views.add'),
    (r'^news/edit/(\d+)/$',    'archweb_dev.news.views.edit'),
    (r'^news/delete/(\d+)/$',  'archweb_dev.news.views.delete'),
    (r'^news/$',               'archweb_dev.news.views.list'),

    (r'^devel/$',          'archweb_dev.devel.views.index'),
    (r'^devel/notify/$',   'archweb_dev.devel.views.change_notify'),
    (r'^devel/profile/$',  'archweb_dev.devel.views.change_profile'),

    (r'^wiki/([A-Z]+[A-z0-9 :/-]+)/$',      'archweb_dev.wiki.views.page'),
    (r'^wiki/edit/([A-Z]+[A-z0-9 :/-]+)/$', 'archweb_dev.wiki.views.edit'),
    (r'^wiki/delete/$',                     'archweb_dev.wiki.views.delete'),
    (r'^wiki/index/$',                      'archweb_dev.wiki.views.index'),
    (r'^wiki/$',                            'archweb_dev.wiki.views.main'),

# (mostly) Static Pages
    (r'^$',                'archweb_dev.devel.views.siteindex'),
    (r'^about/$',          'archweb_dev.devel.views.about'),
    (r'^art/$',            'archweb_dev.devel.views.art'),
    (r'^cvs/$',            'archweb_dev.devel.views.cvs'),
    (r'^developers/$',     'archweb_dev.devel.views.developers'),
    (r'^fellows/$',        'archweb_dev.devel.views.fellows'),
    (r'^donate/$',         'archweb_dev.devel.views.donate'),
    (r'^download/$',       'archweb_dev.devel.views.download'),
    (r'^irc/$',            'archweb_dev.devel.views.irc'),
    (r'^moreforums/$',     'archweb_dev.devel.views.moreforums'),
    (r'^press/$',          'archweb_dev.devel.views.press'),
    (r'^projects/$',       'archweb_dev.devel.views.projects'),
    (r'^robots.txt$',      'archweb_dev.devel.views.robots'),

# Authentication / Admin
    (r'^denied/$',          'archweb_dev.devel.views.denied'),
    (r'^login/$',           'django.contrib.auth.views.login',  {'template_name': 'registration/login.html'}),
    (r'^accounts/login/$',  'django.contrib.auth.views.login',  {'template_name': 'registration/login.html'}),
    (r'^logout/$',          'django.contrib.auth.views.logout', {'template_name': 'registration/logout.html'}),
    (r'^accounts/logout/$', 'django.contrib.auth.views.logout', {'template_name': 'registration/logout.html'}),
    (r'^admin/',             include('django.contrib.admin.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: