Admin-configurable site banner#1591
Open
hodyhq wants to merge 1 commit into
Open
Conversation
fdcc1eb to
868f4ef
Compare
Adds a tenant-scoped notice that appears above the page header for maintenance windows, releases, or incident announcements. Off by default for existing installs; admin opt-in via Site Settings → Banner. Schema - tenants.site_banner_enabled BOOL NOT NULL DEFAULT FALSE - tenants.site_banner_message TEXT NOT NULL DEFAULT '' - tenants.site_banner_variant VARCHAR(20) NOT NULL DEFAULT 'info' - Migration is additive — no behavior change on upgrade. Backend - New action UpdateTenantSiteBanner validates variant against an allowlist (info|success|warning|danger|brand) and rejects an enabled banner with empty message. Max 500 chars. - New cmd + postgres handler updates the three columns in one UPDATE. - New POST /_api/admin/settings/site-banner endpoint. - Tenant entity carries the three fields; rendered via existing Tenant context in views/base.html immediately inside <body>. Frontend - /admin/banner page with toggle / variant dropdown / 500-char message textarea / live preview / per-keystroke counter. - _site-banner.scss owns the five variant palettes (info teal, success green, warning amber, danger red, brand var --color-primary). Responsive: tightens padding/font under 640px. - No customer-facing render changes when disabled — the conditional in views/base.html elides the <div> entirely.
868f4ef to
1cf903a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements https://feedback.fider.io/posts/646/admin-configurable-site-banner-above-the-page-header
Adds a tenant-scoped notice that renders above the page header for maintenance windows, releases, or incident announcements. Disabled by default — existing installs see no change.
Schema
Additive migration. Three new columns on
tenants:site_banner_enabled BOOL NOT NULL DEFAULT FALSEsite_banner_message TEXT NOT NULL DEFAULT ''site_banner_variant VARCHAR(20) NOT NULL DEFAULT 'info'Backend
UpdateTenantSiteBanneraction — validatesvariantagainst allowlist (info | success | warning | danger | brand) and rejects enabled banner with empty message. 500-char cap.POST /_api/admin/settings/site-bannerendpoint.Tenantcontext inviews/base.htmlimmediately inside<body>.Frontend
/admin/bannerpage: toggle, color-variant dropdown, 500-char message textarea, live preview, per-keystroke remaining counter._site-banner.scssowns the five variant palettes (info teal, success green, warning amber, danger red, brandvar(--color-primary)). Responsive: tightens padding/font under 640px.views/base.htmlelides the<div>entirely — no DOM cost.Backwards compatibility
Migration is additive, all defaults are off/empty. Stock Fider installs see no change until an admin opts in.