2012-09-05 11:55:06 +09:00
|
|
|
|
|
|
|
|
2012-09-06 10:14:03 +09:00
|
|
|
Template.comment_page.show = function(){
|
2012-09-05 11:55:06 +09:00
|
|
|
return Session.equals('state', 'reply');
|
|
|
|
};
|
|
|
|
|
2012-09-06 10:14:03 +09:00
|
|
|
Template.comment_page.show_comment_form = function(){
|
2012-09-05 11:55:06 +09:00
|
|
|
return Meteor.user() !== null;
|
|
|
|
};
|
|
|
|
|
2012-09-06 10:14:03 +09:00
|
|
|
Template.comment_page.postLoaded = function(){
|
2012-09-05 11:55:06 +09:00
|
|
|
var selected_comment = Comments.findOne(Session.get('selected_comment_id'));
|
|
|
|
if(selected_comment){
|
|
|
|
return true;
|
|
|
|
}else{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-09-06 10:14:03 +09:00
|
|
|
Template.comment_page.post = function(){
|
2012-09-05 11:55:06 +09:00
|
|
|
var selected_comment = Comments.findOne(Session.get('selected_comment_id'));
|
|
|
|
if(selected_comment){
|
|
|
|
var post = selected_comment.post;
|
|
|
|
return Posts.findOne(post);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2012-09-06 10:14:03 +09:00
|
|
|
Template.comment_page.comment = function(){
|
2012-09-08 11:54:08 +09:00
|
|
|
var comment = Comments.findOne(Session.get('selected_comment_id'));
|
2012-09-06 10:14:03 +09:00
|
|
|
Template.comment_page.repress_recursion = true;
|
2012-09-05 11:55:06 +09:00
|
|
|
return comment;
|
2012-09-11 11:09:16 +09:00
|
|
|
};
|