refactor: restore traditional pagination - #1661
Open
labmecanicatec wants to merge 3 commits into
Open
Conversation
- Re-enable pageable->GetPageSize() call
- Replace null parameters with actual page number and size - Use page->GetPageNumber() and page->GetPageSize() for pagination - Improves performance by limiting results per request
Contributor
There was a problem hiding this comment.
Pull request overview
This PR restores traditional, server-driven pagination across multiple admin and credits log screens by re-enabling page size usage from IPageable/PageInfo and adding a new Smarty {pagination} helper to render page navigation links.
Changes:
- Re-enable and consistently pass
GetPageNumber()/GetPageSize()into list-loading services/repositories to avoid accidental “pageSize=1” limiting whennullis coerced. - Add a Smarty
{pagination pageInfo=$PageInfo}function and wire it into several templates to display page navigation and result counts. - Adjust frontend pagination click handling to target the new pagination link markup.
Reviewed changes
Copilot reviewed 26 out of 26 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| Web/scripts/ajax-helpers.js | Updates AJAX pagination click selector for the new pagination link markup. |
| tpl/Credits/transaction_log.tpl | Adds {pagination} to the user transaction log partial and normalizes {datatable} call syntax. |
| tpl/Credits/credit_log.tpl | Adds {pagination} to the user credit log partial and normalizes {datatable} call syntax. |
| tpl/Admin/Users/manage_users.tpl | Adds {pagination} below the users table. |
| tpl/Admin/Users/credit_log.tpl | Adds {pagination} and minor include formatting cleanup. |
| tpl/Admin/Schedules/view_schedules.tpl | Adds {pagination} below the schedules table. |
| tpl/Admin/Schedules/manage_schedules.tpl | Adds {pagination} and swaps datatablefilter to datatable for the schedules table initialization. |
| tpl/Admin/Resources/manage_resources.tpl | Adds {pagination} below the resources table. |
| tpl/Admin/Reservations/manage_reservations.tpl | Adds {pagination} below the reservations table. |
| tpl/Admin/Payments/transaction_log.tpl | Adds {pagination} to the admin payments transaction log partial and normalizes {datatable} call syntax. |
| tpl/Admin/Groups/manage_groups.tpl | Adds {pagination} below the groups table. |
| tpl/Admin/Blackouts/manage_blackouts.tpl | Adds {pagination} below the blackouts table. |
| Presenters/ViewSchedulesPresenter.php | Passes page number + page size to schedules list retrieval. |
| Presenters/Admin/ManageUsersPresenter.php | Passes page size to user repository list retrieval; minor formatting cleanups. |
| Presenters/Admin/ManageSchedulesPresenter.php | Passes page size to schedules list retrieval. |
| Presenters/Admin/ManageResourcesPresenter.php | Passes page size to resources repository list retrieval. |
| Presenters/Admin/ManageReservationsPresenter.php | Passes page size to reservations filtered load; minor formatting cleanups. |
| Presenters/Admin/ManageGroupsPresenter.php | Passes page size to groups repository list retrieval. |
| Presenters/Admin/ManageBlackoutsPresenter.php | Passes page size to blackouts filtered load. |
| Pages/Admin/ManageUsersPage.php | Restores GetPageSize() by delegating to the wrapped pageable implementation. |
| Pages/Admin/ManageSchedulesPage.php | Restores GetPageSize() (with existing cap logic) to support server pagination again. |
| Pages/Admin/ManageResourcesPage.php | Restores GetPageSize() (with existing cap logic) to support server pagination again. |
| Pages/Admin/ManageReservationsPage.php | Restores GetPageSize() by delegating to the wrapped pageable implementation. |
| Pages/Admin/ManageGroupsPage.php | Restores GetPageSize() by delegating to the wrapped pageable implementation. |
| Pages/Admin/ManageBlackoutsPage.php | Restores GetPageSize() by delegating to the wrapped pageable implementation. |
| lib/Common/SmartyPage.php | Registers {pagination} and implements CreatePagination/CreatePageLink; adjusts DataTables initialization. |
Suppressed comments (2)
Web/scripts/ajax-helpers.js:277
- ajaxPagination reads data attributes from
$(e.target). If the click originates from a nested element inside the (e.g., an icon/span), data-page/data-page-size will be missing and pagination will break. Use $ (this) and/or select anchors by data attributes so all pagination links are handled consistently.
element.find('a.page-link').on('click', function (e) {
e.preventDefault();
var a = $(e.target);
callback(a.data('page'), a.data('page-size'));
});
lib/Common/SmartyPage.php:749
- CreateDataTableFilter's language configuration maps the Info strings incorrectly:
infois currently set to the Filter text, andinfoEmptyis set to the Info text. This produces incorrect UI copy in the table footer.
const tableFilter = new DataTable("#' . $tableId . '", {
"dom": \'<"d-flex justify-content-between my-1"fl><t>t<"d-flex justify-content-center"i><"d-flex justify-content-center"p><"clear">\',
"pageLength": ' . $defaultPageSize . ',
"lengthMenu": ' . $lengthMenu . ',
language: {
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
labmecanicatec
force-pushed
the
feat/traditional-pagination
branch
from
August 24, 2026 15:02
c04639f to
67a38fd
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 26 out of 26 changed files in this pull request and generated 8 comments.
Suppressed comments (1)
lib/Common/SmartyPage.php:791
- Use the existing
PageInfo::Allconstant instead of the magic-1; this keeps the link coupled to the paging contract if its sentinel changes.
$sb->Append($this->CreatePageLink(['class' => 'link-primary', 'page' => 1, 'size' => -1, 'text' => $viewAllText], $smarty));
- Restore CreatePagination and CreatePageLink methods - Enable page navigation with prev/next buttons - Display results range and total count - Add data attributes for pagination handling - Replace view all behavior with paginated browsing Assisted-by: Claude:claude-haiku-4.5
labmecanicatec
force-pushed
the
feat/traditional-pagination
branch
from
August 24, 2026 21:05
67a38fd to
5a34e01
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Close: #1612
Assisted-by: Claude:claude-haiku-4.5