{# 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) #} {%- 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 }} results
{% if pagination.total_pages > 1 %} {% endif %}