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

@ -40,6 +40,7 @@
"count" => $count, "count" => $count,
"amount" => sizeof($data), "amount" => sizeof($data),
"perPage" => $perPage ?? OPENVK_DEFAULT_PER_PAGE, "perPage" => $perPage ?? OPENVK_DEFAULT_PER_PAGE,
"atBottom" => true,
]} ]}
</div> </div>
{else} {else}

View file

@ -38,6 +38,7 @@
"count" => $count, "count" => $count,
"amount" => sizeof($gifts), "amount" => sizeof($gifts),
"perPage" => OPENVK_DEFAULT_PER_PAGE, "perPage" => OPENVK_DEFAULT_PER_PAGE,
"atBottom" => true,
]} ]}
</div> </div>
{/block} {/block}

View file

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

View file

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