mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 10:59:51 +08:00
Add login buttons to create account template.
This commit is contained in:
parent
649329e420
commit
a0d0f859ba
|
@ -0,0 +1,16 @@
|
|||
export default Ember.Component.extend({
|
||||
elementId: 'login-buttons',
|
||||
classNameBindings: ['hidden'],
|
||||
|
||||
hidden: Em.computed.equal('buttons.length', 0),
|
||||
|
||||
buttons: function() {
|
||||
return Em.get('Discourse.LoginMethod.all');
|
||||
}.property(),
|
||||
|
||||
actions: {
|
||||
externalLogin: function(provider) {
|
||||
this.sendAction('action', provider);
|
||||
}
|
||||
}
|
||||
});
|
|
@ -3,6 +3,8 @@ import ModalFunctionality from 'discourse/mixins/modal-functionality';
|
|||
import DiscourseController from 'discourse/controllers/controller';
|
||||
|
||||
export default DiscourseController.extend(ModalFunctionality, {
|
||||
needs: ['login'],
|
||||
|
||||
uniqueUsernameValidation: null,
|
||||
globalNicknameExists: false,
|
||||
complete: false,
|
||||
|
@ -323,6 +325,10 @@ export default DiscourseController.extend(ModalFunctionality, {
|
|||
tosAcceptRequired: Discourse.computed.setting('tos_accept_required'),
|
||||
|
||||
actions: {
|
||||
externalLogin: function(provider) {
|
||||
this.get('controllers.login').send('externalLogin', provider);
|
||||
},
|
||||
|
||||
createAccount: function() {
|
||||
var self = this;
|
||||
this.set('formSubmitted', true);
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
{{#each buttons}}
|
||||
<button {{bind-attr class=":btn :btn-social name"}} {{action externalLogin this}}>{{title}}</button>
|
||||
{{/each}}
|
|
@ -1,5 +1,7 @@
|
|||
{{#unless complete}}
|
||||
<div class="modal-body">
|
||||
{{login-buttons action="externalLogin"}}
|
||||
|
||||
<div>
|
||||
<form>
|
||||
<table>
|
||||
|
|
|
@ -1,11 +1,5 @@
|
|||
<div class="modal-body">
|
||||
{{#if hasAtLeastOneLoginButton}}
|
||||
<div id="login-buttons">
|
||||
{{#each Discourse.LoginMethod.all}}
|
||||
<button class="btn btn-social {{unbound name}}" {{action externalLogin this}}>{{unbound title}}</button>
|
||||
{{/each}}
|
||||
</div>
|
||||
{{/if}}
|
||||
{{login-buttons action="externalLogin"}}
|
||||
{{#if Discourse.SiteSettings.enable_local_logins}}
|
||||
{{#if hasAtLeastOneLoginButton}}
|
||||
<h3 style="text-align:center; margin-bottom:10px;">{{i18n login.or}}</h3>
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
//= require ./discourse/models/composer
|
||||
//= require ./discourse/models/topic
|
||||
//= require ./discourse/controllers/controller
|
||||
//= require ./discourse/controllers/discovery-sortable
|
||||
//= require ./discourse/controllers/object
|
||||
//= require ./discourse/controllers/navigation/default
|
||||
//= require ./discourse/views/modal_body_view
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
moduleFor("controller:create-account", "controller:create-account", {
|
||||
needs: ['controller:modal']
|
||||
needs: ['controller:modal', 'controller:login']
|
||||
});
|
||||
|
||||
test('basicUsernameValidation', function() {
|
||||
|
|
Loading…
Reference in New Issue
Block a user