From 5555b8e996dc42d319c4ef7115307d10a25de7f3 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sun, 14 Jun 2026 22:16:43 +0300 Subject: pm0 add stats page template and render function Render the aggregated STATS_* counters from the om0 module into a static stats.html. render_stats_page builds the variable-length body (camera leaderboard, temporal/exposure/dimension histograms, format and enum breakdowns) as HTML and hands it to the new stats.tmpl through a raw context field, wrapping it with the shared header/footer the way view/details pages do. Bars are pure CSS so the page stays JavaScript-free. - new template share/templates/default/stats.tmpl (page chrome + body) - render_stats_page [page_name] plus small section builders in src/lib/stats.source.sh; EXIF-derived labels are HTML-escaped - new TEMPLATE_RENDER_FIELD_SPECS field render_stats_body_html (context_raw) and 'stats' added to render_backhref_html's required list - camera leaderboard entries link to camera-.html (um0 owns those) - Stats nav link wired into the shared header bar - tests cover leaderboard links, counts/percentages, a histogram section, &/< escaping, and omission of empty categories Co-Authored-By: Claude Opus 4.8 --- src/lib/template.source.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/lib/template.source.sh') diff --git a/src/lib/template.source.sh b/src/lib/template.source.sh index c23b870..6d48ae5 100644 --- a/src/lib/template.source.sh +++ b/src/lib/template.source.sh @@ -144,7 +144,7 @@ current_date_text_to() { declare -ra TEMPLATE_RENDER_FIELD_SPECS=( 'render_animation_class_html|context_html|animation_class|animation_class|preview details view' 'render_backhref_css|context_css|backhref|backhref|header splash' - 'render_backhref_html|context_html|backhref|backhref|footer header preview splash details view' + 'render_backhref_html|context_html|backhref|backhref|footer header preview splash details view stats' 'render_background_image_css|context_css|background_image|background_image|header splash' 'render_blurs_dir_css|context_css|blurs_dir|blurs_dir|header splash' 'render_current_date_text|current_date_html|||' @@ -164,6 +164,7 @@ declare -ra TEMPLATE_RENDER_FIELD_SPECS=( 'render_preview_num_html|context_html|preview_num|preview_num|preview details view' 'render_redirect_page_html|context_html|redirect_page|redirect_page|redirect' 'render_show_header_bar|context_raw|show_header_bar|show_header_bar|header' + 'render_stats_body_html|context_raw|stats_body|stats_body|stats' 'render_tarball_include|tarball_include|||' 'render_tarball_name_html|context_html|tarball_name|tarball_name|footer' 'render_thumbheight_html|config_html|THUMBHEIGHT||' -- cgit v1.2.3