bolo-fantastic/article-list.ftl

151 lines
7.8 KiB
Plaintext
Raw Normal View History

2020-05-20 14:35:05 +00:00
<#--
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">
2020-08-25 15:00:31 +00:00
<div class="blog-slider__item swiper-slide">
2020-08-16 16:43:25 +00:00
<div class="blog-slider__img">
2020-09-29 16:49:32 +00:00
<a href="${article.articlePermalink}">
2020-10-06 14:05:43 +00:00
<img class="thumbnail" src="${adminUser.userAvatar!}" height="250" width="150"
data-src="${article.articleImg1URL}" alt="${article.articleTitle!}"
referrerpolicy="origin">
2020-08-16 16:43:25 +00:00
</a>
</div>
2020-05-20 14:35:05 +00:00
<div class="blog-slider__content">
<div>
<span class="blog-slider__code"
style="display:inline-block">${article.articleCreateDate?string("yyyy年MM月dd日")}</span>
2020-05-20 14:35:05 +00:00
<#if article.categoryURI??>
2020-09-29 16:49:32 +00:00
<h1 style="display:inline-block"><a class="has-link-black-ter"
href="/category/${article.categoryURI}">${article.articleCategory}</a></h1>
2020-05-20 14:35:05 +00:00
</#if>
</div>
2020-09-29 16:49:32 +00:00
<h2 class="blog-slider__title "><a class="title is-5"
href="${article.articlePermalink}">${article.articleTitle!}</a>
</h2>
2020-05-20 14:35:05 +00:00
<div class="blog-slider__text" content="">
<#if article.articleAbstractText!?length gt 24>
${article.articleAbstractText!?substring(0, 24)} ......<#else>
${article.articleAbstractText!}</#if>
</div>
2020-09-29 16:49:32 +00:00
<a href="${article.articlePermalink}"
2020-05-20 14:35:05 +00:00
class="blog-slider__button">阅读更多</a>
</div>
</div>
</div>
<div class="blog-slider__pagination"></div>
</div>
</div>
<#else>
<div class="card">
2020-08-16 16:43:25 +00:00
<div class="card-image">
2020-09-29 16:49:32 +00:00
<a href="${article.articlePermalink}">
2020-10-06 14:05:43 +00:00
<img class="thumbnail" src="${adminUser.userAvatar!}" height="250" width="150"
data-src="${article.articleImg1URL}" alt="${article.articleTitle!}"
referrerpolicy="origin">
2020-08-16 16:43:25 +00:00
</a>
</div>
2020-05-20 14:35:05 +00:00
<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>
2020-05-20 14:35:05 +00:00
<#if article.articleCategory != "">
2020-09-29 16:49:32 +00:00
<h1 style="display:inline-block"> <a class="has-link-black-ter"
href="/category/${article.categoryURI}">${article.articleCategory}</a></h1>
2020-05-20 14:35:05 +00:00
</#if>
</div>
</div>
2020-09-29 16:49:32 +00:00
<h2 class="title is-size-5 is-size-5-mobile has-text-weight-normal">
2020-05-20 14:35:05 +00:00
<a class="has-link-black-ter"
2020-09-29 16:49:32 +00:00
href="${article.articlePermalink}">${article.articleTitle!}</a>
2020-05-20 14:35:05 +00:00
2020-09-29 16:49:32 +00:00
</h2>
2020-05-20 14:35:05 +00:00
<div id="is-hidden-touch" class="content is-hidden-touch">
<#if article.articleAbstractText!?length gt 128>
${article.articleAbstractText!?substring(0, 128)} ......<#else>
${article.articleAbstractText!}</#if>
<#-- ${article.articleAbstractText!?substring(0, 128)} ...... -->
</div>
<div class="level is-mobile">
<div class="level-start">
<div class="level-item">
<a class="button is-size-7 is-light"
2020-09-29 16:49:32 +00:00
href="${article.articlePermalink}">阅读更多</a>
2020-05-20 14:35:05 +00:00
</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"
2020-09-29 16:49:32 +00:00
href="${path}?p=${paginationPreviousPageNum}">上一页</a>
2020-05-20 14:35:05 +00:00
</div>
</#if>
<#if paginationCurrentPageNum !=paginationLastPageNum>
<div class="pagination-next">
<a class="is-flex-grow has-text-black-ter"
2020-09-29 16:49:32 +00:00
href="${path}?p=${paginationNextPageNum}">下一页</a>
2020-05-20 14:35:05 +00:00
</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"
2020-09-29 16:49:32 +00:00
href="${path}?p=${paginationPageNum}">${paginationPageNum}</a></li>
2020-05-20 14:35:05 +00:00
</#if>
</#list>
</ul>
</nav>
</div>
</div>