{% import "adminsite/_icons.html" as icons %}
{% import "adminsite/_values.html" as values %}
{#- A reload brings new rows, none of them ticked, so it starts the selection
the Actions menu reads again. -#}
{% if request.headers.get("hx-request") %}
{% with oob = true %}
{% include "adminsite/_records_total.html" %}
{% include "adminsite/_filter_chips.html" %}
{% if panels %}
{% include "adminsite/_filters_count.html" %}
{% include "adminsite/_filters_footer.html" %}
{% endif %}
{% include "adminsite/_bulk_actions.html" %}
{% endwith %}
{% endif %}
{#- The rows come before their total, which this asks for once they are on
screen. A table redrawn before the answer is back stops it, so a slow
count never overwrites the newer table's. -#}
{% if counting %}
{% endif %}
{#- Each dialog is its own form, so a required input in one dialog never
stops another action from submitting. On submit it copies the ticked
rows across from the table. -#}
{% for item in actions if item.needs_dialog %}
{% endfor %}
{% include "adminsite/_action_forms.html" %}
{% include "adminsite/_records_count.html" %}
{% if page_sizes %}
{% endif %}
{% if page.keyset %}
{% set previous = urls.here(page=None, after=None, before=page.previous_cursor or None) %}
{% set next = urls.here(page=None, before=None, after=page.next_cursor or None) %}
{% else %}
{% set previous = urls.here(page=page_number - 1 if page_number > 2 else None) %}
{% set next = urls.here(page=page_number + 1) %}
{% endif %}