Add code to support disabling new influences.
[matthijs/projects/xerxes.git] / urls.py
1 from django.conf import settings
2 from django.conf.urls.defaults import *
3 from django.contrib import admin
4 from xerxes.influences.models import Character
5 from xerxes.influences.models import Influence
6 from django.views.generic.simple import direct_to_template
7 import os
8
9 # Automatically import admin.py from all INSTALLED_APPS
10 admin.autodiscover()
11
12 urlpatterns = patterns('',
13     url(r'^$', 'django.views.generic.simple.redirect_to', {'url' : '/influences/'}),
14     (r'^admin/(.*)', admin.site.root),
15     url(r'^comments/', include('threadedcomments.urls')),
16
17     url(r'^influences/$', 'xerxes.influences.views.index', name='influences_index'),
18     url(r'^influences/influence/$', 'xerxes.influences.views.influence_list', name='influences_influence_list'),
19     url(r'^influences/influence/(?P<object_id>\d+)/$', 'xerxes.influences.views.influence_detail', name='influences_influence_detail'),
20     url(r'^influences/influence/(?P<object_id>\d+)/comment/$', 'xerxes.influences.views.influence_comment', name='influences_influence_comment'),
21     url(r'^influences/influence/(?P<object_id>\d+)/comment/(?P<parent_id>\d+)/$', 'xerxes.influences.views.influence_comment', name='influences_influence_comment_parent'),
22     #url(r'^influences/influence/add/(\d+)$',         'django.views.generic.simple.direct_to_template', {'template': 'base/offline.html'}, name='influences_add_influence_for_character'),
23     #url(r'^influences/influence/add/$',         'django.views.generic.simple.direct_to_template', {'template': 'base/offline.html'}, name='influences_add_influence'),
24     url(r'^influences/influence/add/(\d+)/$', 'xerxes.influences.views.add_influence', name='influences_add_influence_for_character'),
25     url(r'^influences/influence/add/$', 'xerxes.influences.views.add_influence', name='influences_add_influence'),
26     
27     url(r'^influences/character/$', 'xerxes.influences.views.character_list', name='influences_character_list'),
28     url(r'^influences/character/(?P<object_id>\d+)/$', 'xerxes.influences.views.character_detail', name='influences_character_detail'),
29     url(r'^influences/character/add/$', 'xerxes.influences.views.add_character', name='influences_add_character'),
30
31     url(r'^accounts/login/$', 'django.contrib.auth.views.login', {'template_name': 'base/login.html'}, name='login'),
32     url(r'^accounts/logout/$', 'django.contrib.auth.views.logout_then_login', name='logout'),
33 )
34
35 if settings.DEBUG:
36     urlpatterns += patterns('',
37         (r'^' + settings.MEDIA_URL[1:] + '(?P<path>.*)$', 'django.views.static.serve',
38         {'document_root': settings.MEDIA_ROOT}),
39     )
40 # vim: set sts=4 sw=4 expandtab: