import net.pterodactylus.sone.data.Post;
import net.pterodactylus.sone.data.Sone;
-import net.pterodactylus.util.collection.Pagination;
import net.pterodactylus.util.template.Template;
/**
}
});
- int page = request.getHttpRequest().getIntParam("page", 0);
- Pagination<Post> postPagination = new Pagination<Post>(allPosts, 25).setPage(page);
- List<Post> postsOnPage = postPagination.getItems();
- template.set("posts", postsOnPage);
- template.set("pagination", postPagination);
+ template.set("posts", allPosts);
}
//
<h1><%= Page.Index.PostList.Title|l10n|html></h1>
<div id="posts">
+ <%getpage>
+ <%paginate list=posts pagesize=2>
<%include include/pagination.html>
- <%foreach posts post>
+ <%foreach pagination.items post>
<%include include/viewPost.html>
<%foreachelse>
<div><%= Page.Index.PostList.Text.NoPostYet|l10n|html></div>