Renamed the is_needed property to is_paged in the Pagination utility.

This commit is contained in:
2023-02-04 10:26:28 +08:00
parent 511328a0bd
commit 8be44ccf5f
3 changed files with 12 additions and 12 deletions

View File

@ -19,7 +19,7 @@ pagination.html: The pagination navigation bar.
Author: imacat@mail.imacat.idv.tw (imacat)
First written: 2023/1/26
#}
{% if pagination.is_needed %}
{% if pagination.is_paged %}
<nav aria-label="Page navigation">
<ul class="pagination">
{% for link in pagination.page_links %}

View File

@ -88,7 +88,7 @@ class Pagination(t.Generic[T]):
self.__total_pages: int = 0 if len(items) == 0 \
else int((len(items) - 1) / self.page_size) + 1
"""The total number of pages."""
self.is_needed: bool = self.__total_pages > 1
self.is_paged: bool = self.__total_pages > 1
"""Whether there should be pagination."""
self.__default_page_no: int = 0
"""The default page number."""