Vulcan/packages/telescope-posts/lib/client/templates/modules/post_content.js
2015-05-13 11:01:03 +09:00

18 lines
605 B
JavaScript

Template.postContent.helpers({
sourceLink: function(){
return !!this.url ? this.url : "/posts/"+this._id;
},
current_domain: function(){
return "http://"+document.domain;
},
timestamp: function(){
var time = this.status === Posts.config.STATUS_APPROVED ? this.postedAt : this.createdAt;
return moment(time).format("MMMM Do, h:mm:ss a");
},
inactiveClass: function(){
return (Users.is.admin(Meteor.user()) && this.inactive) ? i18n.t('inactive') : "";
},
commentsDisplayText: function(){
return this.comments === 1 ? i18n.t('comment') : i18n.t('comments');
}
});