mirror of
https://github.com/vale981/Vulcan
synced 2025-03-10 04:26:41 -04:00
22 lines
734 B
JavaScript
22 lines
734 B
JavaScript
![]() |
Template[getTemplate('postMeta')].helpers({
|
||
|
pointsUnitDisplayText: function(){
|
||
|
return this.upvotes == 1 ? i18n.t('point') : i18n.t('points');
|
||
|
},
|
||
|
can_edit: function(){
|
||
|
return canEdit(Meteor.user(), this);
|
||
|
},
|
||
|
authorName: function(){
|
||
|
return getAuthorName(this);
|
||
|
},
|
||
|
ago: function(){
|
||
|
// if post is approved show submission time, else show creation time.
|
||
|
time = this.status == STATUS_APPROVED ? this.postedAt : this.createdAt;
|
||
|
return moment(time).fromNow();
|
||
|
},
|
||
|
profileUrl: function(){
|
||
|
// note: we don't want the post to be re-rendered every time user properties change
|
||
|
var user = Meteor.users.findOne(this.userId, {reactive: false});
|
||
|
if(user)
|
||
|
return getProfileUrl(user);
|
||
|
},
|
||
|
});
|