Files
yetano-webui-template/templates/layout/navbar.html.tmpl
T
terminarandClaude Opus 5.5 e4f88485f2 Menu form: AppearanceFormHTML for a consumer's hidden fields
A consumer whose middleware demands a CSRF token on every POST
(yamase-web) had to exempt the menu's route; it can now put the hidden
token field into the form instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 23:45:34 +01:00

29 lines
1.5 KiB
Cheetah

{{define "navbar"}}
<nav class="navbar navbar-expand">
<div class="container-fluid d-flex justify-content-between align-items-center">
<div class="d-flex align-items-center">
{{.NavbarBeforeBrand}}
<a class="navbar-brand" href="{{.BasePath}}/">{{.Brand}}</a>
{{if .Subtitle}}<span class="navbar-subtitle">{{.Subtitle}}</span>{{end}}
{{.NavbarLeftExtra}}
</div>
<div class="d-flex align-items-center gap-2">
{{if .Username}}<span class="navbar-subtitle">{{.Username}}</span>{{end}}
{{if .AppearancePath}}{{with .AppearanceMenu}}<details class="yw-appearance">
<summary class="btn btn-outline-secondary btn-sm" title="{{.ThemeHeading}}: {{.Current.Label}}"><span aria-hidden="true">{{.Current.Symbol}}</span> {{.Current.Label}}</summary>
<form method="post" action="{{$.BasePath}}{{$.AppearancePath}}" class="yw-appearance-menu m-0">
<input type="hidden" name="back" value="{{$.AppearanceBack}}">{{$.AppearanceFormHTML}}
<h6>{{.ThemeHeading}}</h6>
{{range .Themes}}<button type="submit" name="theme" value="{{.ID}}" aria-pressed="{{.Current}}"><span aria-hidden="true">{{.Symbol}}</span> {{.Label}}</button>
{{end}}<hr>
<h6>{{.PaletteHeading}}</h6>
{{range .Palettes}}<button type="submit" name="palette" value="{{.ID}}" aria-pressed="{{.Current}}">{{.Label}}</button>
{{end}}</form>
</details>
{{end}}{{end}}{{if .LogoutPath}}<form method="post" action="{{.BasePath}}{{.LogoutPath}}" class="d-inline m-0"><button type="submit" class="btn btn-outline-secondary btn-sm">Logout</button></form>{{end}}
{{.NavbarRightExtra}}
</div>
</div>
</nav>
{{end}}