Global: Fix paginator display in lists

It's probably a crutch, but oh well. Just continued an existing crutch
This commit is contained in:
Maxim Leshchenko 2021-12-04 13:25:57 +02:00
parent 0cca615d2a
commit 4048f21f59
No known key found for this signature in database
GPG key ID: BB9C44A8733FBEEE
4 changed files with 15 additions and 9 deletions

View file

@ -36,10 +36,11 @@
<div style="padding: 8px;">
{include "components/paginator.xml", conf => (object) [
"page" => $page,
"count" => $count,
"amount" => sizeof($data),
"perPage" => $perPage ?? OPENVK_DEFAULT_PER_PAGE,
"page" => $page,
"count" => $count,
"amount" => sizeof($data),
"perPage" => $perPage ?? OPENVK_DEFAULT_PER_PAGE,
"atBottom" => true,
]}
</div>
{else}

View file

@ -34,10 +34,11 @@
<div style="padding: 8px;">
{include "../components/paginator.xml", conf => (object) [
"page" => $page,
"count" => $count,
"amount" => sizeof($gifts),
"perPage" => OPENVK_DEFAULT_PER_PAGE,
"page" => $page,
"count" => $count,
"amount" => sizeof($gifts),
"perPage" => OPENVK_DEFAULT_PER_PAGE,
"atBottom" => true,
]}
</div>
{/block}

View file

@ -1,7 +1,7 @@
{var $space = 2}
{var $pageCount = ceil($conf->count / $conf->perPage)}
<div n:if="!($conf->page === 1 && $conf->count <= $conf->perPage)" class="paginator">
<div n:if="!($conf->page === 1 && $conf->count <= $conf->perPage)" n:class="paginator, $conf->atBottom ? paginator-at-bottom">
{if $conf->page > $space}
<a n:attr="class => ($conf->page === 1 ? 'active')" href="?{http_build_query(array_merge($_GET, ['p' => 1]), 'k', '&', PHP_QUERY_RFC3986)}">«</a>
{/if}

View file

@ -1560,6 +1560,10 @@ body.scrolled .toTop:hover {
margin-top: -1px;
}
.paginator-at-bottom {
margin-top: -6px;
}
.paginator a {
border-top: 3px solid transparent;
display: inline-block;