1 # -*- coding: utf-8 -*-
3 from django.conf.urls.defaults import *
4 from django.contrib import admin
5 from django.conf import settings
8 PATH_SEC = r"(?P<path>[^/]+)"
9 PATH_END = PATH_SEC + "/$"
11 urlpatterns = patterns('',
13 # url(r'^$', 'explorer.views.file_list', name='file_list'),
14 # url(r'^file/upload', 'explorer.views.file_upload', name='file_upload'),
16 # url(r'^management/pull-requests$', 'explorer.views.pull_requests'),
19 # url(r'^editor/'+PATH_END, 'explorer.views.display_editor', name='editor_view'),
20 # url(r'^editor/$', 'explorer.views.file_list', name='editor_base'),
22 # url(r'^file/(?P<docid>[^/]+)/print$', 'explorer.views.print_html', name="file_print"),
24 url(r'^$', 'wiki.views.document_list', {'template_name': 'explorer/file_list.html'}),
27 (r'^admin/filebrowser/', include('filebrowser.urls')),
28 url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
29 url(r'^admin/(.*)', admin.site.root),
32 # url(r'themes/', include('bookthemes.urls')),
34 # Our über-restful api
35 # url(r'^api/', include('api.urls')),
37 url(r'^gallery/(?P<directory>[^/]+)$', 'wiki.views.document_gallery'),
39 # Static files (should be served by Apache)
40 url(r'^%s(?P<path>.+)$' % settings.MEDIA_URL[1:], 'django.views.static.serve',
41 {'document_root': settings.MEDIA_ROOT, 'show_indexes': True}),
42 url(r'^%s(?P<path>.+)$' % settings.STATIC_URL[1:], 'django.views.static.serve',
43 {'document_root': settings.STATIC_ROOT, 'show_indexes': True}),
45 url(r'^(?P<name>(.*))$', 'wiki.views.document_detail'),
49 if 'cas_consumer' in settings.INSTALLED_APPS:
50 urlpatterns += patterns('',
52 url(r'^accounts/login/$', 'cas_consumer.views.login', name='login'),
53 url(r'^accounts/logout/$', 'cas_consumer.views.logout', name='logout'),
56 urlpatterns += patterns('',
58 url(r'^accounts/login/$', 'django.contrib.auth.views.login', {'redirect_field_name': 'next'}, name='login'),
59 url(r'^accounts/logout/$', 'django.contrib.auth.views.logout', {'next_page': '/'}, name='logout'),