openvk/Web/Presenters/templates/components/paginator.xml
mrilyew 53f6b3e12b
Обновы для плейлистов и поиска (#1137)
* search: a bit refactor

* search: a bit refactor 2

* audios: a bit changes

* results highlight, midnight changes, player insear

* add audio download button, simplify css

* upload page changes, add playlist add menu

* -comments search, arrow keys on tips

* move $query var and optimize users/groups.search

го рофлить

* слегка проебался
2024-10-25 16:28:35 +03:00

12 lines
1 KiB
XML

{var $space = $conf->space ?? 3}
{var $pageCount = ceil($conf->count / $conf->perPage)}
<div n:if="!($conf->page === 1 && $conf->count <= $conf->perPage)" n:attr="style => (!$conf->tidy ? 'padding: 8px;')">
<div n:class="paginator, ($conf->atBottom ?? false) ? paginator-at-bottom, ($conf->tidy ? 'tidy')">
<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)}">&laquo;</a>
{for $j = $conf->page - ($space-1); $j <= $conf->page + ($space-1); $j++}
<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>
{/for}
<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)}">&raquo;</a>
</div>
</div>