mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
housekeep: move templates/partials/widgets/* to templates/partials/
Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
parent
dbbae97038
commit
2feb9b90b2
6 changed files with 7 additions and 7 deletions
28
templates/partials/pager.html
Normal file
28
templates/partials/pager.html
Normal file
|
@ -0,0 +1,28 @@
|
|||
{# A pager widget that can be used for navigation of a number of results.
|
||||
|
||||
Inputs required:
|
||||
|
||||
prefix: Request URI prefix used to produce navigation offsets
|
||||
singular: Singular sentence to be translated via tn
|
||||
plural: Plural sentence to be translated via tn
|
||||
PP: The number of results per page
|
||||
O: The current offset value
|
||||
total: The total number of results
|
||||
#}
|
||||
|
||||
{% set page = ((O / PP) | int) %}
|
||||
{% set pages = ((total / PP) | ceil) %}
|
||||
|
||||
<div class="pkglist-stats">
|
||||
<p>
|
||||
{{ total | tn(singular, plural) | format(total) }}
|
||||
{% if pages %}
|
||||
{{ "Page %d of %d." | tr | format(page + 1, pages) }}
|
||||
{% endif %}
|
||||
</p>
|
||||
{% if pages > 1 %}
|
||||
<p class="pkglist-nav">
|
||||
{{ page | pager_nav(total, prefix) | safe }}
|
||||
<p>
|
||||
{% endif %}
|
||||
</div>
|
Loading…
Add table
Add a link
Reference in a new issue