From f16bd0f79c624665580615321b5d13b4be27cdad Mon Sep 17 00:00:00 2001 From: grm Date: Thu, 17 Sep 2026 17:09:01 +0300 Subject: Add the Gizmo look for announcements: framed boxes that share a row gizmolab's "next event" and "next assembly" boxes were hand-written HTML in the home page's intro; they are announcements by nature, so now they can be: a fourth style, a box framed in the theme's link colour with an italic heading. Headed Gizmo boxes in the same spot share a row on wide screens (the notices wrapper is a flex row, stacking on old browsers like .cols); one without a heading takes the whole row, which is how a banner line goes above a pair of boxes. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01Sd8UPWrvyYCLj97JexNw3A --- AGENTS.md | 19 +++++++++++++------ README.md | 3 ++- internal/db/migrations/blog/00009_gizmo_style.sql | 10 ++++++++++ internal/i18n/el.go | 4 +++- internal/store/sections.go | 2 +- internal/web/handlers_sections.go | 2 +- internal/web/static/blog.css | 14 +++++++++++++- internal/web/templates/dashboard/section_form.html | 2 ++ internal/web/templates/dashboard/sections.html | 2 +- internal/web/templates/layouts/blog.html | 4 +++- internal/web/theme.go | 1 + 11 files changed, 50 insertions(+), 13 deletions(-) create mode 100644 internal/db/migrations/blog/00009_gizmo_style.sql diff --git a/AGENTS.md b/AGENTS.md index 068889b..5753d26 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -70,8 +70,8 @@ internal/web/ server.go (host router, middleware, render helpers) summary.go (what a listing shows of a post) templates/ (embedded; layouts/, partials/, auth/, dashboard/, admin/, blog/) static/ (dashboard.css — lean look; custom properties, flexbox and grid - are fine there. blog.css — floats except the three-column `.cols`, - which is flexbox; it must keep working on old browsers) + are fine there. blog.css — floats except the three-column `.cols` + and the `.notices` row, which are flexbox; it must keep working on old browsers) ``` ## Key mechanics @@ -316,12 +316,19 @@ internal/web/ server.go (host router, middleware, render helpers) - **Announcements** (`sections` table, `store/sections.go`, `handlers_sections.go`, `/b/{sub}/announcements…`): per-blog notices with `placement` (`-`: left|main|right × top|bottom, split by - `Section.Column()/Position()`), `style` (plain|note|warning), `enabled` + `Section.Column()/Position()`), `style` (plain|note|warning|gizmo — a CHECK + constraint, so a new style needs a migration), `enabled` and `sort_order`. `blogView` loads the enabled ones and `placeNotices` groups them by placement, moving ones for a side column that is not laid out into the main column. - Rendered by the `notices` template in `layouts/blog.html`; CSS classes - `notice notice-