4020592d2c1cdc2f02060278570d60cb9a307b70
[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 urlpatterns = patterns('picture.views',
11                        # pictures - currently pictures are coupled with catalogue, hence the url is here
12         url(r'^obraz/?$', 'picture_list'),
13         url(r'^obraz/(?P<picture>%s)/?$' % Picture.URLID_RE, 'picture_detail')
14         ) + \
15     patterns('catalogue.views',
16     url(r'^$', 'catalogue', name='catalogue'),
17     url(r'^polki/(?P<shelf>[a-zA-Z0-9-]+)/formaty/$', 'shelf_book_formats', name='shelf_book_formats'),
18     url(r'^polki/(?P<shelf>[a-zA-Z0-9-]+)/(?P<book>%s)/usun$' % Book.URLID_RE, 'remove_from_shelf', name='remove_from_shelf'),
19     url(r'^polki/$', 'user_shelves', name='user_shelves'),
20     url(r'^polki/(?P<slug>[a-zA-Z0-9-]+)/usun/$', 'delete_shelf', name='delete_shelf'),
21     url(r'^polki/(?P<slug>[a-zA-Z0-9-]+)\.zip$', 'download_shelf', name='download_shelf'),
22     url(r'^lektury/', 'book_list', name='book_list'),
23     url(r'^audiobooki/$', 'audiobook_list', name='audiobook_list'),
24     url(r'^daisy/$', 'daisy_list', name='daisy_list'),
25     url(r'^lektura/(?P<book>%s)/polki/' % Book.URLID_RE, 'book_sets', name='book_shelves'),
26     url(r'^polki/nowa/$', 'new_set', name='new_set'),
27     url(r'^tags/$', 'tags_starting_with', name='hint'),
28     url(r'^jtags/$', 'json_tags_starting_with', name='jhint'),
29     url(r'^szukaj/$', 'search', name='old_search'),
30
31     # zip
32     url(r'^zip/pdf\.zip$', 'download_zip', {'format': 'pdf', 'slug': None}, 'download_zip_pdf'),
33     url(r'^zip/epub\.zip$', 'download_zip', {'format': 'epub', 'slug': None}, 'download_zip_epub'),
34     url(r'^zip/mobi\.zip$', 'download_zip', {'format': 'mobi', 'slug': None}, 'download_zip_mobi'),
35     url(r'^zip/mp3/(?P<book>%s)\.zip' % Book.FILEID_RE, 'download_zip', {'format': 'mp3'}, 'download_zip_mp3'),
36     url(r'^zip/ogg/(?P<book>%s)\.zip' % Book.FILEID_RE, 'download_zip', {'format': 'ogg'}, 'download_zip_ogg'),
37
38     # Public interface. Do not change this URLs.
39     url(r'^lektura/(?P<book>%s)\.html$' % Book.FILEID_RE, 'book_text', name='book_text'),
40     url(r'^lektura/(?P<book>%s)/audiobook/$' % Book.URLID_RE, 'player', name='book_player'),
41     url(r'^lektura/(?P<book>%s)/$' % Book.URLID_RE, 'book_detail', name='book_detail'),
42     url(r'^lektura/(?P<book>%s)/motyw/(?P<theme_slug>[a-zA-Z0-9-]+)/$' % Book.URLID_RE,
43         'book_fragments', name='book_fragments'),
44
45     url(r'^(?P<tags>[a-zA-Z0-9-/]*)/$', 'tagged_object_list', name='tagged_object_list'),
46
47     url(r'^audiobooki/(?P<type>mp3|ogg|daisy|all).xml$', AudiobookFeed(), name='audiobook_feed'),
48
49     url(r'^custompdf/(?P<book_fileid>%s).pdf' % Book.FILEID_RE, 'download_custom_pdf'),
50
51