Vulcan/packages/telescope-posts/lib/client/templates/modules/post_content.js

19 lines
605 B
JavaScript
Raw Normal View History

Template.postContent.helpers({
2014-07-04 14:07:50 +09:00
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;
2014-07-04 14:07:50 +09:00
return moment(time).format("MMMM Do, h:mm:ss a");
},
inactiveClass: function(){
2015-04-27 17:14:07 +09:00
return (Users.is.admin(Meteor.user()) && this.inactive) ? i18n.t('inactive') : "";
2014-07-04 14:07:50 +09:00
},
commentsDisplayText: function(){
return this.comments === 1 ? i18n.t('comment') : i18n.t('comments');
2014-07-04 14:07:50 +09:00
}
2015-04-13 16:29:33 +09:00
});