special galleries: add tests; make special breadcrumb clickable; highlight active special; hide back only

This commit is contained in:
2026-03-27 20:31:43 -04:00
parent 532690a329
commit 5f1035a252
3 changed files with 69 additions and 2 deletions

View File

@@ -220,7 +220,16 @@ def render_directory(request, path_text, full_path, special=None):
# expose which special is active so templates can highlight it
context["active_special"] = special
# Override breadcrumbs for special galleries to be a single label
context["breadcrumbs"] = [{"label": context["special_name"], "path": None}]
# and make it link to the special gallery root so templates can show
# it as an active, clickable breadcrumb.
from .specials import special_root_url
context["breadcrumbs"] = [
{
"label": context["special_name"],
"path": special_root_url(special, query_state),
}
]
# Hide the search box (templates use `is_special` to decide)
context["search_text"] = ""
context["search_action_url"] = ""