insert_tag - inserts only end tag, when no text selected - fixed.
[redakcja.git] / project / urls.py
1 from django.conf.urls.defaults import *
2 from django.contrib import admin
3 from django.conf import settings
4
5 admin.autodiscover()
6 PATH_SEC = r"(?P<path>[^/]+)"
7 PATH_END = PATH_SEC + "/$"
8
9 urlpatterns = patterns('',
10     # Explorer:
11     url(r'^$', 'explorer.views.file_list', name='file_list'),
12     
13     url(r'^file/'+PATH_SEC+'/text/$', 'explorer.views.file_xml', name='file_xml'),
14     url(r'^file/'+PATH_SEC+'/dc/$', 'explorer.views.file_dc', name='file_dc'),
15     url(r'^file/upload', 'explorer.views.file_upload', name='file_upload'),
16     url(r'^file/'+PATH_SEC+'/commit$', 'explorer.views.file_commit', name='file_commit'),
17     url(r'^file/'+PATH_SEC+'/update$', 'explorer.views.file_update_local', name='file_update'),
18
19     url(r'^images/(?P<folder>[^/]+)/$', 'explorer.views.folder_images', name='folder_image'),
20     url(r'^images/$', 'explorer.views.folder_images', {'folder': '.'}, name='folder_image_ajax'),
21     
22     # Editor panels
23     url(r'^editor/'+PATH_SEC+'/panel/(?P<name>[a-z]+)/$', 'explorer.views.panel_view', name='panel_view'),
24     url(r'^editor/'+PATH_END, 'explorer.views.display_editor', name='editor_view'),
25     url(r'^editor/$', 'explorer.views.file_list', name='editor_base'),
26
27     url(r'^editor/'+PATH_SEC+'/split$', 'explorer.views.split_text'),
28     url(r'^editor/'+PATH_SEC+'/split-success',
29         'explorer.views.split_success', name='split-success'),
30
31     url(r'^editor/'+PATH_SEC+'/print/html$', 'explorer.views.print_html'),
32     url(r'^editor/'+PATH_SEC+'/print/xml$', 'explorer.views.print_xml'),
33     
34     # Task managment
35     # url(r'^manager/pull-requests$', 'explorer.views.pull_requests'),
36
37     # Admin panel
38     url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
39     url(r'^admin/(.*)', admin.site.root),
40
41     # Authorization
42     url(r'^accounts/login/$', 'django.contrib.auth.views.login', {'redirect_field_name': 'next'}),
43     url(r'^accounts/logout/$', 'django.contrib.auth.views.logout', {'next_page': '/'}),
44
45     # Our uber-restful api
46     url(r'^api/', include('api.urls') ),
47 )
48
49
50 # Static files
51 if settings.DEBUG and not hasattr(settings, 'DONT_SERVE_STATIC'):
52     urlpatterns += patterns('',
53         url(r'^%s(?P<path>.+)$' % settings.MEDIA_URL[1:], 'django.views.static.serve',
54             {'document_root': settings.MEDIA_ROOT, 'show_indexes': True}),
55         url(r'^%s(?P<path>.+)$' % settings.STATIC_URL[1:], 'django.views.static.serve',
56             {'document_root': settings.STATIC_ROOT, 'show_indexes': True}),
57     )