Adding classes to login for external auth and user fields (#6535)
This commit is contained in:
parent
b2585524a9
commit
7c2618e914
|
@ -9,6 +9,7 @@ import UsernameValidation from "discourse/mixins/username-validation";
|
|||
import NameValidation from "discourse/mixins/name-validation";
|
||||
import UserFieldsValidation from "discourse/mixins/user-fields-validation";
|
||||
import { userPath } from "discourse/lib/url";
|
||||
import { findAll } from "discourse/models/login-method";
|
||||
|
||||
export default Ember.Controller.extend(
|
||||
ModalFunctionality,
|
||||
|
@ -176,6 +177,11 @@ export default Ember.Controller.extend(
|
|||
}
|
||||
}.observes("emailValidation", "accountEmail"),
|
||||
|
||||
// Determines whether at least one login button is enabled
|
||||
hasAtLeastOneLoginButton: function() {
|
||||
return findAll(this.siteSettings).length > 0;
|
||||
}.property(),
|
||||
|
||||
@on("init")
|
||||
fetchConfirmationValue() {
|
||||
return ajax(userPath("hp.json")).then(json => {
|
||||
|
|
|
@ -57,9 +57,10 @@ export default Ember.Controller.extend(ModalFunctionality, {
|
|||
},
|
||||
|
||||
// Determines whether at least one login button is enabled
|
||||
hasAtLeastOneLoginButton: function() {
|
||||
return findAll(this.siteSettings).length > 0;
|
||||
}.property(),
|
||||
@computed("canLoginLocalWithEmail")
|
||||
hasAtLeastOneLoginButton(canLoginLocalWithEmail) {
|
||||
return findAll(this.siteSettings).length > 0 || canLoginLocalWithEmail;
|
||||
},
|
||||
|
||||
@computed("loggingIn")
|
||||
loginButtonLabel(loggingIn) {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{{#create-account email=accountEmail disabled=submitDisabled action="createAccount"}}
|
||||
{{#unless complete}}
|
||||
{{#d-modal-body title="create_account.title"}}
|
||||
{{#d-modal-body title="create_account.title" class=(concat (if hasAtLeastOneLoginButton "has-alt-auth") " " (if userFields "has-user-fields"))}}
|
||||
|
||||
{{#unless hasAuthOptions}}
|
||||
{{login-buttons externalLogin="externalLogin"}}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{{#login-modal screenX=lastX screenY=lastY loginName=loginName loginPassword=loginPassword loginSecondFactor=loginSecondFactor action="login"}}
|
||||
{{#d-modal-body title="login.title" class="login-modal"}}
|
||||
{{#d-modal-body title="login.title" class=(concat "login-modal" " " (if hasAtLeastOneLoginButton "has-alt-auth"))}}
|
||||
|
||||
{{#if canLoginLocal}}
|
||||
<form id='login-form' method='post'>
|
||||
|
|
Loading…
Reference in New Issue