Add special-gallery back thumbnail and hide sort button for specials
This commit is contained in:
@@ -141,10 +141,20 @@ def render_image(request, path_text, full_path, special=None):
|
||||
except Exception:
|
||||
dir_text = ""
|
||||
|
||||
# For special galleries hide the Back control but still present Home
|
||||
# Back (directory) and Home (root) links and thumbnails
|
||||
# For special galleries we still want to show a Back link that points
|
||||
# to the special gallery root — populate `back_thumb` with the
|
||||
# thumbnail of the first image in that special gallery so the UI can
|
||||
# display a representative image. For non-special views keep the
|
||||
# existing behavior (thumbnail for parent directory).
|
||||
if special is not None:
|
||||
back_url = None
|
||||
back_thumb = None
|
||||
# images_sorted is already the special list in the requested order
|
||||
try:
|
||||
first_image = images_sorted[0] if len(images_sorted) > 0 else None
|
||||
back_thumb = thumb_for(first_image)
|
||||
except Exception:
|
||||
back_thumb = None
|
||||
else:
|
||||
back_url = gallery_url(
|
||||
Path(dir_text) if dir_text != "" else None, True, query_state
|
||||
|
||||
Reference in New Issue
Block a user