Pagination resets filters #1
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Move pagination logic to script and move between pages passing all needed parameters
Issue #1 Resolved — PR #11 Merged
Root cause: Pagination links were generated with only the
pageparameter, discarding active filter state (school_id, order_by, asc, per_page). Clicking a page link reset all filters to defaults.Key changes (10 files, +789/-492):
QueryParamsfield toPaginationstruct withpageURL()helper to preserve filter parameters in pagination URLsbuildListCoursesQueryParams()encodes active filters into pagination linkssetupPaginationLinks()intercepts pagination clicks, reads current filter state from DOM, builds full URLs with all parametersdata-paginated,data-base-url,data-current-pageattributes to pagination nav for JS targetingCommits:
91c1778Issue #1 Resolved — Merged
Root cause: Pagination links were hardcoded with only the page number, dropping all active filter query parameters (school, sort order, direction, per-page). Navigating to page 2+ reset filters to defaults.
Key changes (10 files, +103/−34):
QueryParamsfield toPaginationstruct incore.templwithpageURL()helper that appends preserved filter params to page linksbuildListCoursesQueryParams()incourse.goencodes active filters (school_id, order_by, asc, per_page) into the pagination template contextsetupPaginationLinks()inmain.templintercepts pagination clicks, reads current filter state from the DOM, builds full URLs preserving all parametersdata-paginated/data-base-url/data-current-pageattributes to pagination nav for JS targetingReview feedback: Approved (lgtm) — no changes requested.
Test results: Build and tests passed on the fix/issue-1 branch before merge.
91c1778