2024-10-25 16:28:35 +03:00
|
|
|
{var $space = $conf->space ?? 3}
|
2021-11-27 15:19:17 +03:00
|
|
|
{var $pageCount = ceil($conf->count / $conf->perPage)}
|
|
|
|
|
2024-10-25 16:28:35 +03:00
|
|
|
<div n:if="!($conf->page === 1 && $conf->count <= $conf->perPage)" n:attr="style => (!$conf->tidy ? 'padding: 8px;')">
|
2024-11-02 11:16:25 +03:00
|
|
|
<div n:class="paginator, (($conf->atTop || $atTop) ?? false) ? paginator-at-top, ($conf->atBottom ?? false) ? paginator-at-bottom, ($conf->tidy ? 'tidy')">
|
2022-03-24 15:29:00 +03:00
|
|
|
<a n:if="$conf->page > $space" n:attr="class => ($conf->page === 1 ? 'active')" href="?{http_build_query(array_merge($_GET, ['p' => 1]), 'k', '&', PHP_QUERY_RFC3986)}">«</a>
|
2022-02-01 14:20:14 +03:00
|
|
|
{for $j = $conf->page - ($space-1); $j <= $conf->page + ($space-1); $j++}
|
2022-03-24 15:29:00 +03:00
|
|
|
<a n:if="$j > 0 && $j <= $pageCount" n:attr="class => ($conf->page === $j ? 'active')" href="?{http_build_query(array_merge($_GET, ['p' => $j]), 'k', '&', PHP_QUERY_RFC3986)}">{$j}</a>
|
2022-02-01 14:20:14 +03:00
|
|
|
{/for}
|
2022-03-24 15:29:00 +03:00
|
|
|
<a n:if="$conf->page <= $pageCount-$space" n:attr="class => ($conf->page === $pageCount ? 'active')" href="?{http_build_query(array_merge($_GET, ['p' => $pageCount]), 'k', '&', PHP_QUERY_RFC3986)}">»</a>
|
2022-02-01 14:20:14 +03:00
|
|
|
</div>
|
2020-06-07 19:04:43 +03:00
|
|
|
</div>
|