feature: add pagination on comments

Fixes: #354

Signed-off-by: Leonidas Spyropoulos <artafinde@archlinux.org>
This commit is contained in:
Leonidas Spyropoulos 2022-08-02 20:27:47 +03:00
parent 1d6335363c
commit 2c080b2ea9
No known key found for this signature in database
GPG key ID: 59E43E106B247368
3 changed files with 22 additions and 2 deletions

View file

@ -33,6 +33,14 @@
<span class="text">{{ "Latest Comments" | tr }}</span>
<span class="arrow"></span>
</h3>
{% set page = ((O / PP) | int) %}
{% set pages = ((comments_total / PP) | ceil) %}
{% if pages > 1 %}
<p class="comments-header-nav">
{{ page | pager_nav(comments_total, prefix) | safe }}
<p>
{% endif %}
</div>
{% for comment in comments.all() %}
{% include "partials/packages/comment.html" %}