Merge branch 'pretty' of github.com:fnp/wolnelektury into pretty
[wolnelektury.git] / apps / catalogue / urls.py
1 # -*- coding: utf-8 -*-
2 # This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later.
3 # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
4 #
5 from django.conf.urls.defaults import *
6 from catalogue.feeds import AudiobookFeed
7 from catalogue.models import Book
8 from picture.models import Picture
9
10
11 SLUG = r'[a-z0-9-]*'
12
13 urlpatterns = patterns('picture.views',
14                        # pictures - currently pictures are coupled with catalogue, hence the url is here
15         url(r'^obraz/?$', 'picture_list'),
16         url(r'^obraz/(?P<picture>%s)/?$' % SLUG, 'picture_detail')
17         ) + \
18     patterns('catalogue.views',
19     url(r'^$', 'catalogue', name='catalogue'),
20     url(r'^polki/(?P<shelf>[a-zA-Z0-9-]+)/formaty/$', 'shelf_book_formats', name='shelf_book_formats'),
21     url(r'^polki/(?P<shelf>[a-zA-Z0-9-]+)/(?P<slug>%s)/usun$' % SLUG, 'remove_from_shelf', name='remove_from_shelf'),
22     url(r'^polki/$', 'user_shelves', name='user_shelves'),
23     url(r'^polki/(?P<slug>[a-zA-Z0-9-]+)/usun/$', 'delete_shelf', name='delete_shelf'),
24     url(r'^polki/(?P<slug>[a-zA-Z0-9-]+)\.zip$', 'download_shelf', name='download_shelf'),
25     url(r'^lektury/', 'book_list', name='book_list'),
26     url(r'^audiobooki/$', 'audiobook_list', name='audiobook_list'),
27     url(r'^daisy/$', 'daisy_list', name='daisy_list'),
28     url(r'^lektura/(?P<book>%s)/polki/' % SLUG, 'book_sets', name='book_shelves'),
29     url(r'^polki/nowa/$', 'new_set', name='new_set'),
30     url(r'^tags/$', 'tags_starting_with', name='hint'),
31     url(r'^jtags/$', 'json_tags_starting_with', name='jhint'),
32     url(r'^szukaj/$', 'search', name='old_search'),
33
34     # zip
35     url(r'^zip/pdf\.zip$', 'download_zip', {'format': 'pdf', 'slug': None}, 'download_zip_pdf'),
36     url(r'^zip/epub\.zip$', 'download_zip', {'format': 'epub', 'slug': None}, 'download_zip_epub'),
37     url(r'^zip/mobi\.zip$', 'download_zip', {'format': 'mobi', 'slug': None}, 'download_zip_mobi'),
38     url(r'^zip/mp3/(?P<slug>%s)\.zip' % SLUG, 'download_zip', {'format': 'mp3'}, 'download_zip_mp3'),
39     url(r'^zip/ogg/(?P<slug>%s)\.zip' % SLUG, 'download_zip', {'format': 'ogg'}, 'download_zip_ogg'),
40
41     # Public interface. Do not change this URLs.
42     url(r'^lektura/(?P<slug>%s)\.html$' % SLUG, 'book_text', name='book_text'),
43     url(r'^lektura/(?P<slug>%s)/audiobook/$' % SLUG, 'player', name='book_player'),
44     url(r'^lektura/(?P<slug>%s)/$' % SLUG, 'book_detail', name='book_detail'),
45     url(r'^lektura/(?P<slug>%s)/motyw/(?P<theme_slug>[a-zA-Z0-9-]+)/$' % SLUG,
46         'book_fragments', name='book_fragments'),
47
48     url(r'^(?P<tags>[a-zA-Z0-9-/]*)/$', 'tagged_object_list', name='tagged_object_list'),
49
50     url(r'^audiobooki/(?P<type>mp3|ogg|daisy|all).xml$', AudiobookFeed(), name='audiobook_feed'),
51
52     url(r'^custompdf/(?P<slug>%s).pdf' % SLUG, 'download_custom_pdf'),
53
54