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.feeds import PublishTrackFeed
6 from catalogue.views import GalleryView, GalleryPackageView
9 urlpatterns = patterns(
11 url(r'^$', RedirectView.as_view(url='catalogue/')),
13 url(r'^catalogue/$', 'document_list', name='catalogue_document_list'),
14 url(r'^user/$', 'my', name='catalogue_user'),
15 url(r'^user/(?P<username>[^/]+)/$', 'user', name='catalogue_user'),
16 url(r'^users/$', 'users', name='catalogue_users'),
17 url(r'^activity/$', 'activity', name='catalogue_activity'),
18 url(r'^activity/(?P<isodate>\d{4}-\d{2}-\d{2})/$',
19 'activity', name='catalogue_activity'),
22 'upload', name='catalogue_upload'),
24 url(r'^create/(?P<slug>[^/]*)/',
25 'create_missing', name='catalogue_create_missing'),
27 'create_missing', name='catalogue_create_missing'),
29 url(r'^book/(?P<slug>[^/]+)/publish$', 'publish', name="catalogue_publish"),
30 # url(r'^(?P<name>[^/]+)/publish/(?P<version>\d+)$', 'publish', name="catalogue_publish"),
32 url(r'^book/(?P<slug>[^/]+)/$', 'book', name="catalogue_book"),
33 url(r'^book/(?P<slug>[^/]+)/gallery/$', login_required()(GalleryView.as_view()), name="catalogue_book_gallery"),
34 url(r'^book/(?P<slug>[^/]+)/gallery/package$',
35 permission_required('catalogue.change_book')(GalleryPackageView.as_view()),
36 name="catalogue_book_gallery_package"),
37 url(r'^book/(?P<slug>[^/]+)/xml$', 'book_xml', name="catalogue_book_xml"),
38 # url(r'^book/(?P<slug>[^/]+)/txt$', 'book_txt', name="catalogue_book_txt"),
39 # url(r'^book/(?P<slug>[^/]+)/html$', 'book_html', name="catalogue_book_html"),
40 # url(r'^book/(?P<slug>[^/]+)/epub$', 'book_epub', name="catalogue_book_epub"),
41 # url(r'^book/(?P<slug>[^/]+)/pdf$', 'book_pdf', name="catalogue_book_pdf"),
43 url(r'^chunk_add/(?P<slug>[^/]+)/(?P<chunk>[^/]+)/$',
44 'chunk_add', name="catalogue_chunk_add"),
45 url(r'^chunk_edit/(?P<slug>[^/]+)/(?P<chunk>[^/]+)/$',
46 'chunk_edit', name="catalogue_chunk_edit"),
47 url(r'^book_append/(?P<slug>[^/]+)/$',
48 'book_append', name="catalogue_book_append"),
49 url(r'^chunk_mass_edit',
50 'chunk_mass_edit', name='catalogue_chunk_mass_edit'),
52 url(r'^track/(?P<slug>[^/]*)/$', PublishTrackFeed()),
54 url(r'^cybernauci/$', 'lessons_for_cybernauts'),