special-gallery: scope image prev/next/back to special galleries; add tests
This commit is contained in:
@@ -64,15 +64,15 @@ def append_query(url, query_dict):
|
||||
return url + "?" + urlencode(query_dict)
|
||||
|
||||
|
||||
def gallery_url(path_obj=None, is_dir=False, query_dict=None):
|
||||
def gallery_url(path_obj=None, is_dir=False, query_dict=None, special=None):
|
||||
if query_dict is None:
|
||||
query_dict = {}
|
||||
|
||||
if path_obj is None:
|
||||
base_url = "/gallery/"
|
||||
base_url = f"/gallery/{special}/" if special is not None else "/gallery/"
|
||||
else:
|
||||
path_text = str(path_obj).replace("\\", "/")
|
||||
base_url = "/gallery/" + path_text
|
||||
base_url = (f"/gallery/{special}/" if special is not None else "/gallery/") + path_text
|
||||
|
||||
if is_dir and not base_url.endswith("/"):
|
||||
base_url += "/"
|
||||
|
||||
Reference in New Issue
Block a user