Files
halo_theme_terminal/templates/moments.html
T

117 lines
5.5 KiB
HTML

<!DOCTYPE html>
<html
xmlns:th="https://www.thymeleaf.org"
th:replace="~{modules/layout :: html(title = |#{page.moments.title} - ${site.title}|, header = null, content = ~{::content}, footer = null)}"
>
<th:block th:fragment="content">
<article th:each="moment, stat : ${moments.items}"
th:with="
name=${moment.metadata.name},
content=${moment.spec.content},
medium=${content.medium},
upvoteCount=${moment.stats.upvote ?: 0},
commentCount=${moment.stats.approvedComment ?: 0},
commentId=|comment-${name}|,
galleryId=|gallery-${stat.index}|,
mediaSize=${#lists.size(medium)},
mediaGridClass=${mediaSize == 1 ? 'grid-cols-1' : (mediaSize < 5 ? 'grid-cols-2' : 'grid-cols-3')}
"
class="moment on-list post"
th:attr="data-moment-name=${name}">
<header>
<div class="post-meta">
<time class="post-date"
th:text="${#dates.format(moment.spec.releaseTime, 'yyyy-MM-dd')}">
Moment CreateTime
</time>
<span class="post-author"
th:with="owner=${moment.owner}"
th:text="${owner.displayName}">
Author
</span>
</div>
</header>
<div class="post-content" th:utext="${content.html}">
Moment Content...
</div>
<th:block th:if="${!#lists.isEmpty(medium)}">
<div class="moment-media" th:classappend="${mediaGridClass}">
<div th:each="media : ${medium}">
<a class="glightbox"
th:data-gallery="${galleryId}"
th:href="${media.url}">
<img th:if="${media.type == 'PHOTO'}"
class="transform-gpu rounded-lg object-cover"
th:src="${media.url}"
th:alt="#{media.photo}"/>
</a>
<video th:if="${media.type == 'VIDEO'}"
controls
th:src="${media.url}"></video>
</div>
</div>
</th:block>
<footer class="moment-footer">
<button class="moment-action-btn moment-upvote-btn"
th:attr="data-moment-action='upvote',data-moment-name=${name},data-count=${upvoteCount},aria-label=#{moment.upvote}">
<svg class="icon-regular" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"
fill="currentColor" width="16" height="16">
<path d="M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z"/>
</svg>
<svg class="icon-pixel" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"
width="16" height="16">
<path fill="currentColor"
d="M9 2H5v2H3v2H1v6h2v2h2v2h2v2h2v2h2v2h2v-2h2v-2h2v-2h2v-2h2v-2h2V6h-2V4h-2V2h-4v2h-2v2h-2V4H9V2zm0 2v2h2v2h2V6h2V4h4v2h2v6h-2v2h-2v2h-2v2h-2v2h-2v-2H9v-2H7v-2H5v-2H3V6h2V4h4z"/>
</svg>
<span class="upvote-count"
th:attr="data-moment-name=${name}"
th:text="${upvoteCount}">0</span>
</button>
<button class="moment-action-btn moment-comment-btn"
th:attr="data-moment-action='toggle-comment',data-comment-target=${commentId},aria-label=#{moment.comments}">
<svg class="icon-regular" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"
fill="currentColor" width="16" height="16">
<path d="M20 2H4c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2z"/>
</svg>
<svg class="icon-pixel" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"
width="16" height="16">
<path fill="currentColor"
d="M22 2H2v14h2V4h16v12h-8v2h-2v2H8v-4H2v2h4v4h4v-2h2v-2h10V2z"/>
</svg>
<span th:text="${commentCount}">0</span>
</button>
</footer>
<div class="moment-comment-section"
th:id="${commentId}"
th:attr="data-name=${name}">
<th:block th:if="${haloCommentEnabled}"
th:replace="~{modules/comment :: comment(
group = 'moment.halo.run',
kind = 'Moment',
name = ${name}
)}"/>
</div>
</article>
<nav class="pagination" th:if="${moments.hasPrevious() || moments.hasNext()}">
<div class="pagination-buttons">
<span th:if="${moments.hasPrevious()}">
<a data-pjax th:href="@{${moments.prevUrl}}" class="button inline prev">
<span class="button-text" th:text="'< ' + #{page.pagination.prev}">&lt;&nbsp;Prev</span>
</a>
</span>
<span th:if="${moments.hasNext()}">
<a data-pjax th:href="@{${moments.nextUrl}}" class="button inline next">
<span class="button-text" th:text="#{page.pagination.next} + ' >'">Next&nbsp;&gt;</span>
</a>
</span>
</div>
</nav>
</th:block>
</html>