highlight OP's comments

This commit is contained in:
Sacha Greif 2015-03-13 09:41:15 +09:00
parent 735f3cd17d
commit a1d304445d
3 changed files with 13 additions and 1 deletions

View file

@ -1,5 +1,5 @@
<template name="comment_item">
<li class="comment module comment-displayed" id="{{_id}}">
<li class="comment module comment-displayed {{commentClass}}" id="{{_id}}">
<div class="comment-body">
{{#if isDeleted}}
<div class="comment-deleted">This comment has been deleted.</div>

View file

@ -66,6 +66,12 @@ Template[getTemplate('comment_item')].helpers({
comment_item: function () {
return getTemplate('comment_item');
},
commentClass: function () {
// if this comment was made by the post author
if (Posts.findOne(this.postId).userId == this.userId) {
return 'author-comment';
}
},
full_date: function(){
return this.createdAt.toString();
},

View file

@ -316,4 +316,10 @@
}
#comment{
font-size: 16px;
}
.author-comment{
.comment-username{
background: #dfdfdf;
padding: 1px 5px;
}
}