Skip to content

Commit b3908f0

Browse files
committed
Merge pull request #322 from cevn/feature-buttons-signup
feat(app): added oauth buttons to signup page
2 parents 36df8ed + 1e8d816 commit b3908f0

File tree

4 files changed

+45
-5
lines changed

4 files changed

+45
-5
lines changed

app/templates/client/app/account(auth)/signup/signup(html).html

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,22 @@ <h1>Sign up</h1>
6262
Login
6363
</a>
6464
</div>
65+
66+
<% if(filters.facebookAuth || filters.twitterAuth || filters.googleAuth) {%>
67+
<hr>
68+
<div><% if(filters.facebookAuth) {%>
69+
<a class="btn btn-facebook" href="" ng-click="loginOauth('facebook')">
70+
<i class="fa fa-facebook"></i> Connect with Facebook
71+
</a><% } %><% if(filters.googleAuth) {%>
72+
<a class="btn btn-google-plus" href="" ng-click="loginOauth('google')">
73+
<i class="fa fa-google-plus"></i> Connect with Google+
74+
</a><% } %><% if(filters.twitterAuth) {%>
75+
<a class="btn btn-twitter" href="" ng-click="loginOauth('twitter')">
76+
<i class="fa fa-twitter"></i> Connect with Twitter
77+
</a><% } %>
78+
</div><% } %>
6579
</form>
6680
</div>
6781
</div>
68-
</div>
82+
<hr>
83+
</div>

app/templates/client/app/account(auth)/signup/signup(jade).jade

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,21 @@ div(ng-include='"components/navbar/navbar.html"')
3838
= ' '
3939
a.btn.btn-default.btn-lg.btn-register(href='/login')
4040
| Login
41+
42+
43+
<% if(filters.facebookAuth || filters.twitterAuth || filters.googleAuth) {%>
44+
hr
45+
46+
div<% if(filters.facebookAuth) {%>
47+
a.btn.btn-facebook(href='', ng-click='loginOauth("facebook")')
48+
i.fa.fa-facebook
49+
| Connect with Facebook
50+
= ' '<% } %><% if(filters.googleAuth) {%>
51+
a.btn.btn-google-plus(href='', ng-click='loginOauth("google")')
52+
i.fa.fa-google-plus
53+
| Connect with Google+
54+
= ' '<% } %><% if(filters.twitterAuth) {%>
55+
a.btn.btn-twitter(href='', ng-click='loginOauth("twitter")')
56+
i.fa.fa-twitter
57+
| Connect with Twitter<% } %><% } %>
58+
hr

app/templates/client/app/account(auth)/signup/signup.controller(coffee).coffee

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict'
22

3-
angular.module('<%= scriptAppName %>').controller 'SignupCtrl', ($scope, Auth, $location) ->
3+
angular.module('<%= scriptAppName %>').controller 'SignupCtrl', ($scope, Auth, $location, $window) ->
44
$scope.user = {}
55
$scope.errors = {}
66
$scope.register = (form) ->
@@ -22,4 +22,7 @@ angular.module('<%= scriptAppName %>').controller 'SignupCtrl', ($scope, Auth, $
2222
# Update validity of form fields that match the mongoose errors
2323
angular.forEach err.errors, (error, field) ->
2424
form[field].$setValidity 'mongoose', false
25-
$scope.errors[field] = error.message
25+
$scope.errors[field] = error.message
26+
27+
$scope.loginOauth = (provider) ->
28+
$window.location.href = '/auth/' + provider

app/templates/client/app/account(auth)/signup/signup.controller(js).js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use strict';
22

33
angular.module('<%= scriptAppName %>')
4-
.controller('SignupCtrl', function ($scope, Auth, $location) {
4+
.controller('SignupCtrl', function ($scope, Auth, $location, $window) {
55
$scope.user = {};
66
$scope.errors = {};
77

@@ -30,4 +30,8 @@ angular.module('<%= scriptAppName %>')
3030
});
3131
}
3232
};
33-
});
33+
34+
$scope.loginOauth = function(provider) {
35+
$window.location.href = '/auth/' + provider;
36+
};
37+
});

0 commit comments

Comments
 (0)