eliminated the last amsterdam_ special variable, amsterdam_suppressLogin

This commit is contained in:
2026-02-10 21:42:49 -07:00
parent 2e7474168b
commit d827001329
5 changed files with 9 additions and 6 deletions
+1 -1
View File
@@ -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"
}
+1 -1
View File
@@ -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"
}
+3
View File
@@ -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)
+2 -2
View File
@@ -57,7 +57,7 @@
<span class="text-white text-base">
{{ if .CurrentUser().IsAnon }}
You are not logged in
{{ if !isset(amsterdam_suppressLogin) || !amsterdam_suppressLogin }}
{{ if !isset(__suppressLogin) }}
<span class="mx-2">-</span>
<a href="/login" class="text-yellow-300 hover:text-yellow-400">Log In</a>
<span class="mx-2">|</span>
@@ -65,7 +65,7 @@
{{ end }}
{{ else }}
You are logged in as <b>{{ .CurrentUser().Username }}</b>
{{ if !isset(amsterdam_suppressLogin) || !amsterdam_suppressLogin }}
{{ if !isset(__suppressLogin) }}
<span class="mx-2">-</span>
<a href="/logout" class="text-yellow-300 hover:text-yellow-400">Log Out</a>
{{ if !.CurrentUser().VerifyEMail }}
+2 -2
View File
@@ -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"
}