referrals: show referrer username on form

referrals
Harvey Tindall 1 year ago
parent 311ecb7030
commit 41c092f578
No known key found for this signature in database
GPG Key ID: BBC65952848FB1A2

@ -43,7 +43,7 @@
<div id="notification-box"></div>
<div class="page-container">
<div class="card dark:~d_neutral @low">
<div class="flex flex-col md:flex-row gap-3 inline align-baseline">
<div class="flex flex-col justify-between md:flex-row gap-3 items-baseline mb-2">
<span class="heading mr-5">
{{ if .passwordReset }}
{{ .strings.passwordReset }}
@ -53,11 +53,14 @@
</span>
<span class="subheading">
{{ if .passwordReset }}
{{ .strings.enterYourPassword }}
{{ .strings.enterYourPassword }}
{{ else }}
{{ .helpMessage }}
{{ .helpMessage }}
{{ end }}
</span>
{{ if .fromUser }}
<span class="badge ~positive text-lg p-1 px-2 self-center">{{ .strings.invitedBy }} {{ .fromUser }}</span>
{{ end }}
</div>
<div class="flex flex-col md:flex-row gap-3">
<div class="flex-1">

@ -36,7 +36,8 @@
"resetSentDescription": "If an account with the given username/contact method exists, a password reset link has been sent via all contact methods available. The code will expire in 30 minutes.",
"changePassword": "Change Password",
"referralsDescription": "Invite friends & family to Jellyfin with this link. Come back here for a new one if it expires.",
"copyReferral": "Copy Link"
"copyReferral": "Copy Link",
"invitedBy": "Invited By"
},
"notifications": {
"errorUserExists": "User already exists.",
@ -78,4 +79,4 @@
"plural": "Must have at least {n} special characters"
}
}
}
}

@ -619,6 +619,14 @@ func (app *appContext) InviteProxy(gc *gin.Context) {
}
userPageAddress += "/my/account"
fromUser := ""
if inv.ReferrerJellyfinID != "" {
sender, status, err := app.jf.UserByID(inv.ReferrerJellyfinID, false)
if status == 200 && err == nil {
fromUser = sender.Name
}
}
data := gin.H{
"urlBase": app.getURLBase(gc),
"cssClass": app.cssClass,
@ -654,6 +662,7 @@ func (app *appContext) InviteProxy(gc *gin.Context) {
"reCAPTCHASiteKey": app.config.Section("captcha").Key("recaptcha_site_key").MustString(""),
"userPageEnabled": app.config.Section("user_page").Key("enabled").MustBool(false),
"userPageAddress": userPageAddress,
"fromUser": fromUser,
}
if telegram {
data["telegramPIN"] = app.telegram.NewAuthToken()

Loading…
Cancel
Save