Skip to content

Commit f37089a

Browse files
committed
feat(app): implement oauth-buttons directive
1 parent f16cb71 commit f37089a

38 files changed

+398
-190
lines changed

app/templates/Gruntfile.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,8 @@ module.exports = function (grunt) {
255255
'/es5-shim/'<% if(!filters.css) { %>,
256256
/font-awesome\.css/<% if(filters.bootstrap) { %>,
257257
/bootstrap\.css/<% if(filters.sass) { %>,
258-
/bootstrap-sass-official/<% }}} %>
258+
/bootstrap-sass-official/<% } if(filters.oauth) { %>,
259+
/bootstrap-social\.css/<% }}} %>
259260
]
260261
},
261262
client: {

app/templates/_bower.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
"json3": "~3.3.1",
77
"es5-shim": "~3.0.1",<% if(filters.bootstrap) { if (filters.sass) { %>
88
"bootstrap-sass-official": "~3.1.1",<% } %>
9-
"bootstrap": "~3.1.1",<% } %>
9+
"bootstrap": "~3.1.1",<% if(filters.oauth) { %>
10+
"bootstrap-social": "~4.9.1",<% }} %>
1011
"angular-resource": "~1.4.0",
1112
"angular-cookies": "~1.4.0",
1213
"angular-sanitize": "~1.4.0",<% if (filters.ngroute) { %>

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

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -41,18 +41,12 @@ <h1>Login</h1>
4141
Register
4242
</a>
4343
</div>
44-
<% if (filters.oauth) {%>
45-
<hr>
46-
<div><% if (filters.facebookAuth) {%>
47-
<a class="btn btn-facebook" href="" ng-click="loginOauth('facebook')">
48-
<i class="fa fa-facebook"></i> Connect with Facebook
49-
</a><% } %><% if (filters.googleAuth) {%>
50-
<a class="btn btn-google-plus" href="" ng-click="loginOauth('google')">
51-
<i class="fa fa-google-plus"></i> Connect with Google+
52-
</a><% } %><% if (filters.twitterAuth) {%>
53-
<a class="btn btn-twitter" href="" ng-click="loginOauth('twitter')">
54-
<i class="fa fa-twitter"></i> Connect with Twitter
55-
</a><% } %>
44+
<% if (filters.oauth) { %>
45+
<hr/>
46+
<div class="row">
47+
<div class="col-sm-4 col-md-3">
48+
<oauth-buttons classes="btn-block"></oauth-buttons>
49+
</div>
5650
</div><% } %>
5751
</form>
5852
</div>

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

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,8 @@ navbar
3939
<% if (filters.oauth) {%>
4040
hr
4141

42-
div<% if (filters.facebookAuth) {%>
43-
a.btn.btn-facebook(href='', ng-click='loginOauth("facebook")')
44-
i.fa.fa-facebook
45-
| Connect with Facebook
46-
= ' '<% } %><% if (filters.googleAuth) {%>
47-
a.btn.btn-google-plus(href='', ng-click='loginOauth("google")')
48-
i.fa.fa-google-plus
49-
| Connect with Google+
50-
= ' '<% } %><% if (filters.twitterAuth) {%>
51-
a.btn.btn-twitter(href='', ng-click='loginOauth("twitter")')
52-
i.fa.fa-twitter
53-
| Connect with Twitter<% } %><% } %>
42+
.row
43+
.col-sm-4.col-md-3
44+
oauth-buttons(classes='btn-block')
45+
<% } %>
5446
hr

app/templates/client/app/account(auth)/login/login(less).less

Lines changed: 0 additions & 30 deletions
This file was deleted.

app/templates/client/app/account(auth)/login/login(sass).scss

Lines changed: 0 additions & 30 deletions
This file was deleted.

app/templates/client/app/account(auth)/login/login(stylus).styl

Lines changed: 0 additions & 22 deletions
This file was deleted.

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use strict'
22

33
angular.module '<%= scriptAppName %>'
4-
.controller 'LoginCtrl', ($scope, Auth<% if (filters.ngroute) { %>, $location<% } %><% if (filters.uirouter) { %>, $state<% } %><% if (filters.oauth) {%>, $window<% } %>) ->
4+
.controller 'LoginCtrl', ($scope, Auth<% if (filters.ngroute) { %>, $location<% } %><% if (filters.uirouter) { %>, $state<% } %>) ->
55
$scope.user = {}
66
$scope.errors = {}
77
$scope.login = (form) ->
@@ -18,6 +18,3 @@ angular.module '<%= scriptAppName %>'
1818

1919
.catch (err) ->
2020
$scope.errors.other = err.message
21-
<% if (filters.oauth) {%>
22-
$scope.loginOauth = (provider) ->
23-
$window.location.href = '/auth/' + provider<% } %>

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

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

33
angular.module('<%= scriptAppName %>')
4-
.controller('LoginCtrl', function($scope, Auth<% if (filters.ngroute) { %>, $location<% } %><% if (filters.uirouter) { %>, $state<% } %><% if (filters.oauth) { %>, $window<% } %>) {
4+
.controller('LoginCtrl', function($scope, Auth<% if (filters.ngroute) { %>, $location<% } %><% if (filters.uirouter) { %>, $state<% } %>) {
55
$scope.user = {};
66
$scope.errors = {};
77

@@ -22,8 +22,5 @@ angular.module('<%= scriptAppName %>')
2222
});
2323
}
2424
};
25-
<% if (filters.oauth) {%>
26-
$scope.loginOauth = function(provider) {
27-
$window.location.href = '/auth/' + provider;
28-
};<% } %>
25+
2926
});

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

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -74,18 +74,12 @@ <h1>Sign up</h1>
7474
Login
7575
</a>
7676
</div>
77-
<% if (filters.oauth) {%>
78-
<hr>
79-
<div><% if (filters.facebookAuth) {%>
80-
<a class="btn btn-facebook" href="" ng-click="loginOauth('facebook')">
81-
<i class="fa fa-facebook"></i> Connect with Facebook
82-
</a><% } %><% if (filters.googleAuth) {%>
83-
<a class="btn btn-google-plus" href="" ng-click="loginOauth('google')">
84-
<i class="fa fa-google-plus"></i> Connect with Google+
85-
</a><% } %><% if (filters.twitterAuth) {%>
86-
<a class="btn btn-twitter" href="" ng-click="loginOauth('twitter')">
87-
<i class="fa fa-twitter"></i> Connect with Twitter
88-
</a><% } %>
77+
<% if (filters.oauth) { %>
78+
<hr/>
79+
<div class="row">
80+
<div class="col-sm-4 col-md-3">
81+
<oauth-buttons classes="btn-block"></oauth-buttons>
82+
</div>
8983
</div><% } %>
9084
</form>
9185
</div>

0 commit comments

Comments
 (0)