diff --git a/src/main/java/cc/ryanc/halo/web/controller/admin/AttachmentController.java b/src/main/java/cc/ryanc/halo/web/controller/admin/AttachmentController.java index ce7a5331d..149d74078 100755 --- a/src/main/java/cc/ryanc/halo/web/controller/admin/AttachmentController.java +++ b/src/main/java/cc/ryanc/halo/web/controller/admin/AttachmentController.java @@ -8,6 +8,7 @@ import cc.ryanc.halo.service.AttachmentService; import cc.ryanc.halo.service.LogsService; import cc.ryanc.halo.utils.HaloUtils; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.Page; import org.springframework.data.domain.PageRequest; @@ -81,12 +82,16 @@ public class AttachmentController { @GetMapping(value = "/select") public String selectAttachment(Model model, @RequestParam(value = "page", defaultValue = "0") Integer page, - @RequestParam(value = "id") String id) { + @RequestParam(value = "id",defaultValue = "none") String id, + @RequestParam(value = "type",defaultValue = "normal") String type) { Sort sort = new Sort(Sort.Direction.DESC, "attachId"); Pageable pageable = PageRequest.of(page, 18, sort); Page attachments = attachmentService.findAllAttachments(pageable); model.addAttribute("attachments", attachments); model.addAttribute("id", id); + if(StringUtils.equals(type,"post")){ + return "admin/widget/_attachment-select-post"; + } return "admin/widget/_attachment-select"; } diff --git a/src/main/resources/templates/admin/admin_index.ftl b/src/main/resources/templates/admin/admin_index.ftl index b37467e07..70bfd56da 100755 --- a/src/main/resources/templates/admin/admin_index.ftl +++ b/src/main/resources/templates/admin/admin_index.ftl @@ -177,7 +177,7 @@ - + diff --git a/src/main/resources/templates/admin/admin_page.ftl b/src/main/resources/templates/admin/admin_page.ftl index d9713388c..d322880d9 100755 --- a/src/main/resources/templates/admin/admin_page.ftl +++ b/src/main/resources/templates/admin/admin_page.ftl @@ -100,7 +100,7 @@ <#else> - + diff --git a/src/main/resources/templates/admin/admin_page_md_editor.ftl b/src/main/resources/templates/admin/admin_page_md_editor.ftl index 3559942fc..43100d5b5 100755 --- a/src/main/resources/templates/admin/admin_page_md_editor.ftl +++ b/src/main/resources/templates/admin/admin_page_md_editor.ftl @@ -12,11 +12,19 @@ #post_title{ font-weight: 400; } + #btnOpenAttach{margin-left:4px;padding:3px 6px;position:relative;top:-4px;border:1px solid #ccc;border-radius:2px;background:#fff;text-shadow:none;font-weight:600;font-size:12px;line-height:normal;color:#3c8dbc;cursor:pointer;transition:all .2s ease-in-out} + #btnOpenAttach:hover{background:#3c8dbc;color:#fff} + .form-horizontal .control-label{ + text-align: left; + }
-

+

新建页面

+ + 附件库 +
- + <#if post.postTitle?length gt 20> + + <#else > + + - + diff --git a/src/main/resources/templates/admin/admin_post_md_editor.ftl b/src/main/resources/templates/admin/admin_post_md_editor.ftl index 48b75c7a8..1ab4877bb 100755 --- a/src/main/resources/templates/admin/admin_post_md_editor.ftl +++ b/src/main/resources/templates/admin/admin_post_md_editor.ftl @@ -13,11 +13,17 @@ #post_title{ font-weight: 400; } + #btnOpenAttach{margin-left:4px;padding:3px 6px;position:relative;top:-4px;border:1px solid #ccc;border-radius:2px;background:#fff;text-shadow:none;font-weight:600;font-size:12px;line-height:normal;color:#3c8dbc;cursor:pointer;transition:all .2s ease-in-out} + #btnOpenAttach:hover{background:#3c8dbc;color:#fff} + .form-horizontal .control-label{ + text-align: left; + }
-

- 新建文章 -

+

新建文章

+ + 附件库 +
标题标题 状态 日期
暂无页面暂无页面
${post.postTitle}${post.postTitle?substring(0,20)}...${post.postTitle} <#if post.categories?size gt 0> <#list post.categories as cate> @@ -109,7 +113,7 @@ <#else>
暂无文章暂无文章