diff --git a/client/templates/comment.html b/client/templates/comment.html index 52edbf7c4..fb2251191 100644 --- a/client/templates/comment.html +++ b/client/templates/comment.html @@ -13,5 +13,12 @@
{{body}}
Reply + diff --git a/client/templates/comment.js b/client/templates/comment.js index 7bd48611e..41ff53c3e 100644 --- a/client/templates/comment.js +++ b/client/templates/comment.js @@ -10,3 +10,9 @@ Template.comment.ago = function(){ var submitted = new Date(this.submitted); return submitted.toString(); }; + +Template.comment.comments = function(){ + var post = Session.get('selected_post'); + var comments = Comments.find({ post: post._id, parent: this._id }); + return comments; +}; diff --git a/client/templates/comments.html b/client/templates/comments.html deleted file mode 100644 index 6c611af95..000000000 --- a/client/templates/comments.html +++ /dev/null @@ -1,11 +0,0 @@ - diff --git a/client/templates/comments.js b/client/templates/comments.js deleted file mode 100644 index 2cc3cce80..000000000 --- a/client/templates/comments.js +++ /dev/null @@ -1,11 +0,0 @@ -Template.comments.show = function(){ - var post = Session.get('selected_post'); - var comments = Comments.find({ post: post._id }); - return comments.count() > 0; -}; - -Template.comments.comments = function(){ - var post = Session.get('selected_post'); - var comments = Comments.find({ post: post._id }); - return comments; -}; diff --git a/client/templates/selected_post.html b/client/templates/selected_post.html index bedff9a31..8a83cbe70 100644 --- a/client/templates/selected_post.html +++ b/client/templates/selected_post.html @@ -1,11 +1,12 @@ diff --git a/client/templates/selected_post.js b/client/templates/selected_post.js index cf1d72228..4a1ce01ad 100644 --- a/client/templates/selected_post.js +++ b/client/templates/selected_post.js @@ -21,3 +21,15 @@ Template.selected_post.post = function(){ var post = Session.get('selected_post'); return post; }; + +Template.selected_post.has_comments = function(){ + var post = Session.get('selected_post'); + var comments = Comments.find({ post: post._id, parent: null }); + return comments.count() > 0; +}; + +Template.selected_post.comments = function(){ + var post = Session.get('selected_post'); + var comments = Comments.find({ post: post._id, parent: null }); + return comments; +};