summaryrefslogtreecommitdiff
path: root/share/templates/default
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-06-15 13:55:32 +0300
committerPaul Buetow <paul@buetow.org>2026-06-15 23:50:40 +0300
commitbe6ae2c9541a01927616b46cf6a683d7ce4519ff (patch)
tree53161337bae46495b8e88b96f1b28b1bd6f9c2ca /share/templates/default
parent6e47246dbbc97821b97aa9c45352abc9c2a9aa4a (diff)
Per-camera mini-albums: full-width grid + camera-scoped view navigation
Two fixes to the per-camera pages: - The camera thumbnail grid is now full-width and reflows with the window like the main album. Previously it sat inside the 900px-wide stats column, so wide thumbnails only fit ~2 per row. camera.tmpl now puts the grid in a full-width sibling block (centered by the body, like the album's direct thumbnail children); the heading/back-link stay in the narrow stats column. - Each camera is now a self-contained mini album. Thumbnails link to per-camera view pages (camera-<slug>--<index>.html) whose prev/next cycle only through that camera's photos, instead of linking into the shared album view pages (where next/prev walked the whole album and left the camera). The view pages reuse the album's look (blurred background, EXIF tooltip, animation) and offer Gallery / Details (to the album details page) / Direct-link nav. The "--" index separator can never collide with a gallery name since slugs never contain "--". Adds cameraview.tmpl + its render field, _stats_render_camera_{gallery,views} and the cameraview body builders. Tests updated for the new thumbnail links and extended to assert the per-camera view pages and their camera-scoped navigation; required-context-vars test now also covers the camera and cameraview templates. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Diffstat (limited to 'share/templates/default')
-rw-r--r--share/templates/default/camera.tmpl15
-rw-r--r--share/templates/default/cameraview.tmpl10
2 files changed, 18 insertions, 7 deletions
diff --git a/share/templates/default/camera.tmpl b/share/templates/default/camera.tmpl
index 2e08461..982e32f 100644
--- a/share/templates/default/camera.tmpl
+++ b/share/templates/default/camera.tmpl
@@ -7,19 +7,20 @@
# <html>/<head>/<body> and footer come from the header/footer templates, which
# render_camera_pages emits around this one (same pattern as stats/view/details).
#
-# Thumbnails link to each photo's album view page (navigation, details, EXIF
-# tooltip) so a camera page behaves exactly like the main album.
-# render_camera_pages resolves the <page>-<preview>.html target from the map the
-# album build records; a photo with no recorded view page falls back to the
-# full-size image under photos/ (see render_camera_pages).
+# This is a self-contained mini album: each thumbnail links to a per-camera view
+# page (camera-<slug>--<index>.html) whose prev/next navigation cycles only
+# through this camera's photos (see render_camera_pages). The heading and back
+# link sit in the narrow centered stats column, but the thumbnail grid is a
+# full-width sibling so it flows and wraps with the window like the main album
+# (the album thumbnails are likewise direct, full-width body children).
cat <<END
<div class="view stats camera">
<h1 class="stats-title">${render_title_html} &mdash; ${render_camera_name_html}</h1>
<div class="stats-back navigator">
<a href="${render_backhref_html}/stats.html">Back to stats</a>
</div>
- <div class="camera-thumbs">
+</div>
+<div class="camera-thumbs">
${render_camera_thumbs_html}
- </div>
</div>
END
diff --git a/share/templates/default/cameraview.tmpl b/share/templates/default/cameraview.tmpl
new file mode 100644
index 0000000..47b0e9b
--- /dev/null
+++ b/share/templates/default/cameraview.tmpl
@@ -0,0 +1,10 @@
+# Per-camera view page body: a self-contained mini-album view. The whole body --
+# the photo and its camera-scoped navigator (prev/next cycle within the camera,
+# plus links back to the gallery, the album details page, and the direct image)
+# -- is pre-rendered by render_camera_pages in src/lib/stats.source.sh and handed
+# in raw through render_cameraview_body_html. The surrounding chrome (header with
+# the blurred background, and footer) comes from the header/footer templates,
+# rendered around this one exactly like the album view pages.
+cat <<END
+${render_cameraview_body_html}
+END