Files
2026-03-10 17:17:32 +08:00

26 lines
1.7 KiB
HTML

<section class="widget cst_widget_comment">
<div class="wid_title" th:text="${theme.config.sidebar.cst_widget_comment.title}">最新评论</div>
<ul class="items wid_comment">
<li class="wid_comment_item" th:each="comment,iterStat : ${commentFinder.list(null, 1, theme.config.sidebar.cst_widget_comment.number)}"
th:with="page = ${comment.spec.subjectRef.kind == 'Post' ? postFinder.getByName(comment.spec.subjectRef.name) :
comment.spec.subjectRef.kind == 'SinglePage' && not #strings.contains('photos,links,moments,equipment', comment.spec.subjectRef.name) ? singlePageFinder.getByName(comment.spec.subjectRef.name) : null},
url = ${page == null? '/' : page.status.permalink + '#comment-' + comment.metadata.name}">
<div class="left">
<a th:href="${url}">
<img alt=""
th:with=" img =${#strings.isEmpty(comment.owner.avatar)? theme.config.com.providerMirror+'/avatar/'+comment.spec.owner.annotations['email-hash'] :comment.owner.avatar}"
th:src="${img}"
class="avatar avatar-100 photo" height="100" width="100" loading="lazy"
decoding="async">
</a>
</div>
<div class="right">
<a th:href="${url}" class="name">[[${comment.owner.displayName}]]</a>
<div class="body" ><th:block th:utext="${comment.spec.content}"></th:block></div>
<div class="meta">
<th:block th:replace="~{modules/widgets/time :: time(${comment.metadata.creationTimestamp})}"></th:block>
</div>
</div>
</li>
</ul>
</section>