From 9d34ff96e246545de32798cd4da0fc9f6b343cd5 Mon Sep 17 00:00:00 2001 From: William Mantly Date: Tue, 14 Jul 2026 20:55:11 -0400 Subject: [PATCH] Add a footer, move GitHub link out of the nav (#130) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit proxy had no page footer at all — no copyright, no license link, no build/version info — unlike sso-manager-node, which already had one (now cleaned up in a matching change there). Bring the two in line: - Added a footer to bottom.ejs: theta42 logo/link, "© theta42" with an MIT License link, a GitHub link, and build version/hash. - Moved the GitHub icon link out of the top nav (where it competed with actual navigation items) and into the new footer. - Added nodejs/utils/build_info.js (buildVersion/buildHash/buildYear, read once from package.json + git) and wired it into routes/render.js so every page has the values the footer needs. Mirrors the same helper added to sso-manager-node in the matching cleanup there. - Copied the theta42.svg logo into nodejs/public/img/ (previously only present in sso-manager-node) so both apps' footers render identically. Verified by rendering top+bottom with the real ejs package: no template errors, GitHub link present exactly once (in the footer, not the nav), logo and MIT License link present. npm test: 192/192 pass (unaffected — view-only + a new leaf utility module). --- nodejs/public/img/theta42.svg | 51 +++++++++++++++++++++++++++++++++++ nodejs/routes/render.js | 2 ++ nodejs/utils/build_info.js | 15 +++++++++++ nodejs/views/bottom.ejs | 18 +++++++++++++ nodejs/views/top.ejs | 5 ---- 5 files changed, 86 insertions(+), 5 deletions(-) create mode 100644 nodejs/public/img/theta42.svg create mode 100644 nodejs/utils/build_info.js diff --git a/nodejs/public/img/theta42.svg b/nodejs/public/img/theta42.svg new file mode 100644 index 0000000..e598305 --- /dev/null +++ b/nodejs/public/img/theta42.svg @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 42 + + diff --git a/nodejs/routes/render.js b/nodejs/routes/render.js index cf4c216..c7bf913 100644 --- a/nodejs/routes/render.js +++ b/nodejs/routes/render.js @@ -4,10 +4,12 @@ const path = require('path'); const express = require('express'); const router = require('express').Router(); const conf = require('@simpleworkjs/conf'); +const buildInfo = require('../utils/build_info'); const values ={ title: conf.environment !== 'production' ? `dev` : '', titleIcon: conf.environment !== 'production' ? `` : '', + ...buildInfo, } // List of front end node modules to be served diff --git a/nodejs/utils/build_info.js b/nodejs/utils/build_info.js new file mode 100644 index 0000000..933679b --- /dev/null +++ b/nodejs/utils/build_info.js @@ -0,0 +1,15 @@ +'use strict'; + +const { execSync } = require('child_process'); +const { version: buildVersion } = require('../package.json'); + +let buildHash = 'unknown'; +try { + buildHash = execSync('git rev-parse --short HEAD', { cwd: __dirname }).toString().trim(); +} catch (_) {} + +module.exports = { + buildVersion, + buildHash, + buildYear: new Date().getFullYear(), +}; diff --git a/nodejs/views/bottom.ejs b/nodejs/views/bottom.ejs index f175236..2ff65f0 100755 --- a/nodejs/views/bottom.ejs +++ b/nodejs/views/bottom.ejs @@ -1,3 +1,21 @@ + + \ No newline at end of file diff --git a/nodejs/views/top.ejs b/nodejs/views/top.ejs index f567aeb..8119541 100755 --- a/nodejs/views/top.ejs +++ b/nodejs/views/top.ejs @@ -76,11 +76,6 @@ API Tokens -