use of com.nixmash.blog.jpa.enums.PostType in project nixmash-blog by mintster.
the class AdminPostsController method addPostLink.
// endregion
// region Add Post GET
@RequestMapping(value = "/add/{type}", method = GET)
public String addPostLink(@PathVariable("type") String type, Model model, HttpServletRequest request) {
PostType postType = PostType.valueOf(type.toUpperCase());
model.addAttribute("postDTO", new PostDTO());
model.addAttribute("canPreview", false);
model.addAttribute("categories", postService.getAdminSelectionCategories());
if (postType == PostType.POST) {
WebUtils.setSessionAttribute(request, SESSION_ATTRIBUTE_NEWPOST, null);
model.addAttribute("hasPost", true);
model.addAttribute("postheader", webUI.getMessage(ADD_POST_HEADER));
return ADMIN_POST_ADD_VIEW;
} else {
model.addAttribute("postLink", new PostLink());
model.addAttribute("postheader", webUI.getMessage(ADD_LINK_HEADER));
return ADMIN_LINK_ADD_VIEW;
}
}