Vulcan/client/views/posts/post_list/posts_list.js

34 lines
932 B
JavaScript
Raw Normal View History

Template[getTemplate('posts_list')].created = function() {
Session.set('listPopulatedAt', new Date());
};
2014-07-05 11:24:28 +09:00
Template[getTemplate('posts_list')].helpers({
description: function () {
var controller = Iron.controller();
if (typeof controller.getDescription === 'function')
return Iron.controller().getDescription();
},
before_post_item: function () {
return getTemplate('before_post_item');
},
2014-07-05 11:42:28 +09:00
post_item: function () {
return getTemplate('post_item');
},
after_post_item: function () {
return getTemplate('after_post_item');
},
2013-10-29 16:55:59 +09:00
posts : function () {
this.postsList.rewind();
var posts = this.postsList.map(function (post, index, cursor) {
post.rank = index;
return post;
});
return posts;
2013-10-29 16:55:59 +09:00
},
2014-08-28 10:16:17 +09:00
postsLoadMore: function () {
return getTemplate('postsLoadMore');
},
postsListIncoming: function () {
return getTemplate('postsListIncoming');
}
});