diff --git a/app/assets/javascripts/discourse/app/templates/preferences-email.hbs b/app/assets/javascripts/discourse/app/templates/preferences-email.hbs index 661ea0eece6..002b3906dd8 100644 --- a/app/assets/javascripts/discourse/app/templates/preferences-email.hbs +++ b/app/assets/javascripts/discourse/app/templates/preferences-email.hbs @@ -1,58 +1,60 @@ -
-
+{{#d-section pageClass="user-preferences" tagName=""}} +
+ -
-
-

{{i18n (if new "user.add_email.title" "user.change_email.title")}}

-
-
- - {{#if success}}
-
-

{{ successMessage }}

-
+

{{i18n (if new "user.add_email.title" "user.change_email.title")}}

- {{else}} - {{#if error}} + + {{#if success}}
-
{{errorMessage}}
+
+

{{ successMessage }}

+
+
+
+ {{else}} + {{#if error}} +
+
+
{{errorMessage}}
+
+
+ {{/if}} + +
+ +
+ {{text-field value=newEmail id="change-email" classNames="input-xxlarge" autofocus="autofocus"}} + {{input-tip validation=emailValidation}} +
+
+
+ {{#if taken}} + {{i18n "user.change_email.taken"}} + {{else}} + {{i18n "user.email.instructions"}} + {{/if}} +
+
+
+ +
+
+ {{d-button + class="btn-primary" + action=(action "saveEmail") + type="submit" + disabled=saveDisabled + translatedLabel=saveButtonText + }}
{{/if}} -
- -
- {{text-field value=newEmail id="change-email" classNames="input-xxlarge" autofocus="autofocus"}} - {{input-tip validation=emailValidation}} -
-
-
- {{#if taken}} - {{i18n "user.change_email.taken"}} - {{else}} - {{i18n "user.email.instructions"}} - {{/if}} -
-
-
- -
-
- {{d-button - class="btn-primary" - action=(action "saveEmail") - type="submit" - disabled=saveDisabled - translatedLabel=saveButtonText - }} -
-
- {{/if}} - - -
+ +
+{{/d-section}} diff --git a/app/assets/javascripts/discourse/app/templates/preferences-second-factor.hbs b/app/assets/javascripts/discourse/app/templates/preferences-second-factor.hbs index efe337c2965..5adb85f9566 100644 --- a/app/assets/javascripts/discourse/app/templates/preferences-second-factor.hbs +++ b/app/assets/javascripts/discourse/app/templates/preferences-second-factor.hbs @@ -1,169 +1,171 @@ -
- {{#conditional-loading-spinner condition=loading}} -
- {{#if showEnforcedNotice}} -
-
-
{{i18n "user.second_factor.enforced_notice"}}
-
-
- {{/if}} - - {{#if displayOAuthWarning}} -
-
- {{i18n "user.second_factor.oauth_enabled_warning"}} -
-
- {{/if}} - - {{#if errorMessage}} -
-
-
{{errorMessage}}
-
-
- {{/if}} - - {{#if loaded}} -
-
-

{{i18n "user.second_factor.totp.title"}}

- {{d-button action=(action "createTotp") - class="btn-primary new-totp" - icon="plus" - disabled=loading - label="user.second_factor.totp.add"}} - {{#each totps as |totp|}} -
- {{#if totp.name}} - {{totp.name}} - {{else}} - {{i18n "user.second_factor.totp.default_name"}} - {{/if}} - - {{#if isCurrentUser}} - {{d-button action=(action "editSecondFactor" totp) - class="btn-default btn-small btn-icon pad-left no-text edit" - disabled=loading - icon="pencil-alt" - aria-label="user.second_factor.edit" - title="user.second_factor.edit" - }} - {{/if}} -
- {{/each}} -
-
- -
-
-

{{i18n "user.second_factor.security_key.title"}}

- {{d-button action=(action "createSecurityKey") - class="btn-primary new-security-key" - icon="plus" - disabled=loading - label="user.second_factor.security_key.add"}} - {{#each security_keys as |security_key|}} -
- {{#if security_key.name}} - {{security_key.name}} - {{else}} - {{i18n "user.second_factor.security_key.default_name"}} - {{/if}} - - {{#if isCurrentUser}} - {{d-button action=(action "editSecurityKey" security_key) - class="btn-default btn-small btn-icon pad-left no-text edit" - disabled=loading - icon="pencil-alt" - aria-label="user.second_factor.edit" - title="user.second_factor.edit" - }} - {{/if}} -
- {{/each}} -
-
- -
-
-

{{i18n "user.second_factor_backup.title"}}

- {{#if model.second_factor_enabled}} - {{#if model.second_factor_backup_enabled}} - {{html-safe (i18n "user.second_factor_backup.manage" count=model.second_factor_remaining_backup_codes)}} - {{else}} - {{i18n "user.second_factor_backup.enable_long"}} - {{/if}} - - {{#if isCurrentUser}} - {{d-button action=(action "editSecondFactorBackup") - class="btn-default btn-small btn-icon pad-left no-text edit edit-2fa-backup" - disabled=loading - icon="pencil-alt" - aria-label="user.second_factor.edit" - title="user.second_factor.edit" - }} - {{/if}} - {{else}} - {{i18n "user.second_factor_backup.enable_prerequisites"}} - {{/if}} -
-
- - {{#if model.second_factor_enabled}} - {{#unless showEnforcedNotice}} -
-
- {{d-button - class="btn-danger" - icon="ban" - action=(action "disableAllSecondFactors") - disabled=loading - label="user.second_factor.disable_all"}} -
+{{#d-section pageClass="user-preferences" tagName=""}} +
+ {{#conditional-loading-spinner condition=loading}} + + {{#if showEnforcedNotice}} +
+
+
{{i18n "user.second_factor.enforced_notice"}}
- {{/unless}} +
{{/if}} - {{else}} -
- -
-
- {{text-field value=password - id="password" - type="password" - classNames="input-large" - autofocus="autofocus"}} -
-
- {{i18n "user.second_factor.confirm_password_description"}} + {{#if displayOAuthWarning}} +
+
+ {{i18n "user.second_factor.oauth_enabled_warning"}}
-
+ {{/if}} -
-
- {{d-button - class="btn-primary" - type="submit" - action=(action "confirmPassword") - disabled=loading - label="continue"}} + {{#if errorMessage}} +
+
+
{{errorMessage}}
+
+
+ {{/if}} + {{#if loaded}} +
+
+

{{i18n "user.second_factor.totp.title"}}

+ {{d-button action=(action "createTotp") + class="btn-primary new-totp" + icon="plus" + disabled=loading + label="user.second_factor.totp.add"}} + {{#each totps as |totp|}} +
+ {{#if totp.name}} + {{totp.name}} + {{else}} + {{i18n "user.second_factor.totp.default_name"}} + {{/if}} + + {{#if isCurrentUser}} + {{d-button action=(action "editSecondFactor" totp) + class="btn-default btn-small btn-icon pad-left no-text edit" + disabled=loading + icon="pencil-alt" + aria-label="user.second_factor.edit" + title="user.second_factor.edit" + }} + {{/if}} +
+ {{/each}} +
+
+ +
+
+

{{i18n "user.second_factor.security_key.title"}}

+ {{d-button action=(action "createSecurityKey") + class="btn-primary new-security-key" + icon="plus" + disabled=loading + label="user.second_factor.security_key.add"}} + {{#each security_keys as |security_key|}} +
+ {{#if security_key.name}} + {{security_key.name}} + {{else}} + {{i18n "user.second_factor.security_key.default_name"}} + {{/if}} + + {{#if isCurrentUser}} + {{d-button action=(action "editSecurityKey" security_key) + class="btn-default btn-small btn-icon pad-left no-text edit" + disabled=loading + icon="pencil-alt" + aria-label="user.second_factor.edit" + title="user.second_factor.edit" + }} + {{/if}} +
+ {{/each}} +
+
+ +
+
+

{{i18n "user.second_factor_backup.title"}}

+ {{#if model.second_factor_enabled}} + {{#if model.second_factor_backup_enabled}} + {{html-safe (i18n "user.second_factor_backup.manage" count=model.second_factor_remaining_backup_codes)}} + {{else}} + {{i18n "user.second_factor_backup.enable_long"}} + {{/if}} + + {{#if isCurrentUser}} + {{d-button action=(action "editSecondFactorBackup") + class="btn-default btn-small btn-icon pad-left no-text edit edit-2fa-backup" + disabled=loading + icon="pencil-alt" + aria-label="user.second_factor.edit" + title="user.second_factor.edit" + }} + {{/if}} + {{else}} + {{i18n "user.second_factor_backup.enable_prerequisites"}} + {{/if}} +
+
+ + {{#if model.second_factor_enabled}} {{#unless showEnforcedNotice}} - {{cancel-link route="preferences.account" args=model.username}} +
+
+ {{d-button + class="btn-danger" + icon="ban" + action=(action "disableAllSecondFactors") + disabled=loading + label="user.second_factor.disable_all"}} +
+
{{/unless}} + {{/if}} + {{else}} +
+ + +
+
+ {{text-field value=password + id="password" + type="password" + classNames="input-large" + autofocus="autofocus"}} +
+
+ {{i18n "user.second_factor.confirm_password_description"}} +
+
-
- {{resetPasswordProgress}} - {{#unless resetPasswordLoading}} - {{ i18n "user.second_factor.forgot_password" }} - {{/unless}} + +
+
+ {{d-button + class="btn-primary" + type="submit" + action=(action "confirmPassword") + disabled=loading + label="continue"}} + + {{#unless showEnforcedNotice}} + {{cancel-link route="preferences.account" args=model.username}} + {{/unless}} +
+
+ {{resetPasswordProgress}} + {{#unless resetPasswordLoading}} + {{ i18n "user.second_factor.forgot_password" }} + {{/unless}} +
-
- {{/if}} - - {{/conditional-loading-spinner}} -
+ {{/if}} + + {{/conditional-loading-spinner}} +
+{{/d-section}} diff --git a/app/assets/javascripts/discourse/app/templates/preferences-username.hbs b/app/assets/javascripts/discourse/app/templates/preferences-username.hbs index c16dfddb896..6f0f758028f 100644 --- a/app/assets/javascripts/discourse/app/templates/preferences-username.hbs +++ b/app/assets/javascripts/discourse/app/templates/preferences-username.hbs @@ -1,39 +1,41 @@ -
-
+{{#d-section pageClass="user-preferences" tagName=""}} +
+ -
-
-

{{i18n "user.change_username.title"}}

+
+
+

{{i18n "user.change_username.title"}}

+
-
-
- -
- {{text-field value=newUsername id="change_username" classNames="input-xxlarge" maxlength=maxLength autofocus="autofocus" insert-newline="changeUsername"}} +
+ +
+ {{text-field value=newUsername id="change_username" classNames="input-xxlarge" maxlength=maxLength autofocus="autofocus" insert-newline="changeUsername"}} +
+
+

+ {{#if taken}} + {{i18n "user.change_username.taken"}} + {{/if}} + {{errorMessage}} +

+
-
-

- {{#if taken}} - {{i18n "user.change_username.taken"}} - {{/if}} - {{errorMessage}} -

-
-
-
-
- {{d-button - class="btn-primary" - action=(action "changeUsername") - type="submit" - disabled=saveDisabled - translatedLabel=saveButtonText - }} - {{#if saved}}{{i18n "saved"}}{{/if}} +
+
+ {{d-button + class="btn-primary" + action=(action "changeUsername") + type="submit" + disabled=saveDisabled + translatedLabel=saveButtonText + }} + {{#if saved}}{{i18n "saved"}}{{/if}} +
-
- -
+ +
+{{/d-section}}