Vulcan/packages/telescope-posts/lib/client/templates/post_item.js

31 lines
791 B
JavaScript
Raw Normal View History

2014-07-04 14:07:50 +09:00
var post = {};
Template.post_item.created = function () {
2014-07-04 14:07:50 +09:00
post = this.data;
2013-10-28 13:35:20 +09:00
};
Template.post_item.helpers({
2014-12-13 17:43:52 +09:00
postModules: function () {
return postModules;
},
2014-07-08 09:06:49 +09:00
moduleContext: function () { // not used for now
var module = this;
module.templateClass = Telescope.utils.camelToDash(this.template) + ' ' + this.position + ' cell';
2014-07-08 09:06:49 +09:00
module.post = post;
return module;
2014-07-07 11:51:59 +09:00
},
2014-07-07 12:22:42 +09:00
moduleClass: function () {
return Telescope.utils.camelToDash(this.template) + ' post-module';
},
postClass: function () {
var post = this;
2015-01-21 10:38:59 +09:00
var postAuthorClass = "author-"+post.author;
var postClass = Posts.hooks.classCallbacks.reduce(function(result, currentFunction) {
return currentFunction(post, result);
}, postAuthorClass);
2015-04-13 16:29:33 +09:00
return postClass;
}
2012-10-01 14:52:32 +09:00
});