🐛 修复Anatole主题菜单高亮问题

pull/1/head
RYAN0UP_ 2018-04-24 17:56:21 +08:00
parent f00877c8de
commit 602059fb2a
5 changed files with 100 additions and 93 deletions

View File

@ -3,7 +3,6 @@
> 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.1-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)
[![Travis CI](https://img.shields.io/travis/ruibaby/halo.svg)](https://travis-ci.org/ruibaby/halo)

View File

@ -13,7 +13,7 @@
<developers>
<developer>
<id>RYAN0UP</id>
<id>ruibaby</id>
<name>Ryan Wang</name>
<email>i@ryanc.cc</email>
<url>https://ryanc.cc</url>

View File

@ -249,6 +249,8 @@ public class IndexController extends BaseController{
User user = userService.findUser();
model.addAttribute("user",user);
model.addAttribute("is_gallery",true);
//设置选项
model.addAttribute("options",HaloConst.OPTIONS);
return this.render("gallery");

View File

@ -126,39 +126,33 @@
</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>
<a data-pjax="true" 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>
<a data-pjax="true" 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>
<a data-pjax="true" 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="blogStart">1</h3><p>成立天数</p></div>
<div class="icon"><i class="ion ion-pie-graph"></i></div>
@ -166,7 +160,6 @@
</div>
</div>
</#if>
<!-- ./col -->
</div>
<div class="row">
@ -192,7 +185,6 @@
</thead>
<tbody>
<#if postTopFive??>
<tr>
<#list postTopFive as post>
<tr>
<#if post.postStatus == 0>
@ -212,7 +204,6 @@
<td>${post.postDate?if_exists?string("yyyy-MM-dd HH:mm")}</td>
</tr>
</#list>
</tr>
<#else>
<tr><td>暂无数据</td></tr>
</#if>
@ -236,15 +227,16 @@
<div class="box-body table-responsive">
<table class="table table-bordered table-hover text-center">
<thead>
<tr>
<th>评论者</th>
<th>评论页面</th>
<th>内容</th>
<th>状态</th>
<th>时间</th>
</tr>
</thead>
<tbody>
<#if comments??>
<tr>
<#list comments as comment>
<tr>
<td>${comment.commentAuthor}</td>
@ -280,7 +272,6 @@
<td>${comment.commentDate?string("yyyy-MM-dd HH:mm")}</td>
</tr>
</#list>
</tr>
<#else>
<tr><td>暂无数据</td></tr>
</#if>
@ -312,14 +303,15 @@
<div class="box-body table-responsive">
<table class="table table-bordered table-hover text-center">
<thead>
<tr>
<th>事件</th>
<th>结果</th>
<th>IP</th>
<th>时间</th>
</tr>
</thead>
<tbody>
<#if logs??>
<tr>
<#list logs as log>
<tr>
<td>${log.logTitle}</td>
@ -328,7 +320,6 @@
<td>${log.logCreated?string("yyyy-MM-dd HH:mm")}</td>
</tr>
</#list>
</tr>
<#else>
<tr><td>暂无数据</td></tr>
</#if>

View File

@ -9,8 +9,8 @@
<meta content="black" name="apple-mobile-web-app-status-bar-style" />
<meta content="telephone=no" name="format-detection" />
<meta name="renderer" content="webkit">
<meta name="author" content="${keywords?default("Anatole")}" />
<meta name="keywords" content=""/>
<meta name="author" content="" />
<meta name="keywords" content="${keywords?default("Anatole")}"/>
<meta name="description" content="${description?default("Anatole")}" />
<link rel="shortcut icon" href="/anatole/source/images/favicon.png" type="image/x-icon" />
<link href="/anatole/source/css/font-awesome.min.css" type="text/css" rel="stylesheet"/>
@ -24,6 +24,21 @@
<script type="text/javascript" src="/anatole/source/js/jquery.js"></script>
<script type="text/javascript" src="/anatole/source/js/jquery-migrate-1.2.1.min.js"></script>
<script type="text/javascript" src="/anatole/source/js/jquery.appear.js"></script>
<script type="text/javascript">
var url = location.href;
var urlstatus = false;
$(".nav li a").each(function () {
if ((url + '/').indexOf($(this).attr('href')) > -1 && $(this).attr('href') != '/') {
$(this).addClass('current');
urlstatus = true;
} else {
$(this).removeClass('current');
}
});
if (!urlstatus) {
$(".nav li a").eq(0).addClass('current');
}
</script>
</body>
</html>
</#macro>