2023-03-25 16:28:00 +08:00

23 lines
1.1 KiB
HTML

<div xmlns:th="https://www.thymeleaf.org"
th:fragment="widget (hide)"
th:class="'card widget ' + ${hide}"
th:with="num = ${#strings.isEmpty(theme.config.sidebar.categories_num)? 10 : T(java.lang.Integer).parseInt(theme.config.sidebar.categories_num)},
categories = ${categoryFinder.list(1,num)},
isEmpty = ${#lists.isEmpty(categories)}">
<div class="card-title">
<i class="fa fa-th-large card-title-label"></i><span>分类</span>
<a th:if="${categories.hasNext}" class="card-more" th:href="@{/categories}">更多<i
class="fa fa-angle-double-right"></i></a>
</div>
<div th:if="${isEmpty}" class="card-empty">暂无分类</div>
<div th:unless="${isEmpty}" class="card-content">
<ul class="menu-list">
<li th:each="category : ${categories}">
<a class="level is-marginless" th:href="${category.status.permalink}">
<span class="level-item" th:text="${category.spec.displayName}"></span>
<span class="level-item tag" th:text="${category.status.postCount}"></span>
</a>
</li>
</ul>
</div>
</div>