Vulcan/client/templates/comment_list.js
2012-09-11 11:09:16 +09:00

19 lines
No EOL
460 B
JavaScript

(function() {
Template.comment_list.has_comments = function(){
var post = Posts.findOne(Session.get('selected_post_id'));
if(post){
return Comments.find({post: post._id, parent: null}).count() > 0;
}
};
Template.comment_list.child_comments = function(){
var post = Posts.findOne(Session.get('selected_post_id'));
return Comments.find({post: post._id, parent: null});
};
Template.comment_list.rendered = function(){
t("comment_list");
}
})();