From 704ca6cf546003bfd15240d8c098931caee19ec7 Mon Sep 17 00:00:00 2001 From: RYAN0UP_ Date: Thu, 17 May 2018 12:07:51 +0800 Subject: [PATCH] =?UTF-8?q?:alien:=201.=20=E5=8F=91=E8=A1=A8=E6=96=87?= =?UTF-8?q?=E7=AB=A0=E9=A1=B5=E5=8F=AF=E7=9B=B4=E6=8E=A5=E5=BC=B9=E5=87=BA?= =?UTF-8?q?=E9=99=84=E4=BB=B6=E7=AA=97=E5=8F=A3=EF=BC=8C2.=20=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E4=BA=86=E6=88=91=E7=96=91=E6=83=91=E4=BA=86=E5=BE=88?= =?UTF-8?q?=E4=B9=85=E7=9A=84=E4=BA=8B=EF=BC=9A=E4=B8=BA=E5=95=A5=E6=88=91?= =?UTF-8?q?=E5=A4=A9=E5=A4=A9=E6=94=B6=E5=88=B0=E6=B5=8B=E8=AF=95=E9=82=AE?= =?UTF-8?q?=E4=BB=B6=EF=BC=8C=E5=8E=9F=E6=9D=A5=E6=98=AF=E6=88=91=E5=8D=95?= =?UTF-8?q?=E5=85=83=E6=B5=8B=E8=AF=95=E7=9A=84=E9=82=AE=E7=AE=B1=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E6=B2=A1=E6=9C=89=E5=88=A0=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/AttachmentController.java | 7 +- .../resources/templates/admin/admin_index.ftl | 2 +- .../resources/templates/admin/admin_page.ftl | 2 +- .../templates/admin/admin_page_md_editor.ftl | 22 +++- .../resources/templates/admin/admin_post.ftl | 8 +- .../templates/admin/admin_post_md_editor.ftl | 25 +++- .../admin/widget/_attachment-select-post.ftl | 108 ++++++++++++++++++ .../service/impl/MailServiceImplTest.java | 66 +++++------ 8 files changed, 198 insertions(+), 42 deletions(-) create mode 100644 src/main/resources/templates/admin/widget/_attachment-select-post.ftl 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>
暂无文章暂无文章