{# Pagination block. One file replaces the three near-identical copies (opportunities/_pagination, failures/_pagination, dashboard/ _pagination). Two ``pagination`` shapes ship across the audit: 1. ``AuditPaginationContext`` (opportunities, failures, layout_index) exposes ``query_string_without_page`` so any active filters round-trip through Prev/Next. 2. ``PaginationContext`` from governor_core (dashboard cost-drivers) doesn't expose it; sort key/dir come through as the ``sort_by`` / ``sort_dir`` template variables. The component handles both by preferring ``query_string_without_page`` when present (even if empty - the attribute existing flags "the route already stitched filters into me") and falling back to ``sort_by`` / ``sort_dir`` otherwise. Required context: - pagination Optional context: - sort_by, sort_dir (fallback only) - pagination_item_noun (string, default "results"). Set this on surfaces where the unit isn't generic - e.g. the opportunities table groups by ``affected_table`` and the dashboard's cost- drivers groups by ``destination_table`` / ``query_hash``. Using a precise noun stops users wondering why two numbers on the same page (this footer vs the summary card above) disagree. #} {%- set _noun = pagination_item_noun | default("results") -%} {%- if pagination.query_string_without_page is defined -%} {%- set _qs = pagination.query_string_without_page -%} {%- set _sep = "&" if _qs else "" -%} {%- else -%} {%- set _qs %}{% if sort_by %}sort={{ sort_by }}{% endif %}{% if sort_dir %}{% if sort_by %}&{% endif %}direction={{ sort_dir }}{% endif %}{% endset -%} {%- set _sep = "&" if _qs else "" -%} {%- endif -%} {% if pagination.total_items > 0 %}
Showing {{ pagination.start_index }} to {{ pagination.end_index }} of {{ pagination.total_items }} {{ _noun }}
{% if pagination.total_pages > 1 %} {% endif %}