mirror of https://github.com/halo-dev/halo
Fixed Controller model.
parent
12483118af
commit
8176451e5a
|
@ -52,7 +52,8 @@ public class ContentCategoryController {
|
||||||
* @return template path: themes/{theme}/categories.ftl
|
* @return template path: themes/{theme}/categories.ftl
|
||||||
*/
|
*/
|
||||||
@GetMapping
|
@GetMapping
|
||||||
public String categories() {
|
public String categories(Model model) {
|
||||||
|
model.addAttribute("is_categories", true);
|
||||||
return themeService.render("categories");
|
return themeService.render("categories");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -89,7 +90,7 @@ public class ContentCategoryController {
|
||||||
Page<Post> posts = postCategoryService.pagePostBy(category.getId(), pageable);
|
Page<Post> posts = postCategoryService.pagePostBy(category.getId(), pageable);
|
||||||
final int[] rainbow = PageUtil.rainbow(page, posts.getTotalPages(), 3);
|
final int[] rainbow = PageUtil.rainbow(page, posts.getTotalPages(), 3);
|
||||||
|
|
||||||
model.addAttribute("is_categories", true);
|
model.addAttribute("is_category", true);
|
||||||
model.addAttribute("posts", posts);
|
model.addAttribute("posts", posts);
|
||||||
model.addAttribute("rainbow", rainbow);
|
model.addAttribute("rainbow", rainbow);
|
||||||
model.addAttribute("category", category);
|
model.addAttribute("category", category);
|
||||||
|
|
|
@ -60,7 +60,6 @@ public class ContentSheetController {
|
||||||
*/
|
*/
|
||||||
@GetMapping(value = "/s/{url}")
|
@GetMapping(value = "/s/{url}")
|
||||||
public String sheet(@PathVariable(value = "url") String url,
|
public String sheet(@PathVariable(value = "url") String url,
|
||||||
@RequestParam(value = "cp", defaultValue = "1") Integer cp,
|
|
||||||
Model model) {
|
Model model) {
|
||||||
Sheet sheet = sheetService.getBy(PostStatus.PUBLISHED, url);
|
Sheet sheet = sheetService.getBy(PostStatus.PUBLISHED, url);
|
||||||
|
|
||||||
|
|
|
@ -56,7 +56,8 @@ public class ContentTagController {
|
||||||
* @return template path: themes/{theme}/tags.ftl
|
* @return template path: themes/{theme}/tags.ftl
|
||||||
*/
|
*/
|
||||||
@GetMapping
|
@GetMapping
|
||||||
public String tags() {
|
public String tags(Model model) {
|
||||||
|
model.addAttribute("is_tags", true);
|
||||||
return themeService.render("tags");
|
return themeService.render("tags");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -93,7 +94,7 @@ public class ContentTagController {
|
||||||
Page<PostListVO> posts = postService.convertToListVo(postPage);
|
Page<PostListVO> posts = postService.convertToListVo(postPage);
|
||||||
final int[] rainbow = PageUtil.rainbow(page, posts.getTotalPages(), 3);
|
final int[] rainbow = PageUtil.rainbow(page, posts.getTotalPages(), 3);
|
||||||
|
|
||||||
model.addAttribute("is_tags", true);
|
model.addAttribute("is_tag", true);
|
||||||
model.addAttribute("posts", posts);
|
model.addAttribute("posts", posts);
|
||||||
model.addAttribute("rainbow", rainbow);
|
model.addAttribute("rainbow", rainbow);
|
||||||
model.addAttribute("tag", tag);
|
model.addAttribute("tag", tag);
|
||||||
|
|
Loading…
Reference in New Issue