From 6e31a7e2dd6e9922b07ebb5c25bf89513759c599 Mon Sep 17 00:00:00 2001 From: Harvey Tindall Date: Tue, 2 Dec 2025 14:56:15 +0000 Subject: [PATCH] form: add pre-signup card same as the post-signup card, but shown on the sidebar. --- api-messages.go | 1 + customcontent.go | 24 +++++++++++++++++++++++- html/form.html | 5 +++++ lang/admin/en-us.json | 2 ++ views.go | 19 +++++++++++++++++++ 5 files changed, 50 insertions(+), 1 deletion(-) diff --git a/api-messages.go b/api-messages.go index 0b72330..766642c 100644 --- a/api-messages.go +++ b/api-messages.go @@ -169,6 +169,7 @@ func (app *appContext) GetCustomMessageTemplate(gc *gin.Context) { case "UserPage": case "UserLogin": case "PostSignupCard": + case "PreSignupCard": // These don't have any example content msg = nil } diff --git a/customcontent.go b/customcontent.go index 0b199e3..b0f4932 100644 --- a/customcontent.go +++ b/customcontent.go @@ -352,9 +352,31 @@ var customContent = map[string]CustomContentInfo{ "myAccountURL", ), Placeholders: defaultVals(map[string]any{ - "myAccountURL": "https://sub2.test.url/my/account", + "myAccountURL": "https://example.url/my/account", }), }, + "PreSignupCard": { + Name: "PreSignupCard", + ContentType: CustomCard, + DisplayName: func(dict *Lang, lang string) string { + if _, ok := dict.Admin[lang]; !ok { + lang = dict.chosenAdminLang + } + return dict.Admin[lang].Strings["preSignupCard"] + }, + Description: func(dict *Lang, lang string) string { + if _, ok := dict.Admin[lang]; !ok { + lang = dict.chosenAdminLang + } + return dict.Admin[lang].Strings["preSignupCardDescription"] + }, + Variables: []string{ + "myAccountURL", + }, + Placeholders: map[string]any{ + "myAccountURL": "https://example.url/my/account", + }, + }, } var EmptyCustomContent = CustomContentInfo{ diff --git a/html/form.html b/html/form.html index acfbf29..030a78d 100644 --- a/html/form.html +++ b/html/form.html @@ -125,6 +125,11 @@ {{ if .fromUser }} {{ end }} + {{ if .preSignupCard }} +
+ {{ .preSignupCardContent }} +
+ {{ end }}
{{ .strings.passwordRequirementsHeader }}