Vulcan/client/views/comments/comment_list.js

11 lines
372 B
JavaScript
Raw Normal View History

Template.comment_list.helpers({
has_comments: function(){
2013-10-09 11:46:44 +09:00
// note: use this.post to access 'post' object in parent template
if(this.post){
return Comments.find({post: this.post._id, parent: null}).count() > 0;
}
},
child_comments: function(){
2013-10-09 11:46:44 +09:00
return Comments.find({post: this.post._id, parent: null}, {sort: {score: -1, submitted: -1}});
}
})