Add spinners to login and signup forms

This commit is contained in:
Neil Lalonde 2014-01-03 15:19:59 -05:00
parent 25caec0e62
commit 17f23adb78
5 changed files with 23 additions and 2 deletions

View File

@ -31,6 +31,9 @@ Discourse.LoginController = Discourse.Controller.extend(Discourse.ModalFunctiona
return this.get('loggingIn') || this.blank('loginName') || this.blank('loginPassword');
}.property('loginName', 'loginPassword', 'loggingIn'),
showSignupLink: function() {
return !Discourse.SiteSettings.invite_only && !this.get('loggingIn');
}.property('loggingIn'),
actions: {
login: function() {

View File

@ -68,5 +68,8 @@
<div class="modal-footer">
<button class='btn btn-large btn-primary' {{bindAttr disabled="submitDisabled"}} {{action createAccount}}>{{i18n create_account.title}}</button>
{{#if formSubmitted}}
&nbsp; <i class='fa fa-spinner fa-spin'></i>
{{/if}}
</div>
{{/unless}}

View File

@ -51,11 +51,15 @@
<i class="fa fa-unlock"></i>&nbsp;{{loginButtonText}}
</button>
{{#unless Discourse.SiteSettings.invite_only}}
{{#if showSignupLink}}
&nbsp; {{i18n create_account.invite}}
<a id="new-account-link" {{action showCreateAccount}}>
{{i18n create_account.action}}
</a>
{{/unless}}
{{/if}}
{{#if loggingIn}}
&nbsp; <i class='fa fa-spinner fa-spin'></i>
{{/if}}
{{/if}}
</div>

View File

@ -9,6 +9,7 @@
Discourse.LoginView = Discourse.ModalBodyView.extend({
templateName: 'modal/login',
title: I18n.t('login.title'),
classNames: ['login-modal'],
mouseMove: function(e) {

View File

@ -19,6 +19,12 @@
}
}
.login-modal {
.fa-spinner {
font-size: 18px;
}
}
// Create account
#new-account-link {
@ -46,4 +52,8 @@
color: #888;
}
}
.fa-spinner {
font-size: 18px;
}
}