mirror of
https://github.com/hrfee/jfa-go.git
synced 2024-12-22 17:10:10 +00:00
form: add notice about userpage on success modal, userpage title
uses new strings in the form lang section.
This commit is contained in:
parent
4f298bbc8c
commit
db97c3b2d4
@ -29,6 +29,7 @@
|
||||
window.captcha = {{ .captcha }};
|
||||
window.reCAPTCHA = {{ .reCAPTCHA }};
|
||||
window.reCAPTCHASiteKey = "{{ .reCAPTCHASiteKey }}";
|
||||
window.userPageEnabled = {{ .userPageEnabled }};
|
||||
</script>
|
||||
{{ if .passwordReset }}
|
||||
<script src="js/pwr.js" type="module"></script>
|
||||
|
@ -17,6 +17,7 @@
|
||||
<div class="card relative mx-auto my-[10%] w-4/5 lg:w-1/3">
|
||||
<span class="heading mb-4">{{ if .passwordReset }}{{ .strings.passwordReset }}{{ else }}{{ .strings.successHeader }}{{ end }}</span>
|
||||
<p class="content mb-4">{{ if .passwordReset }}{{ .strings.youCanLoginPassword }}{{ else }}{{ .successMessage }}{{ end }}</p>
|
||||
{{ if .userPageEnabled }}<p class="content mb-4" id="modal-success-user-page-area" my-account-term="{{ .strings.myAccount }}">{{ .strings.userPageSuccessMessage }}</p>{{ end }}
|
||||
<a class="button ~urge @low full-width center supra submit" href="{{ .jfLink }}" id="create-success-button">{{ .strings.continue }}</a>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -24,7 +24,7 @@
|
||||
window.matrixUserID = "{{ .matrixUser }}";
|
||||
</script>
|
||||
{{ template "header.html" . }}
|
||||
<title>{{ .lang.Strings.pageTitle }}</title>
|
||||
<title>{{ .lang.Strings.myAccount }}</title>
|
||||
</head>
|
||||
<body class="max-w-full overflow-x-hidden section">
|
||||
<div id="modal-email" class="modal">
|
||||
|
@ -25,7 +25,9 @@
|
||||
"editContactMethod": "Edit Contact Method",
|
||||
"joinTheServer": "Join the server:",
|
||||
"customMessagePlaceholderHeader": "Customize this card",
|
||||
"customMessagePlaceholderContent": "Click the user page edit button in settings to customize this card, or show one on the login screen, and don't worry, the user can't see this."
|
||||
"customMessagePlaceholderContent": "Click the user page edit button in settings to customize this card, or show one on the login screen, and don't worry, the user can't see this.",
|
||||
"userPageSuccessMessage": "You can see and change details about your account later on the {myAccount} page.",
|
||||
"myAccount": "My Account"
|
||||
},
|
||||
"notifications": {
|
||||
"errorUserExists": "User already exists.",
|
||||
|
@ -35,6 +35,7 @@ interface formWindow extends Window {
|
||||
captcha: boolean;
|
||||
reCAPTCHA: boolean;
|
||||
reCAPTCHASiteKey: string;
|
||||
userPageEnabled: boolean;
|
||||
}
|
||||
|
||||
loadLangSelector("form");
|
||||
@ -343,6 +344,10 @@ const create = (event: SubmitEvent) => {
|
||||
const url = ((document.getElementById("modal-success") as HTMLDivElement).querySelector("a.submit") as HTMLAnchorElement).href;
|
||||
window.location.href = url;
|
||||
} else {
|
||||
if (window.userPageEnabled) {
|
||||
const userPageNoticeArea = document.getElementById("modal-success-user-page-area");
|
||||
userPageNoticeArea.textContent = userPageNoticeArea.textContent.replace("{myAccount}", userPageNoticeArea.getAttribute("my-account-term"));
|
||||
}
|
||||
window.successModal.show();
|
||||
}
|
||||
} else {
|
||||
|
1
views.go
1
views.go
@ -625,6 +625,7 @@ func (app *appContext) InviteProxy(gc *gin.Context) {
|
||||
"captcha": app.config.Section("captcha").Key("enabled").MustBool(false),
|
||||
"reCAPTCHA": app.config.Section("captcha").Key("recaptcha").MustBool(false),
|
||||
"reCAPTCHASiteKey": app.config.Section("captcha").Key("recaptcha_site_key").MustString(""),
|
||||
"userPageEnabled": app.config.Section("user_page").Key("enabled").MustBool(false),
|
||||
}
|
||||
if telegram {
|
||||
data["telegramPIN"] = app.telegram.NewAuthToken()
|
||||
|
Loading…
Reference in New Issue
Block a user