fix
[wolnelektury.git] / src / catalogue / urls.py
index f8eb6a4..0a8df78 100644 (file)
@@ -14,7 +14,7 @@ import search.views
 urlpatterns = [
     path('obraz/strona/', picture.views.picture_page, name='picture_page'),
     # pictures - currently pictures are coupled with catalogue, hence the url is here
 urlpatterns = [
     path('obraz/strona/', picture.views.picture_page, name='picture_page'),
     # pictures - currently pictures are coupled with catalogue, hence the url is here
-    path('obraz/', picture.views.picture_list_thumb, name='picture_list_thumb'), # TODO: catalogue view
+    path('obraz/', picture.views.picture_list_thumb, name='picture_list_thumb'),
     path('obraz/<slug:slug>.html', picture.views.picture_viewer, name='picture_viewer'),
     path('obraz/<slug:slug>/', picture.views.picture_detail, name='picture_detail'),
 
     path('obraz/<slug:slug>.html', picture.views.picture_viewer, name='picture_viewer'),
     path('obraz/<slug:slug>/', picture.views.picture_detail, name='picture_detail'),
 
@@ -22,31 +22,30 @@ urlpatterns = [
     path('szukaj/', RedirectView.as_view(
         url='/szukaj/', query_string=True, permanent=True)),
 
     path('szukaj/', RedirectView.as_view(
         url='/szukaj/', query_string=True, permanent=True)),
 
-    path('', views.catalogue, name='catalogue'), # TODO catalogue
+    path('', views.catalogue, name='catalogue'),
 
 
-    # TODO: catalogue
     path('autor/', views.tag_catalogue, {'category': 'author'}, name='author_catalogue'),
     path('epoka/', views.tag_catalogue, {'category': 'epoch'}, name='epoch_catalogue'),
     path('gatunek/', views.tag_catalogue, {'category': 'genre'}, name='genre_catalogue'),
     path('rodzaj/', views.tag_catalogue, {'category': 'kind'}, name='kind_catalogue'),
     path('motyw/', views.tag_catalogue, {'category': 'theme'}, name='theme_catalogue'),
 
     path('autor/', views.tag_catalogue, {'category': 'author'}, name='author_catalogue'),
     path('epoka/', views.tag_catalogue, {'category': 'epoch'}, name='epoch_catalogue'),
     path('gatunek/', views.tag_catalogue, {'category': 'genre'}, name='genre_catalogue'),
     path('rodzaj/', views.tag_catalogue, {'category': 'kind'}, name='kind_catalogue'),
     path('motyw/', views.tag_catalogue, {'category': 'theme'}, name='theme_catalogue'),
 
-    path('galeria/', views.gallery, name='gallery'),
+    path('galeria/', views.GalleryView.as_view(), name='gallery'),
     path('kolekcje/', views.collections, name='catalogue_collections'),
 
     path('kolekcje/', views.collections, name='catalogue_collections'),
 
-    path('lektury/', views.literature, name='book_list'),
+    path('lektury/', views.LiteratureView.as_view(), name='book_list'),
     path('lektury/<slug:slug>/', views.collection, name='collection'),
     path('lektury/<slug:slug>/', views.collection, name='collection'),
-    path('audiobooki/', views.audiobooks, name='audiobook_list'),
-    path('daisy/', views.daisy_list, name='daisy_list'), # TODO: catalogue
+    path('audiobooki/', views.AudiobooksView.as_view(), name='audiobook_list'),
+    path('daisy/', views.daisy_list, name='daisy_list'),
     path('jtags/', search.views.hint, {'param': 'q', 'mozhint': True}, name='jhint'),
     path('jtags/', search.views.hint, {'param': 'q', 'mozhint': True}, name='jhint'),
-    path('nowe/', ListView.as_view( # TODO
-        queryset=Book.objects.filter(parent=None, findable=True).order_by('-created_at'),
+    path('nowe/', ListView.as_view(
+        queryset=Book.objects.filter(parent=None, findable=True).order_by('-created_at')[:100],
         template_name='catalogue/recent_list.html'), name='recent_list'),
         template_name='catalogue/recent_list.html'), name='recent_list'),
-    path('nowe/audiobooki/', ListView.as_view( # TODO
-        queryset=Book.objects.filter(media__type='ogg').annotate(m=Max('media__uploaded_at')).order_by('-m'),
+    path('nowe/audiobooki/', ListView.as_view(
+        queryset=Book.objects.filter(media__type='ogg').annotate(m=Max('media__uploaded_at')).order_by('-m')[:100],
         template_name='catalogue/recent_audiobooks_list.html'), name='recent_audiobooks_list'),
         template_name='catalogue/recent_audiobooks_list.html'), name='recent_audiobooks_list'),
-    path('nowe/daisy/', ListView.as_view( # TODO
-        queryset=Book.objects.filter(media__type='daisy').annotate(m=Max('media__uploaded_at')).order_by('-m'),
+    path('nowe/daisy/', ListView.as_view(
+        queryset=Book.objects.filter(media__type='daisy').annotate(m=Max('media__uploaded_at')).order_by('-m')[:100],
         template_name='catalogue/recent_daisy_list.html'), name='recent_daisy_list'),
 
     path('custompdf/<slug:slug>/', views.CustomPDFFormView(), name='custom_pdf_form'),
         template_name='catalogue/recent_daisy_list.html'), name='recent_daisy_list'),
 
     path('custompdf/<slug:slug>/', views.CustomPDFFormView(), name='custom_pdf_form'),
@@ -64,7 +63,6 @@ urlpatterns = [
 
     # Public interface. Do not change this URLs.
     path('lektura/<slug:slug>.html', views.book_text, name='book_text'),
 
     # Public interface. Do not change this URLs.
     path('lektura/<slug:slug>.html', views.book_text, name='book_text'),
-    path('lektura/<slug:slug>/audiobook/', views.player, name='book_player'),
     path('lektura/<slug:slug>/', views.book_detail, name='book_detail'),
     path('lektura/<slug:slug>/motyw/<slug:theme_slug>/',
          views.book_fragments, name='book_fragments'),
     path('lektura/<slug:slug>/', views.book_detail, name='book_detail'),
     path('lektura/<slug:slug>/motyw/<slug:theme_slug>/',
          views.book_fragments, name='book_fragments'),