mirror of
https://github.com/vale981/Vulcan
synced 2025-03-10 04:26:41 -04:00
24 lines
855 B
JavaScript
24 lines
855 B
JavaScript
Template.postContent.helpers({
|
|
sourceLink: function(){
|
|
return !!this.url ? this.url : "/posts/"+this._id;
|
|
},
|
|
current_domain: function(){
|
|
return "http://"+document.domain;
|
|
},
|
|
timestamp: function(){
|
|
time = this.status == Posts.config.STATUS_APPROVED ? this.postedAt : this.createdAt;
|
|
return moment(time).format("MMMM Do, h:mm:ss a");
|
|
},
|
|
userAvatar: function(){
|
|
// THIS FUNCTION IS DEPRECATED -- package bengott:avatar is used instead.
|
|
var author = Meteor.users.findOne(this.userId, {reactive: false});
|
|
if(!!author)
|
|
return Users.getAvatarUrl(author); // ALSO DEPRECATED
|
|
},
|
|
inactiveClass: function(){
|
|
return (Users.isAdmin(Meteor.user()) && this.inactive) ? i18n.t('inactive') : "";
|
|
},
|
|
commentsDisplayText: function(){
|
|
return this.comments == 1 ? i18n.t('comment') : i18n.t('comments');
|
|
}
|
|
});
|