Merge branch 'master' of github.com:SachaG/Telescope

This commit is contained in:
Sacha Greif 2013-04-19 17:32:18 +09:00
commit 0ae746c885
3 changed files with 7 additions and 4 deletions

View file

@ -38,7 +38,7 @@
<a href="{{categoryLink}}" class="post-category">{{name}}</a>
{{/each}}
</h3>
<p class="post-meta"><span class="points">{{votes}} <span class="unit">points </span></span>by <a class="post-author" href="/users/{{userId}}">{{authorName}}</a> <span class="post-time">{{ago}}</span><span class="comments">, <a class="go-to-comments" href="/posts/{{_id}}">{{comments}} comments</a></span>
<p class="post-meta"><span class="points">{{votes}} <span class="unit">points </span></span>by <a class="post-author" href="/users/{{userId}}">{{authorName}}</a> <span class="post-time">{{ago}}</span><span class="comments">, <a class="go-to-comments" href="/posts/{{_id}}">{{comments}} {{commentsDisplayText}}</a></span>
{{#if can_edit}}
| <a href="/posts/{{_id}}/edit" class="edit-link goto-edit">Edit</a>
{{/if}}

View file

@ -58,7 +58,10 @@ Template.post_item.helpers({
},
categoryLink: function(){
return getCategoryUrl(this.slug);
}
},
commentsDisplayText: function(){
return this.comments == 1 ? 'comment' : 'comments';
},
});
Template.post_item.rendered = function(){

View file

@ -12,7 +12,7 @@ Template.user_edit.helpers({
userEmail : function(){
var currentUser = Meteor.user();
if(Session.get('selectedUserId') && !currentUser.loading && currentUser.isAdmin){
currentUserMeteor.users.findOne(Session.get('selectedUserId'));
currentUser = Meteor.users.findOne(Session.get('selectedUserId'));
}
return getEmail(currentUser);
},
@ -64,4 +64,4 @@ Template.user_edit.events = {
});
}
};
};