FIX: do not show full name field when accepting invite if full names are disabled

https://meta.discourse.org/t/require-password-for-trusted-user-invites/13750/58?u=techapj
This commit is contained in:
Arpit Jalan 2017-08-27 12:15:32 +05:30
parent a77ede05e2
commit be972912cb
2 changed files with 12 additions and 5 deletions

View File

@ -38,6 +38,11 @@ export default Ember.Controller.extend(PasswordValidation, UsernameValidation, N
return usernameFailed || passwordFailed || nameFailed || userFieldsFailed;
},
@computed
fullnameRequired() {
return this.siteSettings.full_name_required || this.siteSettings.enable_names;
},
actions: {
submit() {

View File

@ -30,11 +30,13 @@
<div class="instructions">{{i18n 'user.username.instructions'}}</div>
</div>
<div class="input name-input">
<label>{{i18n 'invites.name_label'}}</label>
{{input value=accountName id="new-account-name" name="name"}}
<div class="instructions">{{nameInstructions}}</div>
</div>
{{#if fullnameRequired}}
<div class="input name-input">
<label>{{i18n 'invites.name_label'}}</label>
{{input value=accountName id="new-account-name" name="name"}}
<div class="instructions">{{nameInstructions}}</div>
</div>
{{/if}}
<div class="input password-input">
<label>{{i18n 'invites.password_label'}}</label>