factored out the need for amsterdam_pageTitle by having FrameTitle be a separate bit of metadata in AmContext

This commit is contained in:
2026-02-10 21:10:20 -07:00
parent 09842a91bd
commit f2b8b829aa
18 changed files with 65 additions and 46 deletions
+6 -2
View File
@@ -68,12 +68,12 @@ func AmSendPageData(ctxt echo.Context, amctxt AmContext, command string, data an
if httprc < 400 {
httprc = http.StatusInternalServerError
}
amctxt.VarMap().Set("amsterdam_pageTitle", "Internal Server Error")
amctxt.SetFrameTitle("Internal Server Error")
amctxt.VarMap().Set("error", message)
command = "framed"
data = "error.jet"
case "ipban":
amctxt.VarMap().Set("amsterdam_pageTitle", "IP Address Banned")
amctxt.SetFrameTitle("IP Address Banned")
amctxt.VarMap().Set("message", data)
httprc = http.StatusForbidden
command = "framed"
@@ -92,6 +92,10 @@ func AmSendPageData(ctxt echo.Context, amctxt AmContext, command string, data an
case "template":
err = ctxt.Render(httprc, data.(string), amctxt)
case "framed":
if amctxt.FrameTitle() == "" {
ctxt.Logger().Errorf("*** NO FRAME TITLE set for path %s", amctxt.URLPath())
amctxt.SetFrameTitle("<<< NO FRAME TITLE >>>")
}
amctxt.VarMap().Set("amsterdam_innerPage", data)
menus := make([]*MenuDefinition, 2)
switch amctxt.LeftMenu() {