- Collections.sort(allPosts, Post.TIME_COMPARATOR);
- template.set("posts", allPosts);
+ allPosts = Collections2.filter(allPosts, new Predicate<Post>() {
+
+ @Override
+ public boolean apply(Post post) {
+ return ListNotificationFilters.isPostVisible(currentSone, post);
+ }
+ });
+ allPosts = Collections2.filter(allPosts, Post.FUTURE_POSTS_FILTER);
+ List<Post> sortedPosts = new ArrayList<Post>(allPosts);
+ Collections.sort(sortedPosts, Post.TIME_COMPARATOR);
+ Pagination<Post> pagination = new Pagination<Post>(sortedPosts, webInterface.getCore().getPreferences().getPostsPerPage()).setPage(Numbers.safeParseInteger(request.getHttpRequest().getParam("page"), 0));
+ templateContext.set("pagination", pagination);
+ templateContext.set("posts", pagination.getItems());