diff --git a/core/templates/core/_adjustment_row.html b/core/templates/core/_adjustment_row.html index d07d830..95606ec 100644 --- a/core/templates/core/_adjustment_row.html +++ b/core/templates/core/_adjustment_row.html @@ -55,9 +55,13 @@ {# --- Team (worker's first team, if any — many workers are unteamed) --- #} + {# Uses `teams.all` (NOT `teams.first`) because the view's #} + {# .prefetch_related('worker__teams') populates `_prefetched_objects_cache` #} + {# for `.all()` calls — `.first()` would ignore the cache and fire a #} + {# fresh `ORDER BY ... LIMIT 1` SQL query per row (up to ~50 per page). #} - {% with team=adj.worker.teams.first %} - {% if team %}{{ team.name }}{% else %}{% endif %} + {% with teams=adj.worker.teams.all %} + {% if teams %}{{ teams.0.name }}{% else %}{% endif %} {% endwith %} diff --git a/core/templates/core/payroll_dashboard.html b/core/templates/core/payroll_dashboard.html index 2166a19..e08422c 100644 --- a/core/templates/core/payroll_dashboard.html +++ b/core/templates/core/payroll_dashboard.html @@ -563,9 +563,13 @@ {# --- 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 %}