fix: apply the BrandingName setting to the masthead and page title

The brandingName admin setting was saved but never used — layout/login/register
hardcoded "Bounty Board". render() now passes the configured brand into every
page, and the top-nav masthead, <title>, and login/register headers use it.
(The "Bounty Board" board-feature labels are left as-is.)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
etalon
2026-06-13 12:31:23 +02:00
parent 35168b9b83
commit 46e2099542
4 changed files with 11 additions and 4 deletions
+7
View File
@@ -23,6 +23,7 @@ type pageData struct {
User *domain.User
DefaultTheme string
NavLayout string
Brand string
Narrow bool
OIDCEnabled bool
Error string
@@ -88,6 +89,12 @@ func (s *Server) render(w http.ResponseWriter, r *http.Request, page string, dat
data.NavLayout = "top"
}
}
if data.Brand == "" {
data.Brand = "Bounty Board"
if st, err := s.store.GetSettings(r.Context()); err == nil && st.BrandingName != "" {
data.Brand = st.BrandingName
}
}
w.Header().Set("Content-Type", "text/html; charset=utf-8")
if err := t.ExecuteTemplate(w, "layout", data); err != nil {
s.log.Error("execute template", "page", page, "err", err)
+2 -2
View File
@@ -3,13 +3,13 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{{.Title}} · Bounty Board</title>
<title>{{.Title}} · {{.Brand}}</title>
<link rel="stylesheet" href="/static/css/app.css">
<script src="/static/js/theme.js"></script>
</head>
<body {{if .User}}data-logged-in="1"{{end}} data-nav="{{if .User}}{{.NavLayout}}{{else}}top{{end}}">
<nav class="topnav">
<a class="brand" href="/">Bounty Board</a>
<a class="brand" href="/">{{.Brand}}</a>
<div class="links">
{{if .User}}
{{if .User.Roles.Developer}}
+1 -1
View File
@@ -1,7 +1,7 @@
{{define "content"}}
<header class="masthead">
<p class="masthead-kicker">Consulting Work Exchange</p>
<p class="masthead-title">Bounty Board</p>
<p class="masthead-title">{{.Brand}}</p>
<p class="masthead-rule"></p>
</header>
<div class="card">
+1 -1
View File
@@ -1,7 +1,7 @@
{{define "content"}}
<header class="masthead">
<p class="masthead-kicker">Consulting Work Exchange</p>
<p class="masthead-title">Bounty Board</p>
<p class="masthead-title">{{.Brand}}</p>
<p class="masthead-rule"></p>
</header>
<div class="card">