diff --git a/README.md b/README.md index 9b9b91a12..02ec06057 100755 --- a/README.md +++ b/README.md @@ -2,8 +2,9 @@ > Halo may be the best Java blog system. | Halo可能是最好的Java博客系统。 +[![JDK](https://img.shields.io/badge/JDK-1.8-yellow.svg)](#) +[![Spring Boot](https://img.shields.io/badge/Spring%20Boot-2.0.0-green.svg)](https://github.com/spring-projects/spring-boot) [![GitHub release](https://img.shields.io/github/release/ruibaby/halo.svg)](https://github.com/ruibaby/halo/releases) -[![license](https://img.shields.io/github/license/ruibaby/halo.svg)](https://github.com/ruibaby/halo/blob/master/LICENSE) ------------------------------ @@ -44,7 +45,7 @@ Fast,simple,powerful blog system powered by Java. ## License 许可证 -[GPL-3.0](https://github.com/ruibaby/halo/blob/master/LICENSE) +[![license](https://img.shields.io/github/license/ruibaby/halo.svg)](https://github.com/ruibaby/halo/blob/master/LICENSE) ## Thanks 感谢 diff --git a/bin/halo.sh b/bin/halo.sh index b820d6c6c..209c8dd9f 100644 --- a/bin/halo.sh +++ b/bin/halo.sh @@ -65,4 +65,4 @@ case "$1" in *) usage ;; -esac \ No newline at end of file +esac diff --git a/src/main/java/cc/ryanc/halo/web/controller/IndexController.java b/src/main/java/cc/ryanc/halo/web/controller/IndexController.java index 3bd48a628..ea9b9f38e 100755 --- a/src/main/java/cc/ryanc/halo/web/controller/IndexController.java +++ b/src/main/java/cc/ryanc/halo/web/controller/IndexController.java @@ -12,6 +12,7 @@ import org.springframework.data.domain.Page; import org.springframework.data.domain.PageRequest; import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Sort; +import org.springframework.http.MediaType; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.*; @@ -209,7 +210,7 @@ public class IndexController extends BaseController{ * @param postId postId * @return page */ - @GetMapping(value = "/getComment/{postId}",produces = { "application/json;charset=UTF-8" }) + @GetMapping(value = "/getComment/{postId}",produces = MediaType.APPLICATION_JSON_UTF8_VALUE) @ResponseBody public List getComment(@PathVariable Long postId){ Optional post = postService.findByPostId(postId); @@ -452,7 +453,7 @@ public class IndexController extends BaseController{ * * @return rss */ - @GetMapping(value = {"feed","feed.xml","atom.xml"},produces = { "application/xml;charset=UTF-8" }) + @GetMapping(value = {"feed","feed.xml","atom.xml"},produces = {MediaType.APPLICATION_ATOM_XML_VALUE,MediaType.APPLICATION_RSS_XML_VALUE}) @ResponseBody public String feed(){ String rssPosts = HaloConst.OPTIONS.get("rss_posts"); @@ -472,7 +473,7 @@ public class IndexController extends BaseController{ * * @return sitemap */ - @GetMapping(value = {"sitemap","sitemap.xml"},produces = { "application/xml;charset=UTF-8" }) + @GetMapping(value = {"sitemap","sitemap.xml"},produces = MediaType.APPLICATION_XML_VALUE) @ResponseBody public String siteMap(){ //获取文章列表并根据时间排序 diff --git a/src/main/java/cc/ryanc/halo/web/controller/admin/PageController.java b/src/main/java/cc/ryanc/halo/web/controller/admin/PageController.java index c905cc29c..f1ab98513 100755 --- a/src/main/java/cc/ryanc/halo/web/controller/admin/PageController.java +++ b/src/main/java/cc/ryanc/halo/web/controller/admin/PageController.java @@ -118,7 +118,8 @@ public class PageController { * @return String */ @GetMapping(value = "/gallery") - public String gallery(){ - return ""; + public String gallery(Model model){ + model.addAttribute("options",HaloConst.OPTIONS); + return "admin/admin_page_gallery"; } } diff --git a/src/main/resources/templates/admin/admin_page.ftl b/src/main/resources/templates/admin/admin_page.ftl index f44eb6151..1a0525414 100755 --- a/src/main/resources/templates/admin/admin_page.ftl +++ b/src/main/resources/templates/admin/admin_page.ftl @@ -59,7 +59,7 @@ 图库页面 - /about + /gallery 预览 配置 diff --git a/src/main/resources/templates/admin/admin_page_gallery.ftl b/src/main/resources/templates/admin/admin_page_gallery.ftl new file mode 100644 index 000000000..f23782f93 --- /dev/null +++ b/src/main/resources/templates/admin/admin_page_gallery.ftl @@ -0,0 +1,144 @@ +<#compress > +<#include "module/_macro.ftl"> +<@head title="Halo后台管理-图库"> + +
+ + <#include "module/_header.ftl"> + + <#include "module/_sidebar.ftl"> +
+ +
+

图库

+ + 添加图片 + + +
+
+
+ + <#if options.widget_postcount?default("true")=="true"> +
+ +
+

${postCount?default(0)}

文章

+
+ 查看所有 +
+
+ + <#if options.widget_commentcount?default("true")=="true"> +
+ +
+

${commentCount?default(0)}

评论

+
+ 查看所有 +
+
+ + + <#if options.widget_attachmentcount?default("true")=="true"> +
+ +
+

${mediaCount?default(0)}

媒体库

+
+ 上传图片 +
+
+ + + <#if options.widget_daycount?default("true")=="true"> + + + +
+
+ +
+ <#include "module/_footer.ftl"> +
+<@footer> + \ No newline at end of file diff --git a/src/main/resources/templates/admin/module/_footer.ftl b/src/main/resources/templates/admin/module/_footer.ftl index 899ff3ff8..c97825e64 100755 --- a/src/main/resources/templates/admin/module/_footer.ftl +++ b/src/main/resources/templates/admin/module/_footer.ftl @@ -1,4 +1,4 @@ \ No newline at end of file diff --git a/src/main/resources/templates/admin/module/_header.ftl b/src/main/resources/templates/admin/module/_header.ftl index 3168bd09e..892e249f2 100755 --- a/src/main/resources/templates/admin/module/_header.ftl +++ b/src/main/resources/templates/admin/module/_header.ftl @@ -48,7 +48,7 @@

${user_session.userDisplayName?if_exists}