2 from django.conf.urls import patterns, url
3 from django.contrib.auth.decorators import permission_required, login_required
4 from django.views.generic import RedirectView
5 from catalogue.views import GalleryView, GalleryPackageView
8 urlpatterns = patterns('catalogue.views',
9 #url(r'^$', RedirectView.as_view(url='catalogue/')),
11 url(r'^upcoming/$', 'upcoming', name='catalogue_upcoming'),
12 url(r'^finished/$', 'finished', name='catalogue_finished'),
14 #url(r'^catalogue/$', 'document_list', name='catalogue_document_list'),
15 url(r'^user/$', 'my', name='catalogue_user'),
16 url(r'^user/(?P<username>[^/]+)/$', 'user', name='catalogue_user'),
17 url(r'^users/$', 'users', name='catalogue_users'),
18 url(r'^activity/$', 'activity', name='catalogue_activity'),
19 url(r'^activity/(?P<isodate>\d{4}-\d{2}-\d{2})/$',
20 'activity', name='catalogue_activity'),
23 'upload', name='catalogue_upload'),
25 url(r'^create/(?P<slug>[^/]*)/',
26 'create_missing', name='catalogue_create_missing'),
28 'create_missing', name='catalogue_create_missing'),
29 url(r'^fork/(?P<pk>\d+)/',
30 'fork', name='catalogue_fork'),
32 url(r'^doc/(?P<pk>\d+)/publish$', 'publish', name="catalogue_publish"),
33 url(r'^doc/(?P<pk>\d+)/unpublish$', 'unpublish', name="catalogue_unpublish"),
34 #url(r'^(?P<name>[^/]+)/publish/(?P<version>\d+)$', 'publish', name="catalogue_publish"),
36 url(r'^(?P<pk>[^/]+)/schedule/$', 'book_schedule', name="catalogue_book_schedule"),
37 url(r'^(?P<pk>[^/]+)/owner/$', 'book_owner', name="catalogue_book_owner"),
38 url(r'^(?P<pk>[^/]+)/delete/$', 'book_delete', name="catalogue_book_delete"),
40 url(r'^book/(?P<slug>[^/]+)/$', 'book', name="catalogue_book"),
42 url(r'^(?P<pk>[^/]+)/attachments/$',
43 login_required()(GalleryView.as_view()),
44 name="catalogue_book_gallery"),
45 #~ url(r'^attachments/$',
46 #~ login_required()(GalleryView.as_view()),
47 #~ name="catalogue_attachments"),
48 #~ url(r'^attachments/(?P<pk>\d+)/$',
49 #~ login_required()(GalleryView.as_view()),
50 #~ name="catalogue_attachments"),
51 url(r'^book/(?P<slug>[^/]+)/gallery/package$',
52 permission_required('catalogue.change_book')(GalleryPackageView.as_view()),
53 name="catalogue_book_gallery_package"),
54 url(r'^book/(?P<slug>[^/]+)/xml$', 'book_xml', name="catalogue_book_xml"),
55 #url(r'^book/(?P<slug>[^/]+)/txt$', 'book_txt', name="catalogue_book_txt"),
56 url(r'^(?P<pk>\d+)/$', 'book_html', name="catalogue_html"),
57 url(r'^(?P<pk>\d+)/preview/$', 'book_html', {'preview': True}, name="catalogue_preview"),
58 url(r'^(?P<pk>\d+)/rev(?P<rev_pk>\d+)/preview/$', 'book_html', {'preview': True}, name="catalogue_preview_rev"),
59 url(r'^(?P<pk>\d+)/rev(?P<rev_pk>\d+)/pdf/$', 'book_pdf', name="catalogue_pdf"),
62 #url(r'^book/(?P<slug>[^/]+)/epub$', 'book_epub', name="catalogue_book_epub"),
63 #url(r'^book/(?P<slug>[^/]+)/pdf$', 'book_pdf', name="catalogue_book_pdf"),
65 url(r'^chunk_add/(?P<slug>[^/]+)/(?P<chunk>[^/]+)/$',
66 'chunk_add', name="catalogue_chunk_add"),
67 url(r'^chunk_edit/(?P<slug>[^/]+)/(?P<chunk>[^/]+)/$',
68 'chunk_edit', name="catalogue_chunk_edit"),
69 url(r'^book_append/(?P<slug>[^/]+)/$',
70 'book_append', name="catalogue_book_append"),
71 url(r'^chunk_mass_edit',
72 'chunk_mass_edit', name='catalogue_chunk_mass_edit'),