fix visual problem about pagination

This commit is contained in:
thisLight 2022-02-12 23:19:50 +08:00
parent cba72a6238
commit 6b82f98b5d
3 changed files with 13 additions and 4 deletions

View file

@ -7,7 +7,7 @@
</a>
</li>
{% endif %}
{% for n in range(1, page.total, 1) %}
{% for n in range(1, page.total+1, 1) %}
<li class="{{ 'active' if page.current == n else 'waves-effect' }}">
<a href="{{ url_for('page/'+n+'/') }}">{{ n }}</a>
</li>

View file

@ -1,8 +1,17 @@
{% extends 'includes/layout.njk' %}
{% from "includes/paginator.njk" import Paginiation with context %}
{% from "includes/postlist.njk" import PostList with context %}
{% import "includes/cards.njk" as cards with context %}
{% macro HomePaginiation() %}
<ul class="pagination center">
{% for n in range(1, page.total+1, 1) %}
<li class="{{ 'active' if page.current == n else 'waves-effect' }}">
<a href="{{ url_for('page/'+n+'/') if n != 1 else url_for('') }}">{{ n }}</a>
</li>
{% endfor %}
</ul>
{% endmacro %}
{% macro TagPanel(tags) %}
<div class="card-panel" style="padding-top: 12px; padding-bottom: 12px;">
<span class="chip transparent">Tags</span>
@ -28,7 +37,7 @@
<span>No Posts Here...</span>
{% endif %}
<div class="center">
{{ Paginiation() }}
{{ HomePaginiation() }}
</div>
</div>
<div class="col m4 l3 hide-on-small-only">