mirror of
https://ghfast.top/https://github.com/zsjy/halo-theme-dream2.0-plus.git
synced 2025-03-16 04:19:41 +08:00
27 lines
1.8 KiB
HTML
27 lines
1.8 KiB
HTML
<div xmlns:th="https://www.thymeleaf.org"
|
|
th:fragment="widget (hide)"
|
|
th:class="'card widget recent-comments ' + ${hide}"
|
|
th:with="num = ${#strings.isEmpty(theme.config.sidebar.recent_comments_num)? 5 : T(java.lang.Integer).parseInt(theme.config.sidebar.recent_comments_num)}, comments = ${commentFinder.list(null,1,num)}, isEmpty = ${#lists.isEmpty(comments)}">
|
|
<div class="card-title">
|
|
<i class="ri-history-line card-title-label"></i><span>最新评论</span>
|
|
</div>
|
|
<div th:if="${isEmpty}" class="card-empty">暂无评论</div>
|
|
<div th:unless="${isEmpty}" class="card-content">
|
|
<ul class="widget-comment">
|
|
<li class="item" th:each="comment : ${comments}">
|
|
<div class="user">
|
|
<img width="35" height="35" class="avatar" th:src="${comment.owner.avatar}"
|
|
th:alt="${comment.owner.displayName}">
|
|
<div class="info">
|
|
<div class="author">[[${comment.owner.displayName}]]</div>
|
|
<span class="date">[[${#temporals.format(comment.spec.creationTime, 'yyyy-MM-dd')}]]</span>
|
|
</div>
|
|
</div>
|
|
<div class="reply"
|
|
th:with="url = ${comment.spec.subjectRef.kind == 'SinglePage'?(comment.spec.subjectRef.name == theme.config.page_config.link_comment_id?'/links':singlePageFinder.getByName(comment.spec.subjectRef.name).status.permalink):(comment.spec.subjectRef.kind == 'Post'?postFinder.getByName(comment.spec.subjectRef.name).status.permalink:comment.spec.subjectRef.kind == 'Moment'?'/moments':'')}">
|
|
<a th:href="@{${url}}+'#comment-wrapper'" class="link">[[${comment.spec.content}]]</a>
|
|
</div>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
</div> |