improving user dashboard

This commit is contained in:
Sacha Greif 2013-11-08 11:15:02 +09:00
parent 1c5c8fb575
commit 4e27e5c8c1
3 changed files with 5 additions and 13 deletions

View file

@ -3,16 +3,9 @@
<td><span class="user-avatar" style="background-image:url({{avatarUrl}});"></span></td>
<td><a href="{{profileUrl}}">{{displayName}}</a></td>
<td>{{createdAtFormatted}}</td>
<td>{{profile.email}}</td>
<td>
<a href="#">{{postCount}}</a>
<ul class="posts-list hidden">
{{#each posts}}
<li><a href="/posts/{{_id}}">{{headline}}</a></li>
{{/each}}
</ul>
</td>
<td><a href="#">{{commentCount}}</a></td>
<td>{{getEmail}}</td>
<td>{{postCount}}</td>
<td>{{commentCount}}</td>
<td>{{getKarma}}</td>
<td>{{#if isInvited}}<a class="uninvite-link" href="#"><i class="icon-check"></i>Uninvite</a>{{else}}<a href="#" class="invite-link">Invite</a>{{/if}}</td>
<td>{{#if userIsAdmin}}<a class="unadmin-link" href="#"><i class="icon-check unadmin-link"></i>Unadmin</a>{{else}}<a href="#" class="admin-link">Make admin</a>{{/if}}</td>

View file

@ -8,7 +8,7 @@ Template.user_item.helpers({
displayName: function(){
return getDisplayName(this);
},
email: function(){
getEmail: function(){
return getEmail(this);
},
posts: function(){

View file

@ -36,11 +36,10 @@ Meteor.methods({
// update postCount
var postsByUser = Posts.find({userId: user._id});
Meteor.users.update(user._id, {$set: {postCount: postsByUser.count()}});
console.log(postsByUser.count())
// update commentCount
var commentsByUser = Comments.find({userId: user._id});
Meteor.users.update(user._id, {$set: {commentCount: commentsByUser.count()}});
console.log(commentsByUser.count())
});
}