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>
This commit is contained in:
1 parent
03a1ce56d8
commit
e4f88485f2
4 files changed
+34
-27
No files matched your search
@@ -73,23 +73,27 @@ type PageHeader struct {
|
||||
// AppearanceHandler, e.g. "/appearance"; set, the navbar shows the
|
||||
// theme/palette menu. AppearanceBack is the BasePath-relative page
|
||||
// the menu returns to (ApplyAppearance sets it).
|
||||
AppearancePath string
|
||||
AppearanceBack string
|
||||
Brand string // navbar brand text, e.g. "YASTA"
|
||||
BrandInitial string // single-letter favicon glyph, e.g. "y"
|
||||
Subtitle string
|
||||
BasePath string
|
||||
NavItems []NavItem
|
||||
ActiveNav string
|
||||
Flash string
|
||||
FlashKind string // "ok" or "error"; meaningless if Flash == ""
|
||||
Username string
|
||||
LogoutPath string // BasePath-relative, e.g. "/logout"; rendered as a POST form (never a GET link); "" hides it
|
||||
NavbarBeforeBrand template.HTML // extra markup rendered before the brand link, e.g. a mobile sidebar toggle
|
||||
NavbarLeftExtra template.HTML // extra markup rendered after Subtitle in the navbar's left group
|
||||
NavbarRightExtra template.HTML // extra markup rendered after Username/Logout in the navbar's right group
|
||||
ExtraHeadHTML template.HTML // extra <link>/<script> tags appended to <head>
|
||||
ExtraBodyHTML template.HTML // extra <script> tags appended before </body>
|
||||
AppearancePath string
|
||||
AppearanceBack string
|
||||
// AppearanceFormHTML is extra markup inside the menu's POST form,
|
||||
// e.g. a hidden CSRF token field for a consumer whose middleware
|
||||
// demands one on every POST.
|
||||
AppearanceFormHTML template.HTML
|
||||
Brand string // navbar brand text, e.g. "YASTA"
|
||||
BrandInitial string // single-letter favicon glyph, e.g. "y"
|
||||
Subtitle string
|
||||
BasePath string
|
||||
NavItems []NavItem
|
||||
ActiveNav string
|
||||
Flash string
|
||||
FlashKind string // "ok" or "error"; meaningless if Flash == ""
|
||||
Username string
|
||||
LogoutPath string // BasePath-relative, e.g. "/logout"; rendered as a POST form (never a GET link); "" hides it
|
||||
NavbarBeforeBrand template.HTML // extra markup rendered before the brand link, e.g. a mobile sidebar toggle
|
||||
NavbarLeftExtra template.HTML // extra markup rendered after Subtitle in the navbar's left group
|
||||
NavbarRightExtra template.HTML // extra markup rendered after Username/Logout in the navbar's right group
|
||||
ExtraHeadHTML template.HTML // extra <link>/<script> tags appended to <head>
|
||||
ExtraBodyHTML template.HTML // extra <script> tags appended before </body>
|
||||
// BodyAttrs/SidebarAttrs are raw extra attributes (include their own
|
||||
// leading space, e.g. ` x-data="{ open: true }"`) spliced into
|
||||
// <body...> and the sidebar's <nav...> tag -- an escape hatch for a
|
||||
|
||||
Reference in new issue
Block a user