diff --git a/login.go b/login.go index e73ac51..ff0825e 100644 --- a/login.go +++ b/login.go @@ -287,7 +287,7 @@ func NewAccountUserAgreement(ctxt ui.AmContext) (string, any) { ctxt.SetLeftMenu("top") ctxt.VarMap().Set("target", target) - ctxt.VarMap().Set("amsterdam_suppressLogin", true) + ctxt.SetScratch("frame_suppressLogin", true) ctxt.SetFrameTitle("New Account User Agreement") return "framed", "agreement.jet" } diff --git a/ui/dialog.go b/ui/dialog.go index b4fd280..ce05b1e 100644 --- a/ui/dialog.go +++ b/ui/dialog.go @@ -320,7 +320,7 @@ func (d *Dialog) Render(ctxt AmContext) (string, any) { ctxt.VarMap().Set("__dialog", d) ctxt.SetFrameTitle(d.Title) if strings.Contains(d.Options, "suppresslogin") { - ctxt.VarMap().Set("amsterdam_suppressLogin", true) + ctxt.SetScratch("frame_suppressLogin", true) } return "framed", "dialog.jet" } diff --git a/ui/render_wrap.go b/ui/render_wrap.go index 638e98b..e1fb51a 100644 --- a/ui/render_wrap.go +++ b/ui/render_wrap.go @@ -112,6 +112,9 @@ func AmSendPageData(ctxt echo.Context, amctxt AmContext, command string, data an } menus[1] = AmMenu("fixed") amctxt.VarMap().Set("__leftMenus", menus) + if tmp := amctxt.GetScratch("frame_suppressLogin"); tmp != nil { + amctxt.VarMap().Set("__suppressLogin", true) + } err = ctxt.Render(httprc, "frame.jet", amctxt) default: err = fmt.Errorf("AmSendPageData(): unknown rendering type: %s", command) diff --git a/ui/views/frame.jet b/ui/views/frame.jet index 18df768..6d452be 100644 --- a/ui/views/frame.jet +++ b/ui/views/frame.jet @@ -57,7 +57,7 @@ {{ if .CurrentUser().IsAnon }} You are not logged in - {{ if !isset(amsterdam_suppressLogin) || !amsterdam_suppressLogin }} + {{ if !isset(__suppressLogin) }} - Log In | @@ -65,7 +65,7 @@ {{ end }} {{ else }} You are logged in as {{ .CurrentUser().Username }} - {{ if !isset(amsterdam_suppressLogin) || !amsterdam_suppressLogin }} + {{ if !isset(__suppressLogin) }} - Log Out {{ if !.CurrentUser().VerifyEMail }} diff --git a/userdata.go b/userdata.go index f70b0e3..bed4a56 100644 --- a/userdata.go +++ b/userdata.go @@ -225,7 +225,7 @@ func ProfilePhotoForm(ctxt ui.AmContext) (string, any) { if err == nil { ctxt.VarMap().Set("target", target) ctxt.VarMap().Set("photo_url", userPhotoURL(ci)) - ctxt.VarMap().Set("amsterdam_suppressLogin", true) + ctxt.SetScratch("frame_suppressLogin", true) ctxt.SetFrameTitle("Upload User Photo") return "framed", "photo_upload.jet" } @@ -278,7 +278,7 @@ func ProfilePhoto(ctxt ui.AmContext) (string, any) { ctxt.VarMap().Set("errorMessage", err.Error()) ctxt.VarMap().Set("target", target) ctxt.VarMap().Set("photo_url", userPhotoURL(ci)) - ctxt.VarMap().Set("amsterdam_suppressLogin", true) + ctxt.SetScratch("frame_suppressLogin", true) ctxt.SetFrameTitle("Upload User Photo") return "framed", "photo_upload.jet" }