Core

/views/components/Pagination.html (592 B)

 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
{% import (
"github.com/valyala/fasthttp"

"{{{ .Package }}}/app/lib/filter"
) %}

{% func Pagination(count int, params *filter.Params, u *fasthttp.URI) %}{% stripspace %}
{% if params != nil %}
{% if params.HasNextPage(count) %}
<div class="right">
<a href="?{%s params.NextPage().ToQueryString(u) %}">Next page</a>
</div>
{% endif %}
{% if params.HasPreviousPage() %}
<div class="left">
<a href="?{%s params.PreviousPage().ToQueryString(u) %}">Previous page</a>
</div>
{% endif %}
{% endif %}
{% endstripspace %}{% endfunc %}