适配NexT主题

pull/33/merge
ruibaby 2018-08-04 23:23:15 +08:00
parent 3095b58441
commit 601255a13f
5 changed files with 8 additions and 0 deletions

View File

@ -72,6 +72,7 @@ public class FrontArchiveController extends BaseController {
if (null == posts) {
return this.renderNotFound();
}
model.addAttribute("is_archives",true);
model.addAttribute("posts", posts);
return this.render("archives");
}
@ -92,6 +93,7 @@ public class FrontArchiveController extends BaseController {
if (null == posts) {
return this.renderNotFound();
}
model.addAttribute("is_archives",true);
model.addAttribute("posts", posts);
return this.render("archives");
}
@ -128,6 +130,7 @@ public class FrontArchiveController extends BaseController {
} else {
comments = commentService.findCommentsByPostAndCommentStatusNot(post, CommentStatusEnum.RECYCLE.getCode());
}
model.addAttribute("is_post",true);
model.addAttribute("post", post);
model.addAttribute("comments", CommentUtil.getComments(comments));
model.addAttribute("commentsCount", comments.size());

View File

@ -45,6 +45,7 @@ public class FrontCategoryController extends BaseController {
* @param model model
* @return String
*/
@GetMapping
public String categories(Model model) {
List<Category> categories = categoryService.findAllCategories();
model.addAttribute("categories", categories);
@ -87,6 +88,7 @@ public class FrontCategoryController extends BaseController {
}
Pageable pageable = PageRequest.of(page - 1, size, sort);
Page<Post> posts = postService.findPostByCategories(category, pageable);
model.addAttribute("is_categories",true);
model.addAttribute("posts", posts);
model.addAttribute("category", category);
return this.render("category");

View File

@ -75,6 +75,7 @@ public class FrontIndexController extends BaseController {
if (null == posts) {
return this.renderNotFound();
}
model.addAttribute("is_index",true);
model.addAttribute("posts", posts);
return this.render("index");
}

View File

@ -83,6 +83,7 @@ public class FrontPageController extends BaseController {
} else {
comments = commentService.findCommentsByPostAndCommentStatusNot(post, CommentStatusEnum.RECYCLE.getCode());
}
model.addAttribute("is_page",true);
model.addAttribute("post", post);
model.addAttribute("comments", CommentUtil.getComments(comments));
model.addAttribute("commentsCount", comments.size());

View File

@ -83,6 +83,7 @@ public class FrontTagController extends BaseController {
}
Pageable pageable = PageRequest.of(page - 1, size, sort);
Page<Post> posts = postService.findPostsByTags(tag, pageable);
model.addAttribute("is_tags",true);
model.addAttribute("posts", posts);
model.addAttribute("tag", tag);
return this.render("tag");