8a9945ab2e1d2670d333ae4b5307e82f91d8525a
[redakcja.git] / apps / catalogue / urls.py
1 # -*- coding: utf-8
2 from django.conf.urls import patterns, url
3 from django.contrib.auth.decorators import permission_required, login_required
4 from catalogue.views import GalleryView, GalleryPackageView
5
6
7 urlpatterns = patterns(
8     'catalogue.views',
9     # url(r'^$', RedirectView.as_view(url='catalogue/')),
10
11     url(r'^upcoming/$', 'upcoming', name='catalogue_upcoming'),
12     url(r'^finished/$', 'finished', name='catalogue_finished'),
13
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'),
21
22     # url(r'^upload/$', 'upload', name='catalogue_upload'),
23
24     url(r'^create/(?P<slug>[^/]*)/',
25         'create_missing', name='catalogue_create_missing'),
26     url(r'^create/',
27         'create_missing', name='catalogue_create_missing'),
28     url(r'^fork/(?P<pk>\d+)/',
29         'fork', name='catalogue_fork'),
30
31     url(r'^doc/(?P<pk>\d+)/publish$', 'publish', name="catalogue_publish"),
32     url(r'^doc/(?P<pk>\d+)/unpublish$', 'unpublish', name="catalogue_unpublish"),
33     # url(r'^(?P<name>[^/]+)/publish/(?P<version>\d+)$', 'publish', name="catalogue_publish"),
34
35     url(r'^(?P<pk>[^/]+)/schedule/$', 'book_schedule', name="catalogue_book_schedule"),
36     url(r'^(?P<pk>[^/]+)/owner/$', 'book_owner', name="catalogue_book_owner"),
37     url(r'^(?P<pk>[^/]+)/delete/$', 'book_delete', name="catalogue_book_delete"),
38
39     # url(r'^book/(?P<slug>[^/]+)/$', 'book', name="catalogue_book"),
40
41     url(r'^(?P<pk>[^/]+)/attachments/$',
42         login_required()(GalleryView.as_view()),
43         name="catalogue_book_gallery"),
44     # url(r'^attachments/$',
45     #     login_required()(GalleryView.as_view()),
46     #     name="catalogue_attachments"),
47     # url(r'^attachments/(?P<pk>\d+)/$',
48     #     login_required()(GalleryView.as_view()),
49     #     name="catalogue_attachments"),
50     url(r'^book/(?P<slug>[^/]+)/gallery/package$',
51         permission_required('catalogue.change_book')(GalleryPackageView.as_view()),
52         name="catalogue_book_gallery_package"),
53     # url(r'^book/(?P<slug>[^/]+)/xml$', 'book_xml', name="catalogue_book_xml"),
54     # url(r'^book/(?P<slug>[^/]+)/txt$', 'book_txt', name="catalogue_book_txt"),
55     url(r'^(?P<pk>\d+)/$', 'book_html', name="catalogue_html"),
56     url(r'^(?P<pk>\d+)/preview/$', 'book_html', {'preview': True}, name="catalogue_preview"),
57     url(r'^(?P<pk>\d+)/rev(?P<rev_pk>\d+)/preview/$', 'book_html', {'preview': True}, name="catalogue_preview_rev"),
58     url(r'^(?P<pk>\d+)/rev(?P<rev_pk>\d+)/pdf/$', 'book_pdf', name="catalogue_pdf"),
59     url(r'^(?P<pk>\d+)/rev(?P<rev_pk>\d+)/epub/$', 'book_epub', name="catalogue_epub"),
60
61     # url(r'^book/(?P<slug>[^/]+)/epub$', 'book_epub', name="catalogue_book_epub"),
62     # url(r'^book/(?P<slug>[^/]+)/pdf$', 'book_pdf', name="catalogue_book_pdf"),
63
64     # url(r'^chunk_add/(?P<slug>[^/]+)/(?P<chunk>[^/]+)/$',
65     #     'chunk_add', name="catalogue_chunk_add"),
66     # url(r'^chunk_edit/(?P<slug>[^/]+)/(?P<chunk>[^/]+)/$',
67     #     'chunk_edit', name="catalogue_chunk_edit"),
68     # url(r'^book_append/(?P<slug>[^/]+)/$',
69     #     'book_append', name="catalogue_book_append"),
70     # url(r'^chunk_mass_edit',
71     #     'chunk_mass_edit', name='catalogue_chunk_mass_edit'),
72 )