mirror of
https://github.com/discourse/discourse.git
synced 2025-01-18 17:02:45 +08:00
UX: When requiring user fields at signup, also mark default fields as required (#11356)
This commit is contained in:
parent
95355eb27b
commit
3ef60686ed
|
@ -99,14 +99,6 @@ export default Controller.extend(
|
|||
return authOptions && !canEditName;
|
||||
},
|
||||
|
||||
@discourseComputed
|
||||
fullnameRequired() {
|
||||
return (
|
||||
this.get("siteSettings.full_name_required") ||
|
||||
this.get("siteSettings.enable_names")
|
||||
);
|
||||
},
|
||||
|
||||
@discourseComputed("authOptions.auth_provider")
|
||||
passwordRequired(authProvider) {
|
||||
return isEmpty(authProvider);
|
||||
|
|
|
@ -17,7 +17,14 @@
|
|||
<table>
|
||||
<tbody>
|
||||
<tr class="input create-account-email">
|
||||
<td class="label"><label for="new-account-email">{{i18n "user.email.title"}}</label></td>
|
||||
<td class="label">
|
||||
<label for="new-account-email">
|
||||
{{i18n "user.email.title"}}
|
||||
{{~#if userFields~}}
|
||||
<span class="required">*</span>
|
||||
{{/if}}
|
||||
</label>
|
||||
</td>
|
||||
<td>
|
||||
{{#if emailValidated}}
|
||||
<span class="value">{{accountEmail}}</span>
|
||||
|
@ -34,7 +41,14 @@
|
|||
</tr>
|
||||
|
||||
<tr class="input">
|
||||
<td class="label"><label for="new-account-username">{{i18n "user.username.title"}}</label></td>
|
||||
<td class="label">
|
||||
<label for="new-account-username">
|
||||
{{i18n "user.username.title"}}
|
||||
{{~#if userFields~}}
|
||||
<span class="required">*</span>
|
||||
{{/if}}
|
||||
</label>
|
||||
</td>
|
||||
<td>
|
||||
{{#if usernameDisabled}}
|
||||
<span class="value">{{accountUsername}}</span>
|
||||
|
@ -49,10 +63,17 @@
|
|||
<td><label>{{i18n "user.username.instructions"}}</label></td>
|
||||
</tr>
|
||||
|
||||
{{#if fullnameRequired}}
|
||||
{{#if siteSettings.enable_names}}
|
||||
<tr class="input">
|
||||
<td class="label">
|
||||
<label for="new-account-name">{{i18n "user.name.title"}}</label>
|
||||
<label for="new-account-name">
|
||||
{{i18n "user.name.title"}}
|
||||
{{#if siteSettings.full_name_required}}
|
||||
{{~#if userFields~}}
|
||||
<span class="required">*</span>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
</label>
|
||||
</td>
|
||||
<td>
|
||||
{{#if nameDisabled}}
|
||||
|
@ -83,7 +104,14 @@
|
|||
|
||||
{{#if passwordRequired}}
|
||||
<tr class="input">
|
||||
<td class="label"><label for="new-account-password">{{i18n "user.password.title"}}</label></td>
|
||||
<td class="label">
|
||||
<label for="new-account-password">
|
||||
{{i18n "user.password.title"}}
|
||||
{{~#if userFields~}}
|
||||
<span class="required">*</span>
|
||||
{{/if}}
|
||||
</label>
|
||||
</td>
|
||||
<td>
|
||||
{{password-field value=accountPassword type="password" id="new-account-password" capsLockOn=capsLockOn}}
|
||||
</td>
|
||||
|
|
|
@ -339,6 +339,7 @@
|
|||
}
|
||||
}
|
||||
|
||||
.login-form,
|
||||
.user-field {
|
||||
.required {
|
||||
vertical-align: top;
|
||||
|
|
Loading…
Reference in New Issue
Block a user