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

27 lines
649 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-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
},
postClass: function () {
var post = this;
var postClass = "post ";
postClass += "author-"+Telescope.utils.slugify(post.author)+" ";
if (this.sticky) {
postClass += "sticky ";
}
2015-08-03 20:02:54 +09:00
postClass = Telescope.callbacks.run("postClass", postClass, post);
return postClass;
}
2012-10-01 14:52:32 +09:00
});