Vulcan/packages/telescope-posts/lib/client/templates/modules/post_content.js
2015-05-18 10:30:08 +09:00

18 lines
606 B
JavaScript

Template.post_content.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');
}
});