2012-09-09 13:38:56 +09:00
|
|
|
(function() {
|
|
|
|
|
|
|
|
Template.comment_list.has_comments = function(){
|
2012-10-01 10:59:08 +09:00
|
|
|
var post = Posts.findOne(Session.get('selectedPostId'));
|
2012-09-09 13:38:56 +09:00
|
|
|
if(post){
|
|
|
|
return Comments.find({post: post._id, parent: null}).count() > 0;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
Template.comment_list.child_comments = function(){
|
2012-10-01 10:59:08 +09:00
|
|
|
var post = Posts.findOne(Session.get('selectedPostId'));
|
2012-09-20 08:09:45 +09:00
|
|
|
return Comments.find({post: post._id, parent: null}, {sort: {score: -1, submitted: -1}});
|
2012-09-09 13:38:56 +09:00
|
|
|
};
|
|
|
|
|
2012-09-11 11:09:16 +09:00
|
|
|
Template.comment_list.rendered = function(){
|
2012-09-19 10:05:02 +09:00
|
|
|
// t("comment_list");
|
2012-09-11 11:09:16 +09:00
|
|
|
}
|
|
|
|
|
2012-09-09 13:38:56 +09:00
|
|
|
})();
|