import net.pterodactylus.sone.data.Post;
import net.pterodactylus.sone.data.Sone;
-import net.pterodactylus.util.collection.Pagination;
import net.pterodactylus.util.template.Template;
/**
* The Sone web interface
*/
public IndexPage(Template template, WebInterface webInterface) {
- super("index.html", template, "Page.Index.Title", webInterface);
+ super("index.html", template, "Page.Index.Title", webInterface, true);
}
//
}
});
- 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);
- }
-
- //
- // SONETEMPLATEPAGE METHODS
- //
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected boolean requiresLogin() {
- return true;
+ template.set("posts", allPosts);
}
}