- /admin: password-protected admin login (8-hour session cookie) - /admin/dashboard: full inquiries table + announcement management - Announcements: create promos with title, body, optional CTA button, optional expiry date; toggle active/inactive; delete - Homepage: queries active non-expired announcement from D1 and renders a dismissible orange banner (localStorage persists per-announcement) - D1 migration 004_announcements.sql: announcements table + index Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
12 lines
335 B
SQL
12 lines
335 B
SQL
CREATE TABLE IF NOT EXISTS announcements (
|
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
title TEXT NOT NULL,
|
|
body TEXT NOT NULL,
|
|
cta_label TEXT,
|
|
cta_url TEXT,
|
|
active INTEGER DEFAULT 1,
|
|
expires_at TEXT,
|
|
created_at TEXT DEFAULT (datetime('now'))
|
|
);
|
|
|
|
CREATE INDEX IF NOT EXISTS idx_announcements_active ON announcements(active);
|