bolo-fantastic/article-list.ftl
2022-07-02 14:00:13 +08:00

162 lines
7.9 KiB
Plaintext

<#--
Bolo - A stable and beautiful blogging system based in Solo.
Copyright (c) 2020, https://github.com/adlered
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
-->
<#-- Bolo - A stable and beautiful blogging system based in Solo. Copyright (c) 2020, https://github.com/adlered This
program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public
License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later
version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License
for more details. You should have received a copy of the GNU Affero General Public License along with this program.
If not, see <https://www.gnu.org/licenses/>. -->
<div>
<#list articles as article>
<#if article.articlePutTop>
<div class="level">
<div class="blog-slider card">
<div class="blog-slider__wrp swiper-wrapper">
<div class="blog-slider__item swiper-slide">
<div class="blog-slider__content">
<div>
<span class="blog-slider__code"
style="display:inline-block">${article.articleCreateDate?string("yyyy.MM.dd")}</span>
&nbsp;浏览
<#assign viewCountStr=article.articleViewCount?string('#.###')/>
<#if viewCountStr?length gt 3>
<#assign viewCount=viewCountStr?number/>
<#assign viewCountK=viewCount/1000 />
${viewCountK?string('#.##')}K
<#else>
${article.articleViewCount}
</#if>&nbsp;
<#if article.categoryURI??>
<h1 style="display:inline-block"><a class="has-link-black-ter"
href="/category/${article.categoryURI}">${article.articleCategory}</a></h1>
</#if>
</div>
<h2 class="blog-slider__title "><a class="title is-6"
href="${article.articlePermalink}">${article.articleTitle!}</a>
</h2>
<div class="blog-slider__text is-size-6" content="" >
<#if article.articleAbstractText!?length gt 150>
${article.articleAbstractText!?substring(0, 150)} <#else>
${article.articleAbstractText!}</#if>
</div>
<a href="${article.articlePermalink}"
class="button is-size-7 is-light">阅读更多</a>
</div>
</div>
</div>
<div class="blog-slider__pagination"></div>
</div>
</div>
<#else>
<div class="card">
<div class="card-content article " id="card-content" style="width: 100%">
<div class="level article-meta is-size-7 is-uppercase is-mobile is-overflow-x-auto">
<div class="level-left">
<time
class="level-item has-text-grey">${article.articleCreateDate?string("yyyy.MM.dd")}</time>
&nbsp;浏览
<#assign viewCountStr=article.articleViewCount?string('#.###')/>
<#if viewCountStr?length gt 3>
<#assign viewCount=viewCountStr?number/>
<#assign viewCountK=viewCount/1000 />
${viewCountK?string('#.##')}K
<#else>
${article.articleViewCount}
</#if>&nbsp;
<#if article.articleCategory != "">
<h1 style="display:inline-block"> <a class="has-link-black-ter"
href="/category/${article.categoryURI}">${article.articleCategory}</a></h1>
</#if>
</div>
</div>
<h2 class="title is-size-5 is-size-5-mobile has-text-weight-normal">
<a class="has-link-black-ter"
href="${article.articlePermalink}">${article.articleTitle!}</a>
</h2>
<div id="is-hidden-touch" class="content is-hidden-touch is-size-6">
<#if article.articleAbstractText!?length gt 200>
${article.articleAbstractText!?substring(0, 200)} <#else>
${article.articleAbstractText!}</#if>
</div>
<div class="level is-mobile">
<div class="level-start">
<div class="level-item">
<a class="button is-size-7 is-light"
href="${article.articlePermalink}">阅读更多</a>
</div>
</div>
</div>
</div>
</div>
</#if>
</#list>
<div class="card card-transparent">
<nav class="pagination is-centered" role="navigation" aria-label="pagination">
<#if paginationCurrentPageNum !=paginationFirstPageNum>
<div class="pagination-previous">
<a class="is-flex-grow has-text-black-ter"
href="${path}?p=${paginationPreviousPageNum}">上一页</a>
</div>
</#if>
<#if paginationCurrentPageNum !=paginationLastPageNum>
<div class="pagination-next">
<a class="is-flex-grow has-text-black-ter"
href="${path}?p=${paginationNextPageNum}">下一页</a>
</div>
</#if>
<ul class="pagination-list is-hidden-mobile">
<#list paginationPageNums as paginationPageNum>
<#if paginationPageNum==paginationCurrentPageNum>
<li><span class="pagination-link is-current">${paginationPageNum}</span></li>
<#else>
<li><a class="pagination-link"
href="${path}?p=${paginationPageNum}">${paginationPageNum}</a></li>
</#if>
</#list>
</ul>
</nav>
</div>
</div>
<style type="text/css">
.blog-slider__img {
margin-left: 20px;
width: 240px;
height: 150px;
}
</style>