Moved common header code into the included partial template #493
No reviewers
Labels
No labels
Kestra
bug
enhancement
someday
subtask
☁️ api
🎛️ infrastructure
🐞 sentry
📆 2025 Season
📝 pages
allpicks
📝 pages
picks
📝 pages
standings
🚀 performance
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
johnsturgeon/tgfp-web!493
Loading…
Reference in a new issue
No description provided.
Delete branch "figure-out-if-there-is-a-way-to-include-common-bits-of-the-three-base-jinja-templates-491"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This is a clean, well-scoped refactor. I verified that
config,request/url_forare present in the render context of every route that renders these templates (main.py:164, 215, 217, 303, 307, 451, 455, 519, 523and thebase.j2/allpicksbase.j2consumers), and thatUMAMI_JS_SCRIPT_URL/UMAMI_TRACKING_IDexist inconfig/op.env, so the extracted partial has everything it needs. No correctness or security regressions.Review
Solid deduplication — four near-identical
<head>blocks collapse into one_common_header.j2, and the previously non-cache-bustedmainstyle.cssinallpicksbase.j2now uses the versioned URL like everyone else. Jinja{% include %}inherits the parent context by default, and every rendering route passesconfig, so the partial resolves correctly.Worth fixing
app/templates/setting_up.j2now fires Umami on a 60-second auto-refresh loop.setting_up.j2keeps its<meta http-equiv="refresh" content="60"/>and now pulls in_common_header.j2:7, which adds the Umami tracking script it did not previously have. Every user parked on the "setting up" page will now generate a Umami pageview once a minute for as long as they wait, inflating analytics. If that page is meant to be untracked, consider gating the Umami script (e.g. a{% block %}/flag the partial honors) rather than unconditionally including it there.Nits
_common_header.j2:2places the stylesheet<link>before the favicon/manifest links, whereas the oldbase.j2had favicons first. Purely cosmetic (head-element order is not significant here), just noting the reordering was silent.base.j2puts<title>before the include,setting_up.j2puts the include before<title>. Harmless, but standardizing the order would make the partial's insertion point predictable.replaysSessionSampleRatewithout loading a Replay integration — both pre-existing and out of scope for this PR, but now that it lives in one place it's a cheaper thing to revisit later.No test coverage is expected for a pure template move; the offline suite doesn't render these. Looks good to merge once the
setting_upUmami behavior is confirmed intentional.