mirror of
https://github.com/vale981/Vulcan
synced 2025-03-10 12:36:39 -04:00
31 lines
No EOL
964 B
JavaScript
31 lines
No EOL
964 B
JavaScript
Template.user_profile.helpers({
|
|
avatarUrl: function() {
|
|
return getAvatarUrl(this);
|
|
},
|
|
canEditProfile: function() {
|
|
var currentUser = Meteor.user();
|
|
return currentUser && (this._id == currentUser._id || isAdmin(currentUser))
|
|
},
|
|
createdAtFormatted: function() {
|
|
return this.createdAt;
|
|
},
|
|
canInvite: function() {
|
|
// if the user is logged in, the target user hasn't been invited yet, invites are enabled, and user is not viewing their own profile
|
|
return Meteor.user() && Meteor.user()._id != this._id && !isInvited(this) && invitesEnabled() && canInvite(Meteor.user());
|
|
},
|
|
invitesCount: function() {
|
|
return Meteor.user().invitesCount;
|
|
},
|
|
getTwitterName: function () {
|
|
return getTwitterName(this);
|
|
},
|
|
getGitHubName: function () {
|
|
return getGitHubName(this);
|
|
}
|
|
});
|
|
|
|
Template.user_profile.events({
|
|
'click .invite-link': function(e, instance){
|
|
Meteor.call('inviteUser', instance.data.user._id);
|
|
}
|
|
}); |