photo26/photologue/urls.py

51 lines
1.8 KiB
Python

# This file is part of photo21
# Copyright (C) 2022 Amicale des élèves de l'ENS Paris-Saclay
# SPDX-License-Identifier: GPL-3.0-or-later
from django.urls import path, re_path, include
from .views import (
GalleryArchiveIndexView,
GalleryDetailView,
GalleryDownload,
GalleryPublicView,
GalleryTokenView,
GalleryUpload,
GalleryYearArchiveView,
PhotoDeleteView,
PhotoDetailView,
PhotoReportView,
PhotoUncensorView,
TagDetail,
)
app_name = "photologue"
urlpatterns = [
path("select2/", include("django_select2.urls")),
path("tag/<slug:slug>/", TagDetail.as_view(), name="tag-detail"),
path("gallery/", GalleryArchiveIndexView.as_view(), name="pl-gallery-archive"),
re_path(
r"^gallery/(?P<year>\d{4})/$",
GalleryYearArchiveView.as_view(),
name="pl-gallery-archive-year",
),
path("gallery/<slug:slug>/", GalleryDetailView.as_view(), name="pl-gallery"),
path(
"gallery/<slug:slug>/<int:owner>/",
GalleryDetailView.as_view(),
name="pl-gallery-owner",
),
path(
"gallery/<slug:slug>/download/",
GalleryDownload.as_view(),
name="pl-gallery-download",
),
path("photo/<int:pk>/", PhotoDetailView.as_view(), name="pl-photo"),
path("photo/<int:pk>/delete/", PhotoDeleteView.as_view(), name="pl-photo-delete"),
path("photo/<int:pk>/report/", PhotoReportView.as_view(), name="pl-photo-report"),
path("photo/<int:pk>/uncensor/", PhotoUncensorView.as_view(), name="pl-photo-uncensor"),
path("upload/", GalleryUpload.as_view(), name="pl-gallery-upload"),
path("share/<uuid:token>/", GalleryPublicView.as_view(), name="pl-gallery-public"),
path("gallery/<slug:slug>/token/", GalleryTokenView.as_view(), name="pl-gallery-token"),
]