mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: Add computed property to Create Account modal (#10455)
Carry over the regime used in the Login modal to Create Account to facilitate overriding of the classes set for the d-modal Component using a new Computed Property having the same naming convention.
This commit is contained in:
parent
872ef82f4d
commit
c164e9bbe0
@ -74,6 +74,14 @@ export default Controller.extend(
|
|||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@discourseComputed("userFields", "hasAtLeastOneLoginButton")
|
||||||
|
modalBodyClasses(userFields, hasAtLeastOneLoginButton) {
|
||||||
|
const classes = [];
|
||||||
|
if (userFields) classes.push("has-user-fields");
|
||||||
|
if (hasAtLeastOneLoginButton) classes.push("has-alt-auth");
|
||||||
|
return classes.join(" ");
|
||||||
|
},
|
||||||
|
|
||||||
@discourseComputed("authOptions", "authOptions.can_edit_username")
|
@discourseComputed("authOptions", "authOptions.can_edit_username")
|
||||||
usernameDisabled(authOptions, canEditUsername) {
|
usernameDisabled(authOptions, canEditUsername) {
|
||||||
return authOptions && !canEditUsername;
|
return authOptions && !canEditUsername;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{{#create-account email=accountEmail disabled=submitDisabled action=(action "createAccount")}}
|
{{#create-account email=accountEmail disabled=submitDisabled action=(action "createAccount")}}
|
||||||
{{#unless complete}}
|
{{#unless complete}}
|
||||||
{{plugin-outlet name="create-account-before-modal-body"}}
|
{{plugin-outlet name="create-account-before-modal-body"}}
|
||||||
{{#d-modal-body title="create_account.title" class=(concat (if hasAtLeastOneLoginButton "has-alt-auth") " " (if userFields "has-user-fields"))}}
|
{{#d-modal-body title="create_account.title" class=modalBodyClasses}}
|
||||||
|
|
||||||
{{#unless hasAuthOptions}}
|
{{#unless hasAuthOptions}}
|
||||||
{{login-buttons externalLogin=(action "externalLogin")}}
|
{{login-buttons externalLogin=(action "externalLogin")}}
|
||||||
|
Loading…
Reference in New Issue
Block a user