@ -9,143 +9,134 @@ block view-content
section.uk-section.uk-section-default
section.uk-section.uk-section-default
.uk-container
.uk-container
h1 Settings
div(uk-grid)
div(class="uk-width-1-1 uk-width-1-3@m")
-
-
var tabNames = {
var currentImage = null;
"account": 0,
if (user.picture && user.picture.large) {
};
currentImage = user.picture.large;
}
ul(uk-tab={ active: tabNames[startTab], animation: false })
.uk-margin
li
+renderFileUploadImage(
a Account
`/user/${user._id}/profile-photo`,
'profile-picture-upload',
'profile-picture-file',
'streamray-profile-picture',
`/img/default-member.png`,
currentImage,
{ aspectRatio: 1 },
)
.uk-margin.uk-text-center
if hasOtpAccount
a(href=`/user/${user._id}/otp-disable`).uk-button.uk-button-danger.uk-border-rounded Disable 2FA
else
a(href=`/user/${user._id}/otp-setup`).uk-button.uk-button-secondary.uk-border-rounded Enable 2FA
div(class="uk-width-1-1 uk-width-expand@m")
form(
method="POST",
action=`/user/${user._id}/settings`,
autocomplete= "off",
onsubmit="return dtp.app.submitForm(event, 'user account update');",
).uk-form
input(type="hidden", name= csrfTokenAccountSettings.name, value= csrfTokenAccountSettings.token)
ul.uk-switcher
ul(uk-tab, uk-switcher={ connect: '#account-settings-tabs'})
//- User account and billing
li
li
a(href) Profile
div(uk-grid)
li
div(class="uk-width-1-1 uk-width-1-3@m")
a(href) Password
-
li
var currentImage = null;
a(href) Email
if (user.picture && user.picture.large) {
if user.flags && user.flags.isModerator
currentImage = user.picture.large;
li
}
a(href) Moderator
.uk-margin
ul#account-settings-tabs.uk-switcher
+renderFileUploadImage(
li
`/user/${user._id}/profile-photo`,
fieldset
'profile-picture-upload',
legend Profile
'profile-picture-file',
.uk-margin
'streamray-profile-picture',
label(for="username").uk-form-label Username
`/img/default-member.png`,
input(id="username", name="username", type="text", placeholder="Enter username", value= userProfile.username).uk-input
currentImage,
.uk-margin
{ aspectRatio: 1 },
label(for="display-name").uk-form-label Display Name
)
input(id="display-name", name="displayName", type="text", placeholder="Enter display name", value= userProfile.displayName).uk-input
.uk-margin
.uk-margin.uk-text-center
label(for="bio").uk-form-label Bio
if hasOtpAccount
textarea(id="bio", name="bio", rows="4", placeholder="Enter profile bio").uk-textarea.uk-resize-vertical= userProfile.bio
a(href=`/user/${user._id}/otp-disable`).uk-button.uk-button-danger.uk-border-rounded Disable 2FA
.uk-margin
else
label(for="ui-theme").uk-form-label UI Theme
a(href=`/user/${user._id}/otp-setup`).uk-button.uk-button-secondary.uk-border-rounded Enable 2FA
select(id="ui-theme", name="uiTheme").uk-select
option(value="chat-light", selected= (user.ui.theme === 'chat-light')) Light
div(class="uk-width-1-1 uk-width-expand@m")
option(value="chat-dark", selected= (user.ui.theme === 'chat-dark')) Dark
form(
method="POST",
action=`/user/${user._id}/settings`,
autocomplete= "off",
onsubmit="return dtp.app.submitForm(event, 'user account update');",
).uk-form
input(type="hidden", name= csrfTokenAccountSettings.name, value= csrfTokenAccountSettings.token)
ul(uk-tab, uk-switcher={ connect: '#account-settings-tabs'})
li
li
fieldset
a(href) Profile
legend Password
li
.uk-margin
a(href) Password
div(uk-grid).uk-grid-small
li
.uk-width-1-2
a(href) Email
.uk-margin
if user.flags && user.flags.isModerator
label(for="password").uk-form-label New Password
li
input(id="password", name="password", type="password", placeholder="Enter new password", autocomplete= "new-password").uk-input
a(href) Moderator
.uk-width-1-2
.uk-margin
ul#account-settings-tabs.uk-switcher
label(for="passwordv").uk-form-label Verify New Password
li
input(id="passwordv", name="passwordv", type="password", placeholder="Enter new password again", autocomplete= "new-password").uk-input
fieldset
legend Profile
.uk-margin
label(for="username").uk-form-label Username
input(id="username", name="username", type="text", placeholder="Enter username", value= userProfile.username).uk-input
.uk-margin
label(for="display-name").uk-form-label Display Name
input(id="display-name", name="displayName", type="text", placeholder="Enter display name", value= userProfile.displayName).uk-input
.uk-margin
label(for="bio").uk-form-label Bio
textarea(id="bio", name="bio", rows="4", placeholder="Enter profile bio").uk-textarea.uk-resize-vertical= userProfile.bio
li
fieldset
legend Password
.uk-margin
div(uk-grid).uk-grid-small
.uk-width-1-2
.uk-margin
label(for="password").uk-form-label New Password
input(id="password", name="password", type="password", placeholder="Enter new password", autocomplete= "new-password").uk-input
.uk-width-1-2
.uk-margin
label(for="passwordv").uk-form-label Verify New Password
input(id="passwordv", name="passwordv", type="password", placeholder="Enter new password again", autocomplete= "new-password").uk-input
li
li
fieldset
fieldset
legend Email Preferences
legend Email Preferences
.uk-margin
.uk-margin
label(for="email").uk-form-label
label(for="email").uk-form-label
span Email Address
span Email Address
if user.flags.isEmailVerified
if user.flags.isEmailVerified
span (verified)
span (verified)
div(uk-grid).uk-grid-small
div(uk-grid).uk-grid-small
div(class="uk-width-1-1 uk-width-expand@s")
div(class="uk-width-1-1 uk-width-expand@s")
.uk-margin-small
.uk-margin-small
input(id="email", name="email", type="email", placeholder="Enter email address", value= userProfile.email).uk-input
input(id="email", name="email", type="email", placeholder="Enter email address", value= userProfile.email).uk-input
if user.flags.isEmailVerified
if user.flags.isEmailVerified
.uk-text-small.uk-text-muted Changing your email address will un-verify you and send a new verification email. Check your spam folder!
.uk-text-small.uk-text-muted Changing your email address will un-verify you and send a new verification email. Check your spam folder!
else
else
.uk-text-small.uk-text-muted Changing your email address will send a new verification email. Check your spam folder!
.uk-text-small.uk-text-muted Changing your email address will send a new verification email. Check your spam folder!
div(class="uk-width-1-1 uk-width-auto@s")
div(class="uk-width-1-1 uk-width-auto@s")
button(type="button", onclick="return dtp.app.resendWelcomeEmail(event);").uk-button.uk-button-secondary.uk-border-rounded Resend Welcome Email
button(type="button", onclick="return dtp.app.resendWelcomeEmail(event);").uk-button.uk-button-secondary.uk-border-rounded Resend Welcome Email
.uk-margin
.uk-margin
div(uk-grid).uk-grid-small
div(uk-grid).uk-grid-small
.uk-width-auto
.uk-width-auto
.pretty.p-switch.p-slim
.pretty.p-switch.p-slim
input(id="optin-system", name="optIn.system", type="checkbox", checked= userProfile.optIn ? userProfile.optIn.system : false)
input(id="optin-system", name="optIn.system", type="checkbox", checked= userProfile.optIn ? userProfile.optIn.system : false)
.state.p-success
.state.p-success
label(for="optin-system") System Messages
label(for="optin-system") System Messages
.uk-width-auto
.uk-width-auto
.pretty.p-switch.p-slim
.pretty.p-switch.p-slim
input(id="optin-marketing", name="optIn.marketing", type="checkbox", checked= userProfile.optIn ? userProfile.optIn.marketing : false)
input(id="optin-marketing", name="optIn.marketing", type="checkbox", checked= userProfile.optIn ? userProfile.optIn.marketing : false)
.state.p-success
.state.p-success
label(for="optin-marketing") Newsletter
label(for="optin-marketing") Newsletter
.uk-width-auto
.uk-width-auto
.pretty.p-switch.p-slim
.pretty.p-switch.p-slim
input(id="email-verified", type="checkbox", checked= userProfile.flags ? userProfile.flags.isEmailVerified : false, disabled)
input(id="email-verified", type="checkbox", checked= userProfile.flags ? userProfile.flags.isEmailVerified : false, disabled)
.state.p-success
.state.p-success
label(for="email-verified") Email Verified
label(for="email-verified") Email Verified
if user.flags && user.flags.isModerator
if user.flags && user.flags.isModerator
li
li
fieldset
fieldset
legend Moderator Preferences
legend Moderator Preferences
.uk-margin
.uk-margin
.pretty.p-switch.p-slim
.pretty.p-switch.p-slim
input(id="moderator-cloaked", name="flags.isCloaked", type="checkbox", checked= userProfile.flags ? userProfile.flags.isCloaked : false)
input(id="moderator-cloaked", name="flags.isCloaked", type="checkbox", checked= userProfile.flags ? userProfile.flags.isCloaked : false)
.state.p-success
.state.p-success
label(for="moderator-cloaked") Enable Ghost Mode
label(for="moderator-cloaked") Enable Ghost Mode
.uk-margin
.uk-margin
button(type="submit").uk-button.uk-button-primary.uk-border-rounded Update account settings
button(type="submit").uk-button.uk-button-primary.uk-border-rounded Update account settings
block viewjs
block viewjs
script.
script.