Vulcan/client/views/comments/comment_list.js
2013-10-21 23:07:36 +08:00

16 lines
No EOL
475 B
JavaScript

Template.comment_list.created = function(){
postObject = this.data;
}
Template.comment_list.helpers({
has_comments: function(){
var post = this;
var comments = Comments.find({post: post._id, parent: null}, {sort: {score: -1, submitted: -1}});
return comments.count() > 0;
},
child_comments: function(){
var post = this;
var comments = Comments.find({post: post._id, parent: null}, {sort: {score: -1, submitted: -1}});
return comments;
}
});