From a7aa3fd53e989cef4494cf9effffccb69d6c59a0 Mon Sep 17 00:00:00 2001 From: Harvey Tindall Date: Fri, 23 Aug 2024 21:12:16 +0100 Subject: [PATCH] settings: de-dupe settings all DOM elements now based off DOMSetting, which encompasses most functionality. Extending classes (i forgot the terminology) pretty much just pass a custom "input" element, "hider" element (the one to unfocus). DOMList and DOMSelect remain slightly more complicated, but are much cleaner now. Some CSS stuff has been adjusted too. --- config.go | 2 + config/config-base.json | 12 +- html/admin.html | 30 +- ts/modules/settings.ts | 603 ++++++++++++---------------------------- 4 files changed, 211 insertions(+), 436 deletions(-) diff --git a/config.go b/config.go index 8ea8e12..a3a8d02 100644 --- a/config.go +++ b/config.go @@ -127,6 +127,8 @@ func (app *appContext) loadConfig() error { app.MustSetValue("user_expiry", "adjustment_email_html", "jfa-go:"+"expiry-adjusted.html") app.MustSetValue("user_expiry", "adjustment_email_text", "jfa-go:"+"expiry-adjusted.txt") + app.MustSetValue("email", "collect", "true") + app.MustSetValue("matrix", "topic", "Jellyfin notifications") app.MustSetValue("matrix", "show_on_reg", "true") diff --git a/config/config-base.json b/config/config-base.json index 013b685..4ecac5c 100644 --- a/config/config-base.json +++ b/config/config-base.json @@ -896,11 +896,20 @@ "value": false, "description": "Send emails as plain text instead of HTML." }, + "collect": { + "name": "Collect on sign-up", + "required": false, + "requires_restart": false, + "depends_true": "method", + "type": "bool", + "value": true, + "description": "Ask for an email address on the sign-up form." + }, "required": { "name": "Require on sign-up", "required": false, "requires_restart": false, - "depends_true": "method", + "depends_true": "collect", "type": "bool", "value": false, "description": "Require an email address on sign-up." @@ -909,6 +918,7 @@ "name": "Require unique address", "required": false, "requires_restart": true, + "depends_true": "method", "type": "bool", "value": false, "description": "Disables using the same address on multiple accounts." diff --git a/html/admin.html b/html/admin.html index 7eaea80..f7e46b5 100644 --- a/html/admin.html +++ b/html/admin.html @@ -312,25 +312,27 @@
×
-
- - {{ .strings.variables }} -
- {{ .strings.conditionals }} -
- - -

{{ .strings.markdownSupported }}

-
-