64 lines
2.7 KiB
HTML

<div xmlns:th="https://www.thymeleaf.org"
th:fragment="widget (hide)"
th:class="'card widget profile ' + ${hide}">
<div class="card-content">
<nav class="level">
<div class="level-item" style="flex-direction: column;">
<figure class="image">
<img class="avatar" th:src="${contributor.avatar}" th:alt="${contributor.displayName}">
</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">
<i class="ri-map-pin-line"></i>
<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">
<p class="heading">访问</p>
<p class="value" th:text="${stats.visit}"></p>
</div>
<div th:case="upvote">
<p class="heading">点赞</p>
<p class="value" th:text="${stats.upvote}"></p>
</div>
<div th:case="comment">
<p class="heading">评论</p>
<p class="value" th:text="${stats.comment}"></p>
</div>
<div th:case="category">
<p class="heading">分类</p>
<p class="value" th:text="${stats.category}"></p>
</div>
<div th:case="tag">
<p class="heading">标签</p>
<p class="value" th:with="tags = ${tagFinder.listAll()}" th:text="${#lists.size(tags)}"></p>
</div>
<div th:case="*">
<p class="heading">文章</p>
<p class="value" th:text="${stats.post}"></p>
</div>
</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"
th:text="${content[0]}"></a>
</div>
<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">
<i th:class="${option.icon}"></i>
</a>
</div>
</div>
</div>