quick fix
[wolnelektury.git] / src / catalogue / urls.py
index 0b33ce9..addb0cb 100644 (file)
@@ -12,7 +12,10 @@ from catalogue.models import Book
 
 SLUG = r'[a-z0-9-]*'
 
 
 SLUG = r'[a-z0-9-]*'
 
-urlpatterns = patterns('picture.views',
+urlpatterns = patterns(
+    'picture.views',
+
+    url(r'^obraz/strona/$', 'picture_page', name='picture_page'),
     # pictures - currently pictures are coupled with catalogue, hence the url is here
     url(r'^obraz/$', 'picture_list_thumb', name='picture_list_thumb'),
     url(r'^obraz/(?P<slug>%s).html$' % SLUG, 'picture_viewer', name='picture_viewer'),
     # pictures - currently pictures are coupled with catalogue, hence the url is here
     url(r'^obraz/$', 'picture_list_thumb', name='picture_list_thumb'),
     url(r'^obraz/(?P<slug>%s).html$' % SLUG, 'picture_viewer', name='picture_viewer'),
@@ -23,13 +26,15 @@ urlpatterns = patterns('picture.views',
     url(r'^pa/(?P<pk>\d+)/short\.(?P<lang>.+)\.html', 'picturearea_short', name='picture_area_short'),
 )
 
     url(r'^pa/(?P<pk>\d+)/short\.(?P<lang>.+)\.html', 'picturearea_short', name='picture_area_short'),
 )
 
-urlpatterns += patterns('',
+urlpatterns += patterns(
+    '',
     # old search page - redirected
     url(r'^szukaj/$', RedirectView.as_view(
             url='/szukaj/', query_string=True, permanent=True)),
 )
 
     # old search page - redirected
     url(r'^szukaj/$', RedirectView.as_view(
             url='/szukaj/', query_string=True, permanent=True)),
 )
 
-urlpatterns += patterns('catalogue.views',
+urlpatterns += patterns(
+    'catalogue.views',
     url(r'^$', 'catalogue', name='catalogue'),
 
     url(r'^autor/$', 'tag_catalogue', {'category': 'author'}, name='author_catalogue'),
     url(r'^$', 'catalogue', name='catalogue'),
 
     url(r'^autor/$', 'tag_catalogue', {'category': 'author'}, name='author_catalogue'),
@@ -38,24 +43,22 @@ urlpatterns += patterns('catalogue.views',
     url(r'^rodzaj/$', 'tag_catalogue', {'category': 'kind'}, name='kind_catalogue'),
     url(r'^motyw/$', 'tag_catalogue', {'category': 'theme'}, name='theme_catalogue'),
 
     url(r'^rodzaj/$', 'tag_catalogue', {'category': 'kind'}, name='kind_catalogue'),
     url(r'^motyw/$', 'tag_catalogue', {'category': 'theme'}, name='theme_catalogue'),
 
-    url(r'^galeria/$', 'tagged_object_list', {'gallery': True}, name='gallery'),
+    url(r'^galeria/$', 'gallery', name='gallery'),
     url(r'^kolekcje/$', 'collections', name='catalogue_collections'),
 
     url(r'^kolekcje/$', 'collections', name='catalogue_collections'),
 
-    url(r'^lektury/$', 'tagged_object_list', name='book_list'),
+    url(r'^lektury/$', 'literature', name='book_list'),
     url(r'^lektury/(?P<slug>[a-zA-Z0-9-]+)/$', 'collection', name='collection'),
     url(r'^lektury/(?P<slug>[a-zA-Z0-9-]+)/$', 'collection', name='collection'),
-    url(r'^audiobooki/$', 'audiobook_list', name='audiobook_list'),
+    url(r'^audiobooki/$', 'audiobooks', name='audiobook_list'),
     url(r'^daisy/$', 'daisy_list', name='daisy_list'),
     url(r'^daisy/$', 'daisy_list', name='daisy_list'),
-    url(r'^tags/$', 'tags_starting_with', name='hint'),
-    url(r'^jtags/?$', 'json_tags_starting_with', name='jhint'),
     url(r'^nowe/$', ListView.as_view(
         queryset=Book.objects.filter(parent=None).order_by('-created_at'),
         template_name='catalogue/recent_list.html'), name='recent_list'),
     url(r'^nowe/audiobooki/$', ListView.as_view(
         queryset=Book.objects.filter(media__type='ogg').annotate(m=Max('media__uploaded_at')).order_by('-m'),
     url(r'^nowe/$', ListView.as_view(
         queryset=Book.objects.filter(parent=None).order_by('-created_at'),
         template_name='catalogue/recent_list.html'), name='recent_list'),
     url(r'^nowe/audiobooki/$', ListView.as_view(
         queryset=Book.objects.filter(media__type='ogg').annotate(m=Max('media__uploaded_at')).order_by('-m'),
-            template_name='catalogue/recent_audiobooks_list.html'), name='recent_audiobooks_list'),
+        template_name='catalogue/recent_audiobooks_list.html'), name='recent_audiobooks_list'),
     url(r'^nowe/daisy/$', ListView.as_view(
         queryset=Book.objects.filter(media__type='daisy').annotate(m=Max('media__uploaded_at')).order_by('-m'),
     url(r'^nowe/daisy/$', ListView.as_view(
         queryset=Book.objects.filter(media__type='daisy').annotate(m=Max('media__uploaded_at')).order_by('-m'),
-            template_name='catalogue/recent_daisy_list.html'), name='recent_daisy_list'),
+        template_name='catalogue/recent_daisy_list.html'), name='recent_daisy_list'),
 
     url(r'^custompdf/(?P<slug>%s)/$' % SLUG, CustomPDFFormView(), name='custom_pdf_form'),
 
 
     url(r'^custompdf/(?P<slug>%s)/$' % SLUG, CustomPDFFormView(), name='custom_pdf_form'),
 
@@ -76,9 +79,13 @@ urlpatterns += patterns('catalogue.views',
     url(r'^lektura/(?P<slug>%s)/motyw/(?P<theme_slug>[a-zA-Z0-9-]+)/$' % SLUG,
         'book_fragments', name='book_fragments'),
 
     url(r'^lektura/(?P<slug>%s)/motyw/(?P<theme_slug>[a-zA-Z0-9-]+)/$' % SLUG,
         'book_fragments', name='book_fragments'),
 
+    url(r'^okladka-ridero/(?P<slug>%s).png$' % SLUG, 'ridero_cover'),
+    url(r'^isbn/(?P<book_format>(pdf|epub|mobi|txt|html))/(?P<slug>%s)/' % SLUG, 'get_isbn'),
+
     # Includes.
     url(r'^b/(?P<pk>\d+)/mini\.(?P<lang>.+)\.html', 'book_mini', name='catalogue_book_mini'),
     # Includes.
     url(r'^b/(?P<pk>\d+)/mini\.(?P<lang>.+)\.html', 'book_mini', name='catalogue_book_mini'),
-    url(r'^b/(?P<pk>\d+)/mini_nolink\.(?P<lang>.+)\.html', 'book_mini', {'with_link': False}, name='catalogue_book_mini_nolink'),
+    url(r'^b/(?P<pk>\d+)/mini_nolink\.(?P<lang>.+)\.html', 'book_mini', {'with_link': False},
+        name='catalogue_book_mini_nolink'),
     url(r'^b/(?P<pk>\d+)/short\.(?P<lang>.+)\.html', 'book_short', name='catalogue_book_short'),
     url(r'^b/(?P<pk>\d+)/wide\.(?P<lang>.+)\.html', 'book_wide', name='catalogue_book_wide'),
     url(r'^f/(?P<pk>\d+)/promo\.(?P<lang>.+)\.html', 'fragment_promo', name='catalogue_fragment_promo'),
     url(r'^b/(?P<pk>\d+)/short\.(?P<lang>.+)\.html', 'book_short', name='catalogue_book_short'),
     url(r'^b/(?P<pk>\d+)/wide\.(?P<lang>.+)\.html', 'book_wide', name='catalogue_book_wide'),
     url(r'^f/(?P<pk>\d+)/promo\.(?P<lang>.+)\.html', 'fragment_promo', name='catalogue_fragment_promo'),
@@ -87,6 +94,10 @@ urlpatterns += patterns('catalogue.views',
     url(r'^c/(?P<pk>.+)/box\.(?P<lang>.+)\.html', 'collection_box', name='catalogue_collection_box'),
 
     # This should be the last pattern.
     url(r'^c/(?P<pk>.+)/box\.(?P<lang>.+)\.html', 'collection_box', name='catalogue_collection_box'),
 
     # This should be the last pattern.
-    url(r'^galeria/(?P<tags>[a-zA-Z0-9-/]*)/$', 'tagged_object_list', {'gallery': True}, name='tagged_object_list_gallery'),
-    url(r'^(?P<tags>[a-zA-Z0-9-/]*)/$', 'tagged_object_list', name='tagged_object_list'),
+    url(r'^galeria/(?P<tags>[a-zA-Z0-9-/]*)/$', 'tagged_object_list', {'list_type': 'gallery'},
+        name='tagged_object_list_gallery'),
+    url(r'^audiobooki/(?P<tags>[a-zA-Z0-9-/]*)/$', 'tagged_object_list', {'list_type': 'audiobooks'},
+        name='tagged_object_list_audiobooks'),
+    url(r'^(?P<tags>[a-zA-Z0-9-/]*)/$', 'tagged_object_list', {'list_type': 'books'},
+        name='tagged_object_list'),
 )
 )