1
0
mirror of https://github.com/hrfee/jfa-go.git synced 2024-12-22 09:00:10 +00:00

setup: add user page

also sprinkled mentions of it throughout other relevant pages.
This commit is contained in:
Harvey Tindall 2023-06-26 21:29:49 +01:00
parent 65f402fd35
commit 3fa4b01115
Signed by: hrfee
GPG Key ID: BBC65952848FB1A2
5 changed files with 34 additions and 4 deletions

View File

@ -146,6 +146,7 @@
<label class="row switch pb-4"> <label class="row switch pb-4">
<input type="radio" class="mr-2" name="ui-jellyfin_login" value="false"><span>{{ .lang.Login.authorizeManual }}</span> <input type="radio" class="mr-2" name="ui-jellyfin_login" value="false"><span>{{ .lang.Login.authorizeManual }}</span>
</label> </label>
<p class="support pb-4 pl-4 mt-1">{{ .lang.Login.authorizeManualUserPageNotice }}</p>
</div> </div>
<div id="login-manual"> <div id="login-manual">
<label class="label"> <label class="label">
@ -238,6 +239,21 @@
</div> </div>
</section> </section>
</div> </div>
<div class="card ~neutral @low mb-2 unfocused">
<span class="heading">{{ .lang.UserPage.title }}</span>
<p class="content my-2">{{ .lang.UserPage.description }}</p>
<p class="content my-2">{{ .lang.UserPage.customizeMessages }}</p>
<label class="row switch pb-4">
<input type="checkbox" class="mr-2" id="userpage-enabled"><span>{{ .lang.Strings.enabled }}</span>
</label>
<p class="support mb-1 mt-1">{{ .lang.UserPage.requiredSettings }}</p>
<section class="section ~neutral banner footer flex-expand middle">
<span class="button ~neutral @low back">{{ .lang.Strings.back }}</span>
<div>
<span class="button ~urge @low next">{{ .lang.Strings.next }}</span>
</div>
</section>
</div>
<div class="card ~neutral @low mb-2 unfocused"> <div class="card ~neutral @low mb-2 unfocused">
<span class="heading">{{ .lang.Messages.title }}</span> <span class="heading">{{ .lang.Messages.title }}</span>
<p class="content my-2" id="messages-description"></p> <p class="content my-2" id="messages-description"></p>
@ -391,7 +407,7 @@
</label> </label>
<label class="switch"> <label class="switch">
<input type="checkbox" class="mr-2" id="password_resets-link_reset"><span>{{ .lang.PasswordResets.resetLinks }}</span> <input type="checkbox" class="mr-2" id="password_resets-link_reset"><span>{{ .lang.PasswordResets.resetLinks }}</span>
<p class="support mb-2 mt-1">{{ .lang.PasswordResets.resetLinksNotice }}</p> <p class="support mb-2 mt-1">{{ .lang.PasswordResets.resetLinksNotice }} {{ .lang.PasswordResets.resetLinksRequiredForUserPage }}</p>
</label> </label>
<label class="switch"> <label class="switch">
<input type="checkbox" class="mr-2" id="password_resets-set_password"><span>{{ .lang.PasswordResets.setPassword }}</span> <input type="checkbox" class="mr-2" id="password_resets-set_password"><span>{{ .lang.PasswordResets.setPassword }}</span>

View File

@ -123,6 +123,7 @@ type setupLang struct {
Email langSection `json:"email"` Email langSection `json:"email"`
Messages langSection `json:"messages"` Messages langSection `json:"messages"`
Notifications langSection `json:"notifications"` Notifications langSection `json:"notifications"`
UserPage langSection `json:"userPage"`
WelcomeEmails langSection `json:"welcomeEmails"` WelcomeEmails langSection `json:"welcomeEmails"`
PasswordResets langSection `json:"passwordResets"` PasswordResets langSection `json:"passwordResets"`
InviteEmails langSection `json:"inviteEmails"` InviteEmails langSection `json:"inviteEmails"`

View File

@ -70,6 +70,7 @@
"adminOnly": "Admin users only (recommended)", "adminOnly": "Admin users only (recommended)",
"allowAll": "Allow all Jellyfin users to login", "allowAll": "Allow all Jellyfin users to login",
"allowAllDescription": "Not recommended, you should allow individual users to login once setup.", "allowAllDescription": "Not recommended, you should allow individual users to login once setup.",
"authorizeManualUserPageNotice": "Using this will disable the \"User Page\" feature.",
"emailNotice": "Your email address can be used to receive notifications." "emailNotice": "Your email address can be used to receive notifications."
}, },
"jellyfinEmby": { "jellyfinEmby": {
@ -109,6 +110,12 @@
"title": "Admin Notifications", "title": "Admin Notifications",
"description": "If enabled, you can choose (per invite) to receive an message when an invite expires, or a user is created. If you didn't choose the Jellyfin login method, make sure you provided your email address, or add another contact method later." "description": "If enabled, you can choose (per invite) to receive an message when an invite expires, or a user is created. If you didn't choose the Jellyfin login method, make sure you provided your email address, or add another contact method later."
}, },
"userPage": {
"title": "User Page",
"description": "The user page (shown as \"My Account\") allows users to access information about their account, such as their contact methods and account expiry. They can also change their password, start a password reset, and link/change contact methods, without having to ask you. Additionally, customized Markdown messages can be shown to the users before and after logging in.",
"customizeMessages": "Click the edit button next to \"User Page\" in settings to set them later.",
"requiredSettings": "Log-in to jfa-go via Jellyfin must be set. Ensure \"reset password via link\" is selected later for self-service password resets."
},
"welcomeEmails": { "welcomeEmails": {
"title": "Welcome messages", "title": "Welcome messages",
"description": "If enabled, an message will be sent to new users with the Jellyfin/Emby URL and their username." "description": "If enabled, an message will be sent to new users with the Jellyfin/Emby URL and their username."
@ -119,10 +126,11 @@
}, },
"passwordResets": { "passwordResets": {
"title": "Password Resets", "title": "Password Resets",
"description": "When a user tries to reset their password, Jellyfin creates a file named 'passwordreset-*.json' which contains a PIN. jfa-go reads the file and sends the PIN to the user.", "description": "When a user tries to reset their password, Jellyfin creates a file named 'passwordreset-*.json' which contains a PIN. jfa-go reads the file and sends the PIN to the user. If you enabled the \"User Page\" feature, a reset can also be performed there, given a username, email, or contact method.",
"pathToJellyfin": "Path to Jellyfin configuration directory", "pathToJellyfin": "Path to Jellyfin configuration directory",
"pathToJellyfinNotice": "If you don't know where this is, try resetting your password in Jellyfin. A popup with '<path to jellyfin>/passwordreset-*.json' will appear.", "pathToJellyfinNotice": "If you don't know where this is, try resetting your password in Jellyfin. A popup with '<path to jellyfin>/passwordreset-*.json' will appear. This is not necessary if you only want to use self-service password resets through the \"User Page\".",
"resetLinks": "Send a link instead of a PIN", "resetLinks": "Send a link instead of a PIN",
"resetLinksRequiredForUserPage": "Required for self-service password reset on the User Page.",
"resetLinksNotice": "If Ombi integration is enabled, use this to sync Jellyfin password resets with Ombi.", "resetLinksNotice": "If Ombi integration is enabled, use this to sync Jellyfin password resets with Ombi.",
"resetLinksLanguage": "Default reset link language", "resetLinksLanguage": "Default reset link language",
"setPassword": "Set password through link", "setPassword": "Set password through link",
@ -149,4 +157,4 @@
"emailMessage": "Email Message", "emailMessage": "Email Message",
"emailMessageNotice": "Displays at the bottom of emails." "emailMessageNotice": "Displays at the bottom of emails."
} }
} }

View File

@ -133,6 +133,7 @@ func (st *Storage) loadLangSetup(filesystems ...fs.FS) error {
patchLang(&lang.Email, &fallback.Email, &english.Email) patchLang(&lang.Email, &fallback.Email, &english.Email)
patchLang(&lang.Messages, &fallback.Messages, &english.Messages) patchLang(&lang.Messages, &fallback.Messages, &english.Messages)
patchLang(&lang.Notifications, &fallback.Notifications, &english.Notifications) patchLang(&lang.Notifications, &fallback.Notifications, &english.Notifications)
patchLang(&lang.UserPage, &fallback.UserPage, &english.UserPage)
patchLang(&lang.PasswordResets, &fallback.PasswordResets, &english.PasswordResets) patchLang(&lang.PasswordResets, &fallback.PasswordResets, &english.PasswordResets)
patchLang(&lang.InviteEmails, &fallback.InviteEmails, &english.InviteEmails) patchLang(&lang.InviteEmails, &fallback.InviteEmails, &english.InviteEmails)
patchLang(&lang.PasswordValidation, &fallback.PasswordValidation, &english.PasswordValidation) patchLang(&lang.PasswordValidation, &fallback.PasswordValidation, &english.PasswordValidation)
@ -150,6 +151,7 @@ func (st *Storage) loadLangSetup(filesystems ...fs.FS) error {
patchLang(&lang.Email, &english.Email) patchLang(&lang.Email, &english.Email)
patchLang(&lang.Messages, &english.Messages) patchLang(&lang.Messages, &english.Messages)
patchLang(&lang.Notifications, &english.Notifications) patchLang(&lang.Notifications, &english.Notifications)
patchLang(&lang.UserPage, &english.UserPage)
patchLang(&lang.PasswordResets, &english.PasswordResets) patchLang(&lang.PasswordResets, &english.PasswordResets)
patchLang(&lang.InviteEmails, &english.InviteEmails) patchLang(&lang.InviteEmails, &english.InviteEmails)
patchLang(&lang.PasswordValidation, &english.PasswordValidation) patchLang(&lang.PasswordValidation, &english.PasswordValidation)

View File

@ -283,6 +283,9 @@ const settings = {
"notifications": { "notifications": {
"enabled": new Checkbox(get("notifications-enabled")) "enabled": new Checkbox(get("notifications-enabled"))
}, },
"user_page": {
"enabled": new Checkbox(get("userpage-enabled"))
},
"welcome_email": { "welcome_email": {
"enabled": new Checkbox(get("welcome_email-enabled"), "", false, "welcome_email", "enabled"), "enabled": new Checkbox(get("welcome_email-enabled"), "", false, "welcome_email", "enabled"),
"subject": new Input(get("welcome_email-subject"), "", "", "enabled", true, "welcome_email") "subject": new Input(get("welcome_email-subject"), "", "", "enabled", true, "welcome_email")