X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/e977f7187b10b1bc0a30794cd585c6b840568996..fbc10cff4c1ea91b0a42d2435755d538cce4a241:/src/documents/urls.py?ds=sidebyside diff --git a/src/documents/urls.py b/src/documents/urls.py index 602d4f22..71ce10a0 100644 --- a/src/documents/urls.py +++ b/src/documents/urls.py @@ -1,7 +1,7 @@ # This file is part of FNP-Redakcja, licensed under GNU Affero GPLv3 or later. # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. # -from django.conf.urls import url +from django.urls import path, re_path from django.contrib.auth.decorators import permission_required from django.views.generic import RedirectView from .feeds import PublishTrackFeed @@ -9,58 +9,57 @@ from . import views urlpatterns = [ - url(r'^$', RedirectView.as_view(url='catalogue/', permanent=False)), + path('', RedirectView.as_view(url='catalogue/', permanent=False)), - url(r'^images/$', views.image_list, name='documents_image_list'), - url(r'^image/(?P[^/]+)/$', views.image, name="documents_image"), - url(r'^image/(?P[^/]+)/publish$', views.publish_image, + path('images/', views.image_list, name='documents_image_list'), + path('image//', views.image, name="documents_image"), + path('image//publish', views.publish_image, name="documents_publish_image"), - url(r'^catalogue/$', views.document_list, name='documents_document_list'), - url(r'^user/$', views.my, name='documents_user'), - url(r'^user/(?P[^/]+)/$', views.user, name='documents_user'), - url(r'^users/$', views.users, name='documents_users'), - url(r'^activity/$', views.activity, name='documents_activity'), - url(r'^activity/(?P\d{4}-\d{2}-\d{2})/$', + path('catalogue/', views.document_list, name='documents_document_list'), + path('user/', views.my, name='documents_user'), + path('user//', views.user, name='documents_user'), + path('users/', views.users, name='documents_users'), + path('activity/', views.activity, name='documents_activity'), + re_path(r'^activity/(?P\d{4}-\d{2}-\d{2})/$', views.activity, name='documents_activity'), - url(r'^upload/$', - views.upload, name='documents_upload'), + path('upload/', views.upload, name='documents_upload'), - url(r'^create/(?P[^/]*)/', - views.create_missing, name='documents_create_missing'), - url(r'^create/', + path('create//', views.create_missing, name='documents_create_missing'), + path('create/', views.create_missing, name='documents_create_missing'), - url(r'^book/(?P[^/]+)/publish$', views.publish, name="documents_publish"), + path('book//publish', views.publish, name="documents_publish"), - url(r'^book/(?P[^/]+)/$', views.book, name="documents_book"), - url(r'^book/(?P[^/]+)/gallery/$', + path('book//', views.book, name="documents_book"), + path('book//gallery/', permission_required('documents.change_book')(views.GalleryView.as_view()), name="documents_book_gallery"), - url(r'^book/(?P[^/]+)/xml$', views.book_xml, name="documents_book_xml"), - url(r'^book/dc/(?P[^/]+)/xml$', views.book_xml_dc, name="documents_book_xml_dc"), - url(r'^book/(?P[^/]+)/txt$', views.book_txt, name="documents_book_txt"), - url(r'^book/(?P[^/]+)/html$', views.book_html, name="documents_book_html"), - url(r'^book/(?P[^/]+)/epub$', views.book_epub, name="documents_book_epub"), - url(r'^book/(?P[^/]+)/mobi$', views.book_mobi, name="documents_book_mobi"), - url(r'^book/(?P[^/]+)/pdf$', views.book_pdf, name="documents_book_pdf"), - url(r'^book/(?P[^/]+)/pdf-mobile$', views.book_pdf, kwargs={'mobile': True}, name="documents_book_pdf_mobile"), + path('book//xml', views.book_xml, name="documents_book_xml"), + path('book/dc//xml', views.book_xml_dc, name="documents_book_xml_dc"), + path('book//txt', views.book_txt, name="documents_book_txt"), + path('book//html', views.book_html, name="documents_book_html"), + path('book//epub', views.book_epub, name="documents_book_epub"), + path('book//mobi', views.book_mobi, name="documents_book_mobi"), + path('book//pdf', views.book_pdf, name="documents_book_pdf"), + path('book//pdf-mobile', views.book_pdf, kwargs={'mobile': True}, name="documents_book_pdf_mobile"), - url(r'^chunk_add/(?P[^/]+)/(?P[^/]+)/$', + path('chunk_add///', views.chunk_add, name="documents_chunk_add"), - url(r'^chunk_edit/(?P[^/]+)/(?P[^/]+)/$', + path('chunk_edit///', views.chunk_edit, name="documents_chunk_edit"), - url(r'^book_append/(?P[^/]+)/$', + path('book_append//', views.book_append, name="documents_book_append"), - url(r'^chunk_mass_edit', + path('chunk_mass_edit', views.chunk_mass_edit, name='documents_chunk_mass_edit'), - url(r'^image_mass_edit', + path('image_mass_edit', views.image_mass_edit, name='documents_image_mass_edit'), - url(r'^track/(?P[^/]*)/$', PublishTrackFeed()), - url(r'^active/$', views.active_users_list, name='active_users_list'), + path('track//', PublishTrackFeed()), + path('active/', views.active_users_list, name='active_users_list'), + path('active.csv', views.active_users_list, kwargs={'csv': True}, name='active_users_csv'), - url(r'^mark-final/$', views.mark_final, name='mark_final'), - url(r'^mark-final-completed/$', views.mark_final_completed, name='mark_final_completed'), + path('mark-final/', views.mark_final, name='mark_final'), + path('mark-final-completed/', views.mark_final_completed, name='mark_final_completed'), ]