From 4f78b7c33b45970ef597e28a0709c7a65a9181d0 Mon Sep 17 00:00:00 2001 From: Harvey Tindall Date: Mon, 2 Oct 2023 10:56:50 +0100 Subject: [PATCH] admin: option link to my account page on login screen --- config/config-base.json | 8 ++++++++ html/login-modal.html | 8 ++++++++ lang/admin/en-us.json | 3 ++- views.go | 1 + 4 files changed, 19 insertions(+), 1 deletion(-) diff --git a/config/config-base.json b/config/config-base.json index c0c59ff..b12d081 100644 --- a/config/config-base.json +++ b/config/config-base.json @@ -418,6 +418,14 @@ "required": "false", "description": "Click the edit icon next to the \"User Page\" Setting to add custom Markdown messages that will be shown to the user. Note message cards are not private, little effort is required for anyone to view them." }, + "show_link": { + "name": "Show Link on Admin Login page", + "required": false, + "requires_restart": false, + "type": "bool", + "value": true, + "description": "Whether or not to show a link to the \"My Account\" page on the admin login screen, to direct lost users." + }, "referrals": { "name": "User Referrals", "required": false, diff --git a/html/login-modal.html b/html/login-modal.html index 2f9c3fb..e3c4a5d 100644 --- a/html/login-modal.html +++ b/html/login-modal.html @@ -7,6 +7,14 @@ {{ end }} {{ end }} + {{ if index . "userPageEnabled" }} + {{ if and .userPageEnabled .showUserPageLink }} +
+ {{ .strings.loginNotAdmin }} + {{ .strings.myAccount }} +
+ {{ end }} + {{ end }}
{{ .strings.login }} diff --git a/lang/admin/en-us.json b/lang/admin/en-us.json index 9a3bd22..e22efe8 100644 --- a/lang/admin/en-us.json +++ b/lang/admin/en-us.json @@ -123,7 +123,8 @@ "userPageLogin": "User Page: Login", "userPagePage": "User Page: Page", "buildTime": "Build Time", - "builtBy": "Built By" + "builtBy": "Built By", + "loginNotAdmin": "Not an Admin?" }, "notifications": { "changedEmailAddress": "Changed email address of {n}.", diff --git a/views.go b/views.go index f388c35..7e56900 100644 --- a/views.go +++ b/views.go @@ -175,6 +175,7 @@ func (app *appContext) AdminPage(gc *gin.Context) { "jfAdminOnly": jfAdminOnly, "jfAllowAll": jfAllowAll, "userPageEnabled": app.config.Section("user_page").Key("enabled").MustBool(false), + "showUserPageLink": app.config.Section("user_page").Key("show_link").MustBool(true), "referralsEnabled": app.config.Section("user_page").Key("enabled").MustBool(false) && app.config.Section("user_page").Key("referrals").MustBool(false), "loginAppearance": app.config.Section("ui").Key("login_appearance").MustString("clear"), })