From dd13e4b73a105ee416b6cfd8eb19b217622c0031 Mon Sep 17 00:00:00 2001 From: grm Date: Sat, 12 Sep 2026 12:33:57 +0300 Subject: Add announcements: blog-wide notices on every page and post A blog can have any number of announcements ("sections" in the schema): a book club's next meeting, this month's pick, a holiday closure. Each has a placement (above or below the posts, or under the menu when the menu is a left sidebar), a look (highlighted, warning, plain), an order, and an on/off switch so recurring notices can be kept around while hidden. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01Sd8UPWrvyYCLj97JexNw3A --- internal/web/templates/dashboard/section_form.html | 32 ++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 internal/web/templates/dashboard/section_form.html (limited to 'internal/web/templates/dashboard/section_form.html') diff --git a/internal/web/templates/dashboard/section_form.html b/internal/web/templates/dashboard/section_form.html new file mode 100644 index 0000000..9d4529c --- /dev/null +++ b/internal/web/templates/dashboard/section_form.html @@ -0,0 +1,32 @@ +{{define "title"}}{{if .Data.section.ID}}Edit announcement{{else}}New announcement{{end}} ยท {{.Blog.Title}}{{end}} +{{define "content"}} +{{$s := .Data.section}} +
+

{{if $s.ID}}Edit announcement{{else}}New announcement{{end}}

+
+ + +
+ + +
+

The sidebar spot only exists when the menu is a sidebar (see Design); otherwise a sidebar announcement is shown above the posts.

+ + {{template "editor" (dict "name" "body" "value" $s.BodyMD "rows" 10 "tall" false "upload" (print "/b/" .Blog.Subdomain "/images/upload") "csrf" .CSRF)}} + +

+ + View blog ↗ + Back to announcements +

+
+
+{{end}} -- cgit v1.2.3