eliminated the last amsterdam_ special variable, amsterdam_suppressLogin
This commit is contained in:
@@ -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
@@ -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"
|
||||
}
|
||||
|
||||
@@ -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
@@ -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
@@ -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"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user