🐛 细节修改.

pull/1/head
RYAN0UP_ 2018-04-03 18:00:51 +08:00
parent cac1520406
commit 91e52113e2
8 changed files with 158 additions and 11 deletions

View File

@ -2,8 +2,9 @@
> Halo may be the best Java blog system. | Halo可能是最好的Java博客系统。 > 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) [![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 许可证 ## 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 感谢 ## Thanks 感谢

View File

@ -65,4 +65,4 @@ case "$1" in
*) *)
usage usage
;; ;;
esac esac

View File

@ -12,6 +12,7 @@ import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest; import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort; import org.springframework.data.domain.Sort;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.ui.Model; import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -209,7 +210,7 @@ public class IndexController extends BaseController{
* @param postId postId * @param postId postId
* @return page * @return page
*/ */
@GetMapping(value = "/getComment/{postId}",produces = { "application/json;charset=UTF-8" }) @GetMapping(value = "/getComment/{postId}",produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@ResponseBody @ResponseBody
public List<Comment> getComment(@PathVariable Long postId){ public List<Comment> getComment(@PathVariable Long postId){
Optional<Post> post = postService.findByPostId(postId); Optional<Post> post = postService.findByPostId(postId);
@ -452,7 +453,7 @@ public class IndexController extends BaseController{
* *
* @return rss * @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 @ResponseBody
public String feed(){ public String feed(){
String rssPosts = HaloConst.OPTIONS.get("rss_posts"); String rssPosts = HaloConst.OPTIONS.get("rss_posts");
@ -472,7 +473,7 @@ public class IndexController extends BaseController{
* *
* @return sitemap * @return sitemap
*/ */
@GetMapping(value = {"sitemap","sitemap.xml"},produces = { "application/xml;charset=UTF-8" }) @GetMapping(value = {"sitemap","sitemap.xml"},produces = MediaType.APPLICATION_XML_VALUE)
@ResponseBody @ResponseBody
public String siteMap(){ public String siteMap(){
//获取文章列表并根据时间排序 //获取文章列表并根据时间排序

View File

@ -118,7 +118,8 @@ public class PageController {
* @return String * @return String
*/ */
@GetMapping(value = "/gallery") @GetMapping(value = "/gallery")
public String gallery(){ public String gallery(Model model){
return ""; model.addAttribute("options",HaloConst.OPTIONS);
return "admin/admin_page_gallery";
} }
} }

View File

@ -59,7 +59,7 @@
</tr> </tr>
<tr> <tr>
<td>图库页面</td> <td>图库页面</td>
<td>/about</td> <td>/gallery</td>
<td> <td>
<a href="/gallery" class="btn btn-info btn-sm btn-flat" target="_blank">预览</a> <a href="/gallery" class="btn btn-info btn-sm btn-flat" target="_blank">预览</a>
<a data-pjax="true" href="/admin/page/gallery" class="btn btn-primary btn-sm btn-flat">配置</a> <a data-pjax="true" href="/admin/page/gallery" class="btn btn-primary btn-sm btn-flat">配置</a>

View File

@ -0,0 +1,144 @@
<#compress >
<#include "module/_macro.ftl">
<@head title="Halo后台管理-图库">
</@head>
<div class="wrapper">
<!-- 顶部栏模块 -->
<#include "module/_header.ftl">
<!-- 菜单栏模块 -->
<#include "module/_sidebar.ftl">
<div class="content-wrapper">
<style type="text/css" rel="stylesheet">
#btnNewPicture{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}
#btnNewPicture:hover{background:#3c8dbc;color:#fff}
</style>
<section class="content-header">
<h1 style="display: inline-block;">图库<small></small></h1>
<a id="btnNewPicture" href="#">
添加图片
</a>
<ol class="breadcrumb">
<li>
<a data-pjax="true" href="/admin"><i class="fa fa-dashboard"></i> 首页</a>
</li>
<li><a data-pjax="true" href="/admin/page">页面</a></li>
<li class="active">图库</li>
</ol>
</section>
<section class="content container-fluid">
<div class="row">
<div class="col-lg-12 col-xs-12" id="newPicturePanel" style="display: none">
<div class="box box-primary">
<div class="box-header with-border">
<h3 class="box-title">添加图片</h3>
</div>
<form class="form-horizontal" id="widgetsOption">
<div class="box-body">
<div class="col-sm-6 col-xs-6">
<div class="form-group">
<label for="widgetPostCount" class="col-sm-4 control-label">文章总数:</label>
<div class="col-sm-8">
<label class="radio-inline">
<input type="radio" name="widget_postcount" id="widgetPostCount" value="true" ${((options.widget_postcount?default('true'))=='true')?string('checked','')}> 显示
</label>
<label class="radio-inline">
<input type="radio" name="widget_postcount" id="widgetPostCount" value="false" ${((options.widget_postcount?default('true'))=='false')?string('checked','')}> 隐藏
</label>
</div>
</div>
<div class="form-group">
<label for="widgetCommentCount" class="col-sm-4 control-label">评论总数:</label>
<div class="col-sm-8">
<label class="radio-inline">
<input type="radio" name="widget_commentcount" id="widgetCommentCount" value="true" ${((options.widget_commentcount?default('true'))=='true')?string('checked','')}> 显示
</label>
<label class="radio-inline">
<input type="radio" name="widget_commentcount" id="widgetCommentCount" value="false" ${((options.widget_commentcount?default('true'))=='false')?string('checked','')}> 隐藏
</label>
</div>
</div>
<div class="form-group">
<label for="widgetAttachmentCount" class="col-sm-4 control-label">附件总数:</label>
<div class="col-sm-8">
<label class="radio-inline">
<input type="radio" name="widget_attachmentcount" id="widgetAttachmentCount" value="true" ${((options.widget_attachmentcount?default('true'))=='true')?string('checked','')}> 显示
</label>
<label class="radio-inline">
<input type="radio" name="widget_attachmentcount" id="widgetAttachmentCount" value="false" ${((options.widget_attachmentcount?default('true'))=='false')?string('checked','')}> 隐藏
</label>
</div>
</div>
<div class="form-group">
<label for="widgetDayCount" class="col-sm-4 control-label">成立天数:</label>
<div class="col-sm-8">
<label class="radio-inline">
<input type="radio" name="widget_daycount" id="widgetDayCount" value="true" ${((options.widget_daycount?default('true'))=='true')?string('checked','')}> 显示
</label>
<label class="radio-inline">
<input type="radio" name="widget_daycount" id="widgetDayCount" value="false" ${((options.widget_daycount?default('true'))=='false')?string('checked','')}> 隐藏
</label>
</div>
</div>
</div>
</div>
<div class="box-footer">
<button type="button" class="btn btn-info pull-right" onclick="saveOptions('widgetsOption')">保存</button>
</div>
</form>
</div>
</div>
<#if options.widget_postcount?default("true")=="true">
<div class="col-lg-3 col-xs-6" id="widgetPostCountBody">
<!-- small box -->
<div class="small-box bg-aqua">
<div class="inner"><h3>${postCount?default(0)}</h3><p>文章</p></div>
<div class="icon"><i class="ion ion-bag"></i></div>
<a href="/admin/posts" class="small-box-footer">查看所有 <i class="fa fa-arrow-circle-right"></i></a>
</div>
</div>
</#if>
<#if options.widget_commentcount?default("true")=="true">
<div class="col-lg-3 col-xs-6" id="widgetCommentCountBody">
<!-- small box -->
<div class="small-box bg-green">
<div class="inner"><h3>${commentCount?default(0)}</h3><p>评论</p></div>
<div class="icon"><i class="ion ion-stats-bars"></i></div>
<a href="/admin/comments" class="small-box-footer">查看所有 <i class="fa fa-arrow-circle-right"></i></a>
</div>
</div>
</#if>
<!-- ./col -->
<#if options.widget_attachmentcount?default("true")=="true">
<div class="col-lg-3 col-xs-6" id="widgetAttachmentCountBody">
<!-- small box -->
<div class="small-box bg-yellow">
<div class="inner"><h3>${mediaCount?default(0)}</h3><p>媒体库</p></div>
<div class="icon"><i class="ion ion-person-add"></i></div>
<a href="/admin/attachments" class="small-box-footer">上传图片 <i class="fa fa-arrow-circle-right"></i></a>
</div>
</div>
</#if>
<!-- ./col -->
<#if options.widget_daycount?default("true")=="true">
<div class="col-lg-3 col-xs-6" id="widgetDayCountBody">
<!-- small box -->
<div class="small-box bg-red">
<div class="inner"><h3 id="siteStart">1</h3><p>成立天数</p></div>
<div class="icon"><i class="ion ion-pie-graph"></i></div>
<a href="#" class="small-box-footer">${options.site_start?default('0000-00-00')} <i class="fa fa-star"></i></a>
</div>
</div>
</#if>
<!-- ./col -->
</div>
</section>
<script type="application/javascript">
$('#btnNewPicture').click(function () {
$('#newPicturePanel').slideToggle(400);
});
</script>
</div>
<#include "module/_footer.ftl">
</div>
<@footer></@footer>
</#compress>

View File

@ -1,4 +1,4 @@
<footer class="main-footer"> <footer class="main-footer">
<div class="pull-right hidden-xs"><a target="_blank" href="https://ryanc.cc">1.0 Beta</a></div> <div class="pull-right hidden-xs"><a target="_blank" href="https://github.com/ruibaby/halo">1.0 Beta</a></div>
Thanks for using <strong><a href="/admin/halo">Halo</a>.</strong> Thanks for using <strong><a href="/admin/halo">Halo</a>.</strong>
</footer> </footer>

View File

@ -48,7 +48,7 @@
<p>${user_session.userDisplayName?if_exists}</p> <p>${user_session.userDisplayName?if_exists}</p>
</li> </li>
<li class="user-footer"> <li class="user-footer">
<div class="pull-left"><a href="/admin/profile" class="btn btn-default btn-flat">个人资料</a></div> <div class="pull-left"><a data-pjax="true" href="/admin/profile" class="btn btn-default btn-flat">个人资料</a></div>
<div class="pull-right"><a href="/admin/logOut" class="btn btn-default btn-flat">退出登录</a></div> <div class="pull-right"><a href="/admin/logOut" class="btn btn-default btn-flat">退出登录</a></div>
</li> </li>
</ul> </ul>