mirror of https://github.com/halo-dev/halo
Update anatole theme.
parent
27a8460ce1
commit
b17e03acff
|
@ -73,7 +73,7 @@ public class ContentIndexController {
|
|||
}) Sort sort) {
|
||||
log.debug("Requested index page, sort info: [{}]", sort);
|
||||
int pageSize = optionService.getPostPageSize();
|
||||
Pageable pageable = PageRequest.of(page - 1, pageSize, sort);
|
||||
Pageable pageable = PageRequest.of(page >= 1 ? page - 1 : page, pageSize, sort);
|
||||
|
||||
Page<PostListVO> posts = postService.pageListVoBy(PostStatus.PUBLISHED, pageable);
|
||||
int[] rainbow = PageUtil.rainbow(page, posts.getTotalPages(), 3);
|
||||
|
|
|
@ -82,9 +82,9 @@ $('.comment-cancel-reply').click(function () {
|
|||
function loadAvatar() {
|
||||
var avatar = $(".comment-author-avatar");
|
||||
var email = $('input[name=commentAuthorEmail]');
|
||||
avatar.attr("src", "//gravatar.loli.net/avatar/" + md5(localStorage.getItem("email")) + "?s=256&d=" + avatarType);
|
||||
avatar.attr("src", "//gravatar.loli.net/avatar/" + md5(localStorage.getItem("email")) + "?s=256&d=" + gavatarDefault);
|
||||
if (email.val() !== '' && email.val() !== null) {
|
||||
avatar.attr("src", "//gravatar.loli.net/avatar/" + md5(email.val()) + "?s=256&d=" + avatarType);
|
||||
avatar.attr("src", "//gravatar.loli.net/avatar/" + md5(email.val()) + "?s=256&d=" + gavatarDefault);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -4,20 +4,21 @@
|
|||
<style>
|
||||
${options.native_css!}
|
||||
</style>
|
||||
<#assign gavatarDefault="${options.comment_gavatar_default!'mm'}" />
|
||||
<div class="comment-container">
|
||||
<div class="comment-avatar">
|
||||
<img src="//gravatar.loli.net/avatar/none?s=256&d=${options.native_comment_avatar!'mm'}" class="comment-author-avatar">
|
||||
<img src="//gravatar.loli.net/avatar/none?s=256&d=${gavatarDefault}" class="comment-author-avatar">
|
||||
</div>
|
||||
<div class="comment-wrap">
|
||||
<div class="comment-header">
|
||||
<input type="hidden" name="postId" value="${post.postId?c}">
|
||||
<input type="hidden" name="commentParent" id="commentParent" value="0">
|
||||
<input type="text" class="comment-input comment-input-who" name="commentAuthor" id="commentAuthor" placeholder="昵称(必填)">
|
||||
<input type="text" class="comment-input comment-input-email" name="commentAuthorEmail" id="commentAuthorEmail" onblur="loadAvatar()" placeholder="邮箱(选填)">
|
||||
<input type="text" class="comment-input comment-input-website" name="commentAuthorUrl" id="commentAuthorUrl" placeholder="网址(选填)">
|
||||
<input type="hidden" name="postId" value="${post.id?c}">
|
||||
<input type="hidden" name="parentId" id="parentId" value="0">
|
||||
<input type="text" class="comment-input comment-input-who" name="author" id="commentAuthor" placeholder="昵称(必填)">
|
||||
<input type="text" class="comment-input comment-input-email" name="email" id="commentAuthorEmail" onblur="loadAvatar()" placeholder="邮箱(选填)">
|
||||
<input type="text" class="comment-input comment-input-website" name="authorUrl" id="commentAuthorUrl" placeholder="网址(选填)">
|
||||
</div>
|
||||
<div class="comment-content">
|
||||
<textarea class="comment-input-content" name="commentContent" id="commentContent" placeholder="${options.native_comment_placeholder!'赶快评论一个吧!'}"></textarea>
|
||||
<textarea class="comment-input-content" name="content" id="commentContent" placeholder="${options.comment_content_placeholder!'赶快评论一个吧!'}"></textarea>
|
||||
<div class="OwO"></div>
|
||||
</div>
|
||||
<div class="comment-footer">
|
||||
|
@ -31,10 +32,10 @@ ${options.native_css!}
|
|||
</div>
|
||||
<#macro childComments comments>
|
||||
<ul class="comment-list" style="margin-left: 30px; border-left: 1px solid #f1f1f1">
|
||||
<#if comments?? && comments?size gt 0>
|
||||
<#list comments?sort_by("createTime") as comment>
|
||||
<#if comments?? && comments.content?size gt 0>
|
||||
<#list comments.content?sort_by("createTime") as comment>
|
||||
<li class="comment-list-one" id="comment-id-${comment.id?c}" style="margin-left: 5px;">
|
||||
<img class="comment-list-one-img" src="//gravatar.loli.net/avatar/${comment.gavatarMd5!}?s=256&d=${options.native_comment_avatar!'mm'}">
|
||||
<img class="comment-list-one-img" src="//gravatar.loli.net/avatar/${comment.gavatarMd5!}?s=256&d=${gavatarDefault}">
|
||||
<section>
|
||||
<div class="comment-list-one-head">
|
||||
<a class="comment-list-one-head-name" rel="nofollow" href="${comment.authorUrl!}">${comment.author!}</a>
|
||||
|
@ -51,8 +52,8 @@ ${options.native_css!}
|
|||
<span at="${comment.id?c}" class="comment-list-one-footer-reback">回复</span>
|
||||
</div>
|
||||
</section>
|
||||
<#if comment.childComments?? && comment.childComments?size gt 0>
|
||||
<@childComments comment.childComments></@childComments>
|
||||
<#if comment.children?? && comment.children.content?size gt 0>
|
||||
<@childComments comment.children></@childComments>
|
||||
</#if>
|
||||
</li>
|
||||
</#list>
|
||||
|
@ -60,10 +61,10 @@ ${options.native_css!}
|
|||
</ul>
|
||||
</#macro>
|
||||
<ul class="comment-list" id="comments-list">
|
||||
<#if comments?? && comments.getPageList()?size gt 0>
|
||||
<#list comments.getPageList()?sort_by("createTime")?reverse as comment>
|
||||
<#if comments?? && comments.content?size gt 0>
|
||||
<#list comments.content?sort_by("createTime")?reverse as comment>
|
||||
<li class="comment-list-one" id="comment-id-${comment.id?c}">
|
||||
<img class="comment-list-one-img" src="//gravatar.loli.net/avatar/${comment.gavatarMd5!}?s=256&d=${options.native_comment_avatar!'mm'}">
|
||||
<img class="comment-list-one-img" src="//gravatar.loli.net/avatar/${comment.gavatarMd5!}?s=256&d=${gavatarDefault}">
|
||||
<section>
|
||||
<div class="comment-list-one-head">
|
||||
<a class="comment-list-one-head-name" rel="nofollow" href="${comment.authorUrl!}">${comment.author!}</a>
|
||||
|
@ -80,33 +81,33 @@ ${options.native_css!}
|
|||
<span at="${comment.id?c}" class="comment-list-one-footer-reback">回复</span>
|
||||
</div>
|
||||
</section>
|
||||
<#if comment.childComments?? && comment.childComments?size gt 0>
|
||||
<@childComments comment.childComments></@childComments>
|
||||
<#if comment.children?? && comment.children.content?size gt 0>
|
||||
<@childComments comment.children></@childComments>
|
||||
</#if>
|
||||
</li>
|
||||
</#list>
|
||||
</#if>
|
||||
</ul>
|
||||
<div class="native-nav" id="comment-nav">
|
||||
<#if comments.totalPage gt 1>
|
||||
<#if comments.totalPages gt 1>
|
||||
<ol class="page-nav">
|
||||
<#if comments.hasPrevious>
|
||||
<#if comments.hasPrevious()>
|
||||
<li>
|
||||
<a href="?cp=${comments.nowPage-1}#comments-list" title="上一页">←</a>
|
||||
<a href="?cp=${comments.number-1}#comments-list" title="上一页">←</a>
|
||||
</li>
|
||||
</#if>
|
||||
<li>
|
||||
<#list rainbow as r>
|
||||
<#if r == comments.nowPage>
|
||||
<a href="?cp=${comments.nowPage}#comments-list" style="color: red;">${r}</a>
|
||||
<#if r == comments.number>
|
||||
<a href="?cp=${comments.number}#comments-list" style="color: red;">${r}</a>
|
||||
<#else>
|
||||
<a href="?cp=${r}#comments-list">${r}</a>
|
||||
</#if>
|
||||
</#list>
|
||||
</li>
|
||||
<#if comments.hasNext>
|
||||
<#if comments.hasNext()>
|
||||
<li>
|
||||
<a href="?cp=${comments.nowPage+1}#comments-list" title="下一页">→</a>
|
||||
<a href="?cp=${comments.number+1}#comments-list" title="下一页">→</a>
|
||||
</li>
|
||||
</#if>
|
||||
</ol>
|
||||
|
@ -117,16 +118,8 @@ ${options.native_css!}
|
|||
<script src="/static/halo-content/plugins/md5/md5.min.js"></script>
|
||||
<script src="/static/halo-content/plugins/ua-parser/ua-parser.min.js"></script>
|
||||
<script src="/static/halo-common/OwO/OwO.min.js"></script>
|
||||
<#if (options.comment_activate_power_mode!'false') == "true">
|
||||
<script src="/static/halo-content/plugins/activate-power-mode/activate-power-mode.js"></script>
|
||||
<script>
|
||||
POWERMODE.colorful = true;
|
||||
POWERMODE.shake = false;
|
||||
document.body.addEventListener('input', POWERMODE);
|
||||
</script>
|
||||
</#if>
|
||||
<script>
|
||||
var avatarType = "${options.native_comment_avatar!'mm'}";
|
||||
var gavatarDefault = "${options.native_comment_avatar!'mm'}";
|
||||
</script>
|
||||
<script src="/static/halo-content/js/comment.min.js"></script>
|
||||
</@compress>
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
<#if (post.allowComment!'1')==1>
|
||||
<#if !post.disallowComment>
|
||||
<#include "/common/comment/_native_comment.ftl">
|
||||
</#if>
|
||||
|
|
|
@ -92,7 +92,7 @@
|
|||
</ul>
|
||||
</div>
|
||||
<div id="comment_widget">
|
||||
<#-- <#include "module/comment.ftl">-->
|
||||
<#include "module/comment.ftl">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue