Skip to content

Commit a09aede

Browse files
committed
0.0.6
1 parent 005a7e4 commit a09aede

File tree

5 files changed

+23
-21
lines changed

5 files changed

+23
-21
lines changed

src/main/java/cc/ryanc/halo/web/controller/front/FrontArchiveController.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public String archives(Model model,
6363
Sort sort = new Sort(Sort.Direction.DESC, "postDate");
6464
Pageable pageable = PageRequest.of(page - 1, 5, sort);
6565
Page<Post> posts = postService.findPostByStatus(0, PostType.POST_TYPE_POST.getDesc(), pageable);
66-
if(null==posts){
66+
if (null == posts) {
6767
return this.renderNotFound();
6868
}
6969
model.addAttribute("posts", posts);
@@ -83,7 +83,7 @@ public String archives(Model model,
8383
@PathVariable(value = "year") String year,
8484
@PathVariable(value = "month") String month) {
8585
Page<Post> posts = postService.findPostByYearAndMonth(year, month, null);
86-
if(null==posts){
86+
if (null == posts) {
8787
return this.renderNotFound();
8888
}
8989
model.addAttribute("posts", posts);
@@ -100,7 +100,7 @@ public String archives(Model model,
100100
@GetMapping(value = "{postUrl}")
101101
public String getPost(@PathVariable String postUrl, Model model) {
102102
Post post = postService.findByPostUrl(postUrl, PostType.POST_TYPE_POST.getDesc());
103-
if(null==post || post.getPostStatus()!=0){
103+
if (null == post || post.getPostStatus() != 0) {
104104
return this.renderNotFound();
105105
}
106106
//获得当前文章的发布日期
@@ -116,11 +116,12 @@ public String getPost(@PathVariable String postUrl, Model model) {
116116
if (null != afterPosts && afterPosts.size() > 0) {
117117
model.addAttribute("afterPost", afterPosts.get(afterPosts.size() - 1));
118118
}
119-
Sort sort = new Sort(Sort.Direction.DESC,"commentDate");
120-
Pageable pageable = PageRequest.of(0,999,sort);
121-
Page<Comment> comments = commentService.findCommentsByPostAndCommentStatus(post,pageable,0);
119+
Sort sort = new Sort(Sort.Direction.DESC, "commentDate");
120+
Pageable pageable = PageRequest.of(0, 999, sort);
121+
Page<Comment> comments = commentService.findCommentsByPostAndCommentStatus(post, pageable, 0);
122122
model.addAttribute("post", post);
123123
model.addAttribute("comments", CommentUtil.getComments(comments.getContent()));
124+
model.addAttribute("commentsCount", comments.getTotalElements());
124125
postService.updatePostView(post);
125126
return this.render("post");
126127
}

src/main/resources/static/css/style.css

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,13 +101,13 @@
101101
}
102102

103103
::-webkit-scrollbar {
104-
width: 0;
105-
height: 0;
106-
background-color: transparent;
104+
width: 2px;
105+
height: 2px;
106+
background-color: #eee;
107107
}
108108
::-webkit-scrollbar-thumb {
109-
background-color: transparent;
109+
background-color: #d0afaf;
110110
}
111111
::-webkit-scrollbar-track {
112-
background-color: transparent;
112+
background-color: #eee;
113113
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<footer class="main-footer">
2-
<div class="pull-right hidden-xs"><a target="_blank" href="https://github.com/ruibaby/halo/releases/tag/v0.0.5">0.0.5</a></div>
2+
<div class="pull-right hidden-xs"><a target="_blank" href="https://github.com/ruibaby/halo/releases/tag/v0.0.6">0.0.6</a></div>
33
Thanks for using <strong><a data-pjax="true" href="/admin/halo">Halo</a>.</strong>
44
</footer>

src/main/resources/templates/admin/module/_header.ftl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,13 @@
2929
<li>
3030
<a href="/admin/comments?status=1">
3131
<div class="pull-left">
32-
<img src="//www.gravatar.com/avatar/${comment.commentAuthorAvatarMd5?default("hash")}?s=256&d=${options.native_comment_avatar?default("mm")}" class="img-circle" alt="User Image">
32+
<img src="//gravatar.loli.net/avatar/${comment.commentAuthorAvatarMd5?default("hash")}?s=256&d=${options.native_comment_avatar?default("mm")}" class="img-circle" alt="User Image">
3333
</div>
34-
<h4>${comment.commentAuthor}
34+
<h4>
35+
${comment.commentAuthor}
3536
<small> ${comment.commentDate?string("yyyy/MM/dd HH:mm")}</small>
3637
</h4>
37-
<p>${comment.commentContent}</p>
38+
<object>${comment.commentContent}</object>
3839
</a>
3940
</li>
4041
<#if x==10>

src/main/resources/templates/common/comment/_native_comment.ftl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@
233233
</style>
234234
<div class="native-comment">
235235
<div class="comment-avatar">
236-
<img src="//www.gravatar.com/avatar/none?s=256&d=${options.native_comment_avatar?default('mm')}" height="48" width="48" class="comment-author-avatar">
236+
<img src="//gravatar.loli.net/avatar/none?s=256&d=${options.native_comment_avatar?default('mm')}" height="48" width="48" class="comment-author-avatar">
237237
</div>
238238
<div class="native-wrap">
239239
<div class="comment-header">
@@ -254,14 +254,14 @@
254254
</div>
255255
<div class="native-message" style="text-align: center;padding: 20px;display: none"></div>
256256
<div class="native-info">
257-
<#--<span id="native-info-total" style="font-weight: 600">${comments.getTotalElements()}</span>评论-->
257+
<span id="native-info-total" style="font-weight: 600">${commentsCount?default(0)}</span>评论
258258
</div>
259259
<#macro childComments comments>
260260
<ul class="native-list" style="margin-left: 20px; border-left: 1px solid #f1f1f1">
261261
<#if comments?? && comments?size gt 0>
262262
<#list comments as comment>
263263
<li class="native-list-one" id="comment-id-${comment.commentId?c}">
264-
<img class="native-list-one-img" src="//www.gravatar.com/avatar/${comment.commentAuthorAvatarMd5?if_exists}?s=256&d=${options.native_comment_avatar?default('mm')}">
264+
<img class="native-list-one-img" src="//gravatar.loli.net/avatar/${comment.commentAuthorAvatarMd5?if_exists}?s=256&d=${options.native_comment_avatar?default('mm')}">
265265
<section>
266266
<div class="native-list-one-head">
267267
<a class="native-list-one-head-name" rel="nofollow" href="${comment.commentAuthorUrl?if_exists}">${comment.commentAuthor?if_exists}</a>
@@ -290,7 +290,7 @@
290290
<#if comments?? && comments?size gt 0>
291291
<#list comments as comment>
292292
<li class="native-list-one" id="comment-id-${comment.commentId?c}">
293-
<img class="native-list-one-img" src="//www.gravatar.com/avatar/${comment.commentAuthorAvatarMd5?if_exists}?s=256&d=${options.native_comment_avatar?default('mm')}">
293+
<img class="native-list-one-img" src="//gravatar.loli.net/avatar/${comment.commentAuthorAvatarMd5?if_exists}?s=256&d=${options.native_comment_avatar?default('mm')}">
294294
<section>
295295
<div class="native-list-one-head">
296296
<a class="native-list-one-head-name" rel="nofollow" href="${comment.commentAuthorUrl?if_exists}">${comment.commentAuthor?if_exists}</a>
@@ -398,9 +398,9 @@
398398
$('#commentContent').focus();
399399
});
400400
function loadAvatar() {
401-
$(".comment-author-avatar").attr("src","//www.gravatar.com/avatar/"+md5(localStorage.getItem("email"))+"?s=256&d=${options.native_comment_avatar?default('mm')}");
401+
$(".comment-author-avatar").attr("src","//gravatar.loli.net/avatar/"+md5(localStorage.getItem("email"))+"?s=256&d=${options.native_comment_avatar?default('mm')}");
402402
if($('input[name=commentAuthorEmail]').val()!='' && $('input[name=commentAuthorEmail]').val()!=null){
403-
$(".comment-author-avatar").attr("src","//www.gravatar.com/avatar/"+md5($('input[name=commentAuthorEmail]').val())+"?s=256&d=${options.native_comment_avatar?default('mm')}");
403+
$(".comment-author-avatar").attr("src","//gravatar.loli.net/avatar/"+md5($('input[name=commentAuthorEmail]').val())+"?s=256&d=${options.native_comment_avatar?default('mm')}");
404404
}
405405
}
406406
var parser = new UAParser();

0 commit comments

Comments
 (0)