<th:block th:fragment="home-moment(_moments,tags,path)" th:with="_path = ${#strings.isEmpty(path) ? '/moments' : path}">

    <div class="blog_list">
        <div class="blog_list_inner" uk-height-viewport="offset-top: true">
            <div class="moment_cat_nav">
                <ul id="cat_nav_items">
                    <li><a th:data="@{${_path}}" class="" th:classappend="${#lists.isEmpty(param.tag) ? 'active' : ''}"
                        ><span>全部</span></a>
                    </li>
                    <li  th:each="tag,iStat : ${tags}">
                        <a th:data="@{${_path}(tag=${tag.name})}" class=""
                        th:classappend="${#lists.contains(param.tag, tag.name) ? 'active' : ''}"
                        ><span>[[${tag.name}]]</span></a>
                    </li>
                </ul>
            </div>

            <div id="post_item" class="moment_list">

                <th:block th:replace="~{macro/tpl/content-moment :: content-moment(${_moments.items})}"></th:block>

                <th:block th:if="${#lists.isEmpty(_moments.items)}">
                    <th:block th:replace="~{macro/tpl/content-none}"/>
                </th:block>

            </div>
            <th:block th:if="${_moments.totalPages>1}">
                <div id="t_pagination">
                    <div class="post-paging"
                        th:with="tag = ${#lists.isEmpty(param.tag) ? null : param.tag[0]},_page = ${_moments.page+1}">
                        <a th:if="${_moments.hasNext() and #strings.isEmpty(tag)}"
                            th:data="@{${_path}(page=${_page})}"
                            th:text="${theme.config.base_set.site_page}"></a>
                        <a th:if="${_moments.hasNext() and not #strings.isEmpty(tag)}"
                            th:data="@{${_path}(tag=${tag},page=${_page})}"
                            th:text="${theme.config.base_set.site_page}"></a>
                        <form class="page-jump-form" method="get" th:action="@{${_path}}">
                            <span class="page-jump-label">转到</span>
                            <input th:if="${not #strings.isEmpty(tag)}" type="hidden" name="tag" th:value="${tag}" />
                            <span class="page-jump-input-wrap">
                                <button class="page-jump-step page-jump-step-down" type="button"
                                    title="减少页码" aria-label="减少页码"><i class="ri-subtract-line"
                                        aria-hidden="true"></i></button>
                                <input class="page-jump-input" type="number" name="page" min="1"
                                    th:max="${_moments.totalPages}" th:value="${_moments.page}"
                                    inputmode="numeric" aria-label="页码" autocomplete="off" required />
                                <button class="page-jump-step page-jump-step-up" type="button"
                                    title="增加页码" aria-label="增加页码"><i class="ri-add-line"
                                        aria-hidden="true"></i></button>
                            </span>
                            <span class="page-jump-total">/ [[${_moments.totalPages}]]</span>
                            <button class="page-jump-submit" type="submit" title="跳转到指定页"
                                aria-label="跳转到指定页"><i class="ri-arrow-right-line"></i></button>
                        </form>
                    </div>
                </div>
            </th:block>

            <div id="comment_form_reset"></div>
        </div>
    </div>
</th:block>
