{# Reusable Jinja macros for paginated + sortable tables on /ui/. Caller passes a ``SortState`` and a ``PageState`` from ``bty.web._table_state``. The macros render Bootstrap-flavoured table-header links and a pagination footer that preserve every other query param via ``preserved`` so an active filter survives a click on a column header. #} {# Sortable column header. - ``label``: human text shown in the header cell. - ``column``: SQL column key matching one of the page's allowlist entries (see _table_state.parse_sort). - ``sort``: the SortState parsed for this request. - ``preserved``: query-param dict to keep (filters, per_page, ...). - ``th_attrs`` (optional): extra attributes for the ``