2012-09-18 12:21:43 +09:00
|
|
|
Template.user_item.rendered = function(){
|
|
|
|
};
|
2012-09-18 15:43:37 +09:00
|
|
|
|
|
|
|
Template.user_item.avatar_url = function(){
|
|
|
|
return Gravatar.getGravatar(this, {
|
|
|
|
d: 'http://telescope.herokuapp.com/img/default_avatar.png',
|
|
|
|
s: 30
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
|
|
|
Template.user_item.created_at_formatted = function(){
|
2012-09-18 16:23:33 +09:00
|
|
|
// return moment(this.created_at).format("MMMM Do YYYY, HH:mm");
|
|
|
|
return moment(this.created_at).fromNow();
|
|
|
|
}
|
|
|
|
|
|
|
|
Template.user_item.email = function(){
|
|
|
|
return this.emails[0].email;
|
|
|
|
}
|
|
|
|
|
|
|
|
Template.user_item.posts_count = function(){
|
|
|
|
console.log("------- \n user:", this.username);
|
|
|
|
Posts.find({'user_id':this._id}).forEach(function(post){console.log(post.headline);});
|
|
|
|
return Posts.find({'user_id':this._id}).count();
|
|
|
|
}
|
|
|
|
|
|
|
|
Template.user_item.comments_count = function(){
|
|
|
|
// Posts.find({'user_id':this._id}).forEach(function(post){console.log(post.headline);});
|
|
|
|
return Comments.find({'user_id':this._id}).count();
|
2012-09-18 15:43:37 +09:00
|
|
|
}
|