user list tweaks

This commit is contained in:
Sacha Greif 2012-09-19 10:15:03 +09:00
parent 6651b5c47f
commit c5c78e8336
3 changed files with 7 additions and 1 deletions

View file

@ -6,7 +6,7 @@
<td>{{email}}</td>
<td>
<a href="#">{{posts_count}}</a>
<ul class="posts-list">
<ul class="posts-list hidden">
{{#each posts}}
<li><a href="/posts/{{_id}}">{{headline}}</a></li>
{{/each}}
@ -14,5 +14,6 @@
</td>
<td><a href="#">{{comments_count}}</a></td>
<td>{{karma}}</td>
<td>{{#if is_admin}}<i class="icon-check"></i>{{/if}}</td>
</tr>
</template>

View file

@ -34,4 +34,8 @@ Template.user_item.comments = function(){
Template.user_item.comments_count = function(){
// Posts.find({'user_id':this._id}).forEach(function(post){console.log(post.headline);});
return Comments.find({'user_id':this._id}).count();
}
Template.user_item.is_admin = function(){
return isAdmin(this);
}

View file

@ -11,6 +11,7 @@
<td>Posts</td>
<td>Comments</td>
<td>Karma</td>
<td>Is Admin?</td>
</tr>
</thead>
<tbody>