From be5255b4e755a39ab69318858dc3a8a398c3d437 Mon Sep 17 00:00:00 2001 From: Amy Gale Ruth Bowersox Date: Tue, 10 Feb 2026 21:19:50 -0700 Subject: [PATCH] factoring out some of the special case "amsterdam_" page variables --- ui/dialog.go | 8 ++++---- ui/render_wrap.go | 4 ++-- ui/views/dialog.jet | 32 ++++++++++++++++---------------- ui/views/frame.jet | 4 ++-- 4 files changed, 24 insertions(+), 24 deletions(-) diff --git a/ui/dialog.go b/ui/dialog.go index 4d4341d..b4fd280 100644 --- a/ui/dialog.go +++ b/ui/dialog.go @@ -316,8 +316,8 @@ func (d *Dialog) Render(ctxt AmContext) (string, any) { if d.MenuSelector != "" && d.MenuSelector != "nochange" { ctxt.SetLeftMenu(d.MenuSelector) } - ctxt.VarMap().Set("amsterdam_required", required) - ctxt.VarMap().Set("amsterdam_dialog", d) + ctxt.VarMap().Set("__required", required) + ctxt.VarMap().Set("__dialog", d) ctxt.SetFrameTitle(d.Title) if strings.Contains(d.Options, "suppresslogin") { ctxt.VarMap().Set("amsterdam_suppressLogin", true) @@ -334,7 +334,7 @@ func (d *Dialog) Render(ctxt AmContext) (string, any) { * Data as a parameter for the command string. */ func (d *Dialog) RenderError(ctxt AmContext, errormessage string) (string, any) { - ctxt.VarMap().Set("amsterdam_errorMessage", errormessage) + ctxt.VarMap().Set("__errorMessage", errormessage) return d.Render(ctxt) } @@ -347,7 +347,7 @@ func (d *Dialog) RenderError(ctxt AmContext, errormessage string) (string, any) * Data as a parameter for the command string. */ func (d *Dialog) RenderInfo(ctxt AmContext, infoMessage string) (string, any) { - ctxt.VarMap().Set("amsterdam_infoMessage", infoMessage) + ctxt.VarMap().Set("__infoMessage", infoMessage) return d.Render(ctxt) } diff --git a/ui/render_wrap.go b/ui/render_wrap.go index 69272b4..638e98b 100644 --- a/ui/render_wrap.go +++ b/ui/render_wrap.go @@ -96,7 +96,7 @@ func AmSendPageData(ctxt echo.Context, amctxt AmContext, command string, data an ctxt.Logger().Errorf("*** NO FRAME TITLE set for path %s", amctxt.URLPath()) amctxt.SetFrameTitle("<<< NO FRAME TITLE >>>") } - amctxt.VarMap().Set("amsterdam_innerPage", data) + amctxt.VarMap().Set("__innerPage", data) menus := make([]*MenuDefinition, 2) switch amctxt.LeftMenu() { case "top": @@ -111,7 +111,7 @@ func AmSendPageData(ctxt echo.Context, amctxt AmContext, command string, data an return fmt.Errorf("AmSendPageData(): unknown left menu context: %s", amctxt.LeftMenu()) } menus[1] = AmMenu("fixed") - amctxt.VarMap().Set("amsterdam_leftMenus", menus) + amctxt.VarMap().Set("__leftMenus", menus) err = ctxt.Render(httprc, "frame.jet", amctxt) default: err = fmt.Errorf("AmSendPageData(): unknown rendering type: %s", command) diff --git a/ui/views/dialog.jet b/ui/views/dialog.jet index 7d4a101..d9bdede 100644 --- a/ui/views/dialog.jet +++ b/ui/views/dialog.jet @@ -6,32 +6,32 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at https://mozilla.org/MPL/2.0/. *} - +
-

{{ amsterdam_dialog.Title }}

- {{ if amsterdam_dialog.Subtitle != "" }} - {{ amsterdam_dialog.Subtitle }} +

{{ __dialog.Title }}

+ {{ if __dialog.Subtitle != "" }} + {{ __dialog.Subtitle }} {{ end }}

-
- {{ range amsterdam_dialog.Fields }} + + {{ range __dialog.Fields }} {{ if .Type == "hidden" }} {{ end }} {{ end }} - {{ if amsterdam_dialog.Instructions != "" }} -

{{ amsterdam_dialog.Instructions | raw }}

+ {{ if __dialog.Instructions != "" }} +

{{ __dialog.Instructions | raw }}

{{ end }} - {{ if amsterdam_required }} + {{ if __required }}

Required fields are marked with a *.

{{ end }} - {{ if isset(amsterdam_errorMessage) }} + {{ if isset(__errorMessage) }}
@@ -39,12 +39,12 @@ ⚠️
-

{{ CapitalizeString(amsterdam_errorMessage) }}.

+

{{ CapitalizeString(__errorMessage) }}.

{{ end }} - {{ if isset(amsterdam_infoMessage) }} + {{ if isset(__infoMessage) }}
@@ -52,7 +52,7 @@ ℹ️
-

{{ amsterdam_infoMessage }}.

+

{{ __infoMessage }}.

@@ -60,7 +60,7 @@
- {{ range amsterdam_dialog.Fields }} + {{ range __dialog.Fields }} {{ if .Type == "text" || .Type == "ams_id" || .Type == "email" }}