special galleries: helper module, renderers, templates & urls; hide back in special views; highlight active special

This commit is contained in:
2026-03-27 20:09:35 -04:00
parent 24c1c96f19
commit 532690a329
8 changed files with 252 additions and 64 deletions

View File

@@ -1,8 +1,8 @@
# Django imports
from django.urls import path
from django.urls import path, re_path
# Module imports
from .views import gallery_view, toggle_settings
from .views import gallery_view, toggle_settings, special_gallery_view
###########################################################################################
# URL Patterns. #
@@ -13,5 +13,17 @@ urlpatterns = [
# Views.
path("", gallery_view, name="gallery_view_root"),
path("toggle-settings/", toggle_settings, name="toggle_settings"),
# Special gallery routes (explicit list to avoid clashing with regular paths)
re_path(
r"^(?P<gallery>favorites|most-visited|recent)/(?P<path>.*)/$",
special_gallery_view,
name="special_gallery_view_path",
),
re_path(
r"^(?P<gallery>favorites|most-visited|recent)/$",
special_gallery_view,
name="special_gallery_view_root",
),
# Generic gallery path (catch-all for filesystem paths)
path("<path:path>/", gallery_view, name="gallery_view_path"),
]