fix findable
[wolnelektury.git] / src / catalogue / urls.py
index 230e1c9..7049b1c 100644 (file)
@@ -8,6 +8,7 @@ from catalogue.feeds import AudiobookFeed
 from catalogue.models import Book
 from catalogue import views
 import picture.views
 from catalogue.models import Book
 from catalogue import views
 import picture.views
+import search.views
 
 
 urlpatterns = [
 
 
 urlpatterns = [
@@ -36,14 +37,15 @@ urlpatterns = [
     path('lektury/<slug:slug>/', views.collection, name='collection'),
     path('audiobooki/', views.audiobooks, name='audiobook_list'),
     path('daisy/', views.daisy_list, name='daisy_list'),
     path('lektury/<slug:slug>/', views.collection, name='collection'),
     path('audiobooki/', views.audiobooks, name='audiobook_list'),
     path('daisy/', views.daisy_list, name='daisy_list'),
+    path('jtags/', search.views.hint, {'param': 'q', 'mozhint': True}, name='jhint'),
     path('nowe/', ListView.as_view(
     path('nowe/', ListView.as_view(
-        queryset=Book.objects.filter(parent=None, findable=True).order_by('-created_at'),
+        queryset=Book.objects.filter(parent=None, findable=True).order_by('-created_at')[:100],
         template_name='catalogue/recent_list.html'), name='recent_list'),
     path('nowe/audiobooki/', ListView.as_view(
         template_name='catalogue/recent_list.html'), name='recent_list'),
     path('nowe/audiobooki/', ListView.as_view(
-        queryset=Book.objects.filter(media__type='ogg').annotate(m=Max('media__uploaded_at')).order_by('-m'),
+        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'),
     path('nowe/daisy/', ListView.as_view(
         template_name='catalogue/recent_audiobooks_list.html'), name='recent_audiobooks_list'),
     path('nowe/daisy/', ListView.as_view(
-        queryset=Book.objects.filter(media__type='daisy').annotate(m=Max('media__uploaded_at')).order_by('-m'),
+        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'),
@@ -53,11 +55,11 @@ urlpatterns = [
     path('pobierz/<key>/<slug:slug>.<slug:format_>', views.embargo_link, name='embargo_link'),
 
     # zip
     path('pobierz/<key>/<slug:slug>.<slug:format_>', views.embargo_link, name='embargo_link'),
 
     # zip
-    path('zip/pdf.zip', views.download_zip, {'format': 'pdf', 'slug': None}, 'download_zip_pdf'),
-    path('zip/epub.zip', views.download_zip, {'format': 'epub', 'slug': None}, 'download_zip_epub'),
-    path('zip/mobi.zip', views.download_zip, {'format': 'mobi', 'slug': None}, 'download_zip_mobi'),
-    path('zip/mp3/<slug:slug>.zip', views.download_zip, {'format': 'mp3'}, 'download_zip_mp3'),
-    path('zip/ogg/<slug:slug>.zip', views.download_zip, {'format': 'ogg'}, 'download_zip_ogg'),
+    path('zip/pdf.zip', views.download_zip, {'file_format': 'pdf', 'slug': None}, 'download_zip_pdf'),
+    path('zip/epub.zip', views.download_zip, {'file_format': 'epub', 'slug': None}, 'download_zip_epub'),
+    path('zip/mobi.zip', views.download_zip, {'file_format': 'mobi', 'slug': None}, 'download_zip_mobi'),
+    path('zip/mp3/<slug:slug>.zip', views.download_zip, {'media_format': 'mp3'}, 'download_zip_mp3'),
+    path('zip/ogg/<slug:slug>.zip', views.download_zip, {'media_format': 'ogg'}, 'download_zip_ogg'),
 
     # 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'),