From 06b3315641a08da63f2d67e53e9397df80454e77 Mon Sep 17 00:00:00 2001 From: Konrad du Plessis Date: Thu, 23 Apr 2026 15:45:41 +0200 Subject: [PATCH] fix(adjustments): pagination URL + filter label accessibility + teams.first N+1 Three code-review fixes: 1. Pagination links were building ?status=...&page=2&page=3 on every click because the template appended &page= onto an already- serialised querystring. Added a reusable url_replace template tag that replaces a single key (pre-empts Tasks 5 / 9 which also need it) and piped the pagination hrefs through it. Added rel=prev/next + aria-label on the tags while we were here. 2. Filter-bar labels had no for= attribute, so screen readers announced the native {# --- Type multi-select (Bonus / Overtime / etc.) --- #} + {# Each label/input pair below has matching for=/id= so screen #} + {# readers announce the field name when focus moves into the #} + {# select. The .adj-multi class still drives Choices.js init — #} + {# adding id= is purely additive. #}
- - {% for t in adj_type_choices %} @@ -575,7 +579,7 @@ {# --- Workers multi-select (cross-filtered by Teams in Task 7) --- #}
- + {% for t in all_teams_for_filter %} @@ -597,8 +601,8 @@ {# --- Status single-select (Unpaid / Paid / All) --- #}
- - @@ -607,13 +611,13 @@ {# --- Date range --- #}
- - From +
- - To +
@@ -651,7 +655,10 @@ + {# aria-label is the accessible name screen readers announce; #} + {# title= is kept as the mouse-hover tooltip for sighted users. #} Date @@ -676,12 +683,18 @@
{# --- Pagination --- #} + {# Hrefs go through the `url_replace` template tag (see + core/templatetags/format_tags.py). It rebuilds the current querystring + with ONLY the `page` key swapped out — prevents the `?page=2&page=3` + stacking bug that happened when we naively appended `&page=X` to the + raw `request.GET.urlencode`. #} {% if adj_page.has_other_pages %}