-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.js
43 lines (38 loc) · 1.28 KB
/
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
Avatar.options = {
fallbackType: 'initials',
gravatarDefault: 'identicon'
//defaultImageUrl: 'img/avatar.jpg'
};
if (Meteor.isServer) {
Meteor.startup(function () {
console.log('startup...');
console.log('options:', Avatar.options);
console.log('url:', Avatar.getUrl());
});
}
if (Meteor.isClient) {
Accounts.ui.config({ passwordSignupFields: 'USERNAME_AND_EMAIL' });
Template.body.helpers({
users: function () {
return Meteor.users.find().fetch();
},
service: function (user) {
if (user && user.services && user.services.twitter) { return 'twitter'; }
else if (user && user.services && user.services.facebook) { return 'facebook'; }
else if (user && user.services && user.services.google) { return 'google'; }
else if (user && user.services && user.services.github) { return 'github'; }
else if (user && user.services && user.services.instagram) { return 'instagram'; }
else { return 'none'; }
},
name: function (user) {
var name = '';
if (user && user.profile && user.profile.name) {
name = user.profile.name;
}
else if (user && user.username) {
name = user.username;
}
return name;
}
});
}