{# Selection bar for a server-rendered photo grid (album edit mode, album add screen). THE URL IS THE STATE. The selection is carried on the querystring — `select=all` plus `exclude_id`, or `select_id` per ticked card (routes/albums.py:SelectionView) — exactly like the filters and the page number. So the server renders which cards are ticked and what the count is, pagination links carry the selection, and the POST that acts on it reads the same parameters. selection_bar.js only keeps the URL in step as the user clicks, so ticking a card need not reload the page. `select_all_label` must say what "all" MEANS on this screen, because the grids paginate and the visible page is not the selection: on the album it is every member, on the add screen it is every photo matching the filters. Usage: {% call selection_bar('album-selection', selection, _('Select all 42 photos')) %} {% endcall %} #} {% macro selection_bar(id, selection, select_all_label) %}
{% endmacro %}