2 from django.conf.urls.defaults import *
3 from django.views.generic.simple import redirect_to
4 from django.views.generic.list_detail import object_detail
5 from django.conf import settings
6 from wiki.models import Book
9 #PART = ur"""[ ĄĆĘŁŃÓŚŻŹąćęłńóśżź0-9\w_.-]+"""
11 urlpatterns = patterns('wiki.views',
12 url(r'^$', redirect_to, {'url': 'catalogue/'}),
14 url(r'^catalogue/$', 'document_list', name='wiki_document_list'),
15 #url(r'^catalogue/([^/]+)/$', 'document_list'),
16 #url(r'^catalogue/([^/]+)/([^/]+)/$', 'document_list'),
17 #url(r'^catalogue/([^/]+)/([^/]+)/([^/]+)$', 'document_list'),
19 url(r'^edit/(?P<slug>[^/]+)/(?:(?P<chunk>[^/]+)/)?$',
20 'editor', name="wiki_editor"),
22 url(r'^readonly/(?P<slug>[^/]+)/(?:(?P<chunk>[^/]+)/)?$',
23 'editor_readonly', name="wiki_editor_readonly"),
26 'upload', name='wiki_upload'),
28 url(r'^create/(?P<slug>[^/]*)/',
29 'create_missing', name='wiki_create_missing'),
31 url(r'^gallery/(?P<directory>[^/]+)/$',
32 'gallery', name="wiki_gallery"),
34 url(r'^history/(?P<slug>[^/]+)/(?:(?P<chunk>[^/]+)/)?$',
35 'history', name="wiki_history"),
37 url(r'^rev/(?P<slug>[^/]+)/(?:(?P<chunk>[^/]+)/)?$',
38 'revision', name="wiki_revision"),
40 url(r'^text/(?P<slug>[^/]+)/(?:(?P<chunk>[^/]+)/)?$',
41 'text', name="wiki_text"),
43 url(r'^revert/(?P<slug>[^/]+)/(?:(?P<chunk>[^/]+)/)?$',
44 'revert', name='wiki_revert'),
46 url(r'^book/(?P<slug>[^/]+)/publish$', 'publish', name="wiki_publish"),
47 #url(r'^(?P<name>[^/]+)/publish/(?P<version>\d+)$', 'publish', name="wiki_publish"),
49 url(r'^diff/(?P<slug>[^/]+)/(?:(?P<chunk>[^/]+)/)?$', 'diff', name="wiki_diff"),
50 url(r'^tag/(?P<slug>[^/]+)/(?:(?P<chunk>[^/]+)/)?$', 'add_tag', name="wiki_add_tag"),
51 url(r'^pubmark/(?P<slug>[^/]+)/(?:(?P<chunk>[^/]+)/)?$', 'pubmark', name="wiki_pubmark"),
53 url(r'^book/(?P<slug>[^/]+)/$', 'book', name="wiki_book"),
54 url(r'^book/(?P<slug>[^/]+)/xml$', 'book_xml', name="wiki_book_xml"),
55 url(r'^book/(?P<slug>[^/]+)/txt$', 'book_txt', name="wiki_book_txt"),
56 url(r'^book/(?P<slug>[^/]+)/html$', 'book_html', name="wiki_book_html"),
57 #url(r'^book/(?P<slug>[^/]+)/epub$', 'book_epub', name="wiki_book_epub"),
58 #url(r'^book/(?P<slug>[^/]+)/pdf$', 'book_pdf', name="wiki_book_pdf"),
59 url(r'^chunk_add/(?P<slug>[^/]+)/(?P<chunk>[^/]+)/$',
60 'chunk_add', name="wiki_chunk_add"),
61 url(r'^chunk_edit/(?P<slug>[^/]+)/(?P<chunk>[^/]+)/$',
62 'chunk_edit', name="wiki_chunk_edit"),
63 url(r'^book_append/(?P<slug>[^/]+)/$',
64 'book_append', name="wiki_book_append"),
65 url(r'^book_edit/(?P<slug>[^/]+)/$',
66 'book_edit', name="wiki_book_edit"),