2014-07-05 11:24:28 +09:00
|
|
|
Template[getTemplate('posts_list')].helpers({
|
2014-12-15 09:46:51 +09:00
|
|
|
description: function () {
|
|
|
|
var controller = Iron.controller();
|
|
|
|
if (typeof controller.getDescription === 'function')
|
|
|
|
return Iron.controller().getDescription();
|
|
|
|
},
|
2014-11-30 14:36:00 +09:00
|
|
|
before_post_item: function () {
|
|
|
|
return getTemplate('before_post_item');
|
|
|
|
},
|
2014-07-05 11:42:28 +09:00
|
|
|
post_item: function () {
|
|
|
|
return getTemplate('post_item');
|
|
|
|
},
|
2014-11-30 14:36:00 +09:00
|
|
|
after_post_item: function () {
|
|
|
|
return getTemplate('after_post_item');
|
|
|
|
},
|
2013-10-29 16:55:59 +09:00
|
|
|
posts : function () {
|
2014-05-01 13:10:34 -07:00
|
|
|
if(this.postsList){ // XXX
|
|
|
|
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');
|
2014-09-15 12:42:17 +10:00
|
|
|
},
|
2014-09-16 15:29:11 +10:00
|
|
|
postsListIncoming: function () {
|
|
|
|
return getTemplate('postsListIncoming');
|
2012-12-20 21:17:07 +01:00
|
|
|
}
|
2014-09-15 12:42:17 +10:00
|
|
|
});
|
|
|
|
|
|
|
|
Template[getTemplate('posts_list')].created = function() {
|
|
|
|
Session.set('listPopulatedAt', new Date());
|
|
|
|
};
|