64 lines
4.6 KiB
HTML
Raw Normal View History

2023-03-23 18:25:48 +08:00
<div xmlns:th="https://www.thymeleaf.org"
th:fragment="widget (sidebar)"
th:class="'card widget profile ' + ${sidebar.hide}">
2023-03-27 12:10:21 +08:00
<div class="card-content">
<nav class="level">
<div class="level-item" style="flex-direction: column;">
<figure class="image">
2024-03-30 20:30:01 +08:00
<img class="avatar" height="auto" width="auto" th:src="${contributor.avatar}" th:alt="${contributor.displayName}">
2023-03-27 12:10:21 +08:00
</figure>
<p class="nickname" th:text="${contributor.displayName}"></p>
<p class="motto spark-input" th:text="${contributor.bio}"></p>
<p th:if="${!#strings.isEmpty(theme.config.sidebar.profile_location)}" class="address">
2023-09-12 10:44:43 +08:00
<i class="ri-map-pin-line"></i>
2023-03-27 12:10:21 +08:00
<span th:text="${theme.config.sidebar.profile_location}"></span>
</p>
</div>
</nav>
<nav class="level" th:if="${!#lists.isEmpty(theme.config.sidebar.custom_stats)}">
<div th:each="item,sindex :${theme.config.sidebar.custom_stats}" class="level-item" th:switch="${item.type}">
<div th:case="visit" th:with="visit = ${stats.visit}">
<p class="heading" th:text="|访问${visit / 10000000 > 0 ? '(千万)' : (visit / 10000 > 0 ? '(万)' : '')}|"></p>
<p class="value" th:title="${visit / 10000 > 0} ? ${visit}" th:text="${visit / 10000000 > 0} ? (${#numbers.formatDecimal(visit / 10000000.0,1,1)}) : (${visit / 10000 > 0} ? (${#numbers.formatDecimal(visit / 10000.0,1,1)}) : ${visit})"></p>
2023-03-27 12:10:21 +08:00
</div>
<div th:case="upvote" th:with="upvote = ${stats.upvote}">
<p class="heading" th:text="|点赞${upvote / 10000000 > 0 ? '(千万)' : (upvote / 10000 > 0 ? '(万)' : '')}|"></p>
<p class="value" th:title="${upvote / 10000 > 0} ? ${upvote}" th:text="${upvote / 10000000 > 0} ? (${#numbers.formatDecimal(upvote / 10000000.0,1,1)}) : (${upvote / 10000 > 0} ? (${#numbers.formatDecimal(upvote / 10000.0,1,1)}) : ${upvote})"></p>
2023-03-27 12:10:21 +08:00
</div>
<div th:case="comment" th:with="comment = ${stats.comment}">
<p class="heading" th:text="|评论${comment / 10000000 > 0 ? '(千万)' : (comment / 10000 > 0 ? '(万)' : '')}|"></p>
<p class="value" th:title="${comment / 10000 > 0} ? ${comment}" th:text="${comment / 10000000 > 0} ? (${#numbers.formatDecimal(comment / 10000000.0,1,1)}) : (${comment / 10000 > 0} ? (${#numbers.formatDecimal(comment / 10000.0,1,1)}) : ${comment})"></p>
2023-03-27 12:10:21 +08:00
</div>
<div th:case="category" th:with="category = ${stats.category}">
<p class="heading" th:text="|分类${category / 10000000 > 0 ? '(千万)' : (category / 10000 > 0 ? '(万)' : '')}|"></p>
<p class="value" th:title="${category / 10000 > 0} ? ${category}" th:text="${category / 10000000 > 0} ? (${#numbers.formatDecimal(category / 10000000.0,1,1)}) : (${category / 10000 > 0} ? (${#numbers.formatDecimal(category / 10000.0,1,1)}) : ${category})"></p>
</div>
<div th:case="tag" th:with="tagsList = ${tagFinder.listAll()}, tags = ${#lists.size(tagsList)}">
<p class="heading" th:text="|标签${tags / 10000000 > 0 ? '(千万)' : (tags / 10000 > 0 ? '(万)' : '')}|"></p>
<p class="value" th:title="${tags / 10000 > 0} ? ${tags}" th:text="${tags / 10000000 > 0} ? (${#numbers.formatDecimal(tags / 10000000.0,1,1)}) : (${tags / 10000 > 0} ? (${#numbers.formatDecimal(tags / 10000.0,1,1)}) : ${tags})"></p>
</div>
<div th:case="*" th:with="post = ${stats.post}">
<p class="heading" th:text="|文章${post / 10000000 > 0 ? '(千万)' : (post / 10000 > 0 ? '(万)' : '')}|"></p>
<p class="value" th:title="${post / 10000 > 0} ? ${post}" th:text="${post / 10000000 > 0} ? (${#numbers.formatDecimal(post / 10000000.0,1,1)}) : (${post / 10000 > 0} ? (${#numbers.formatDecimal(post / 10000.0,1,1)}) : ${post})"></p>
</div>
2023-03-27 12:10:21 +08:00
</div>
</nav>
<div th:if="${!#strings.isEmpty(theme.config.sidebar.profile_theme_button)}" class="level"
th:with="content = ${#strings.arraySplit(theme.config.sidebar.profile_theme_button,'|')}">
<a class="level-item button is-link is-rounded"
th:href="${content.length>=2?content[1]:''}" target="_blank" rel="nofollow noopener noreferrer"
2023-03-27 12:10:21 +08:00
th:text="${content[0]}"></a>
2023-03-21 10:49:35 +08:00
</div>
2023-03-27 12:10:21 +08:00
<div th:if="${!#lists.isEmpty(theme.config.sidebar.custom_options)}" class="level">
<a th:each="option :${theme.config.sidebar.custom_options}"
class="level-item button is-transparent"
target="_blank"
th:title="${option.name}"
th:href="${option.url}"
rel="nofollow noopener noreferrer">
2023-09-12 10:44:43 +08:00
<i th:class="${option.icon}"></i>
2023-03-27 12:10:21 +08:00
</a>
</div>
</div>
</div>