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

34 lines
1 KiB
JavaScript
Raw Normal View History

Template.postContent.helpers({
2014-12-13 17:43:52 +09:00
postThumbnail: function () {
return postThumbnail;
},
postHeading: function () {
return postHeading;
},
postMeta: function () {
return postMeta;
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(){
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");
},
userAvatar: function(){
// THIS FUNCTION IS DEPRECATED -- package bengott:avatar is used instead.
2014-07-04 14:07:50 +09:00
var author = Meteor.users.findOne(this.userId, {reactive: false});
if(!!author)
return Users.getAvatarUrl(author); // ALSO DEPRECATED
2014-07-04 14:07:50 +09:00
},
inactiveClass: function(){
return (Users.isAdmin(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');
}
2015-04-13 16:29:33 +09:00
});