mirror of
https://github.com/vale981/Vulcan
synced 2025-03-10 12:36:39 -04:00
24 lines
866 B
JavaScript
24 lines
866 B
JavaScript
![]() |
Template[getTemplate('postsDaily')].helpers({
|
||
|
post_item: function () {
|
||
|
return getTemplate('post_item');
|
||
|
},
|
||
|
posts : function () {
|
||
|
if(this.postsList){ // XXX
|
||
|
this.postsList.rewind();
|
||
|
var posts = this.postsList.map(function (post, index, cursor) {
|
||
|
post.rank = index;
|
||
|
return post;
|
||
|
});
|
||
|
return posts;
|
||
|
}
|
||
|
},
|
||
|
hasMorePosts: function(){
|
||
|
// as long as we ask for N posts and all N posts showed up, then keep showing the "load more" button
|
||
|
return parseInt(Session.get('postsLimit')) == this.postsCount
|
||
|
},
|
||
|
loadMoreUrl: function () {
|
||
|
var count = parseInt(Session.get('postsLimit')) + parseInt(getSetting('postsPerPage', 10));
|
||
|
var categorySegment = Session.get('categorySlug') ? Session.get('categorySlug') + '/' : '';
|
||
|
return '/' + Session.get('view') + '/' + categorySegment + count;
|
||
|
}
|
||
|
});
|