mirror of
https://github.com/vale981/Vulcan
synced 2025-03-06 10:01:40 -05:00
improving user dashboard
This commit is contained in:
parent
1c5c8fb575
commit
4e27e5c8c1
3 changed files with 5 additions and 13 deletions
|
@ -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>
|
||||
|
|
|
@ -8,7 +8,7 @@ Template.user_item.helpers({
|
|||
displayName: function(){
|
||||
return getDisplayName(this);
|
||||
},
|
||||
email: function(){
|
||||
getEmail: function(){
|
||||
return getEmail(this);
|
||||
},
|
||||
posts: function(){
|
||||
|
|
|
@ -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())
|
||||
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue