There is no reason to not check for the collections in the search results view as well.
In fact, the inconsistency before this change caused an issue where the
collections column will be shown on first load, but when a search is
performed (or cleared) the column will never be shown again.
Meanwhile, the current_collection is already set in BaseListingView anyway,
so it makes sense to put it in the context from there.
This has been around since the start (see
cba8f851d7/wagtail/wagtaildocs/views/documents.py)
However, its use in the template was removed in
c73d5c6ecc and was never restored.
Even when it was still in place, it wasn't implemented as a proper
filter. Instead, it was treated as a search query string.
For images, this was restored in
233e7f5189 with actual database-level
filtering.
This defers the instantiation of the columns at the point when they're needed instead of very early on in the view, when other variables needed may not be available yet
This also reduces the divergence between the BaseListingView and the IndexView
This documentation change clarifies that MultipleChooserPanel can only
be used when the inline model has a ForeignKey to a model that
implements Wagtail's chooser interface. Currently the docs mention
"a chooser for a ForeignKey relation" but it's not obvious how that
restricts which models can be pointed to or how to implement this for a
non-(image, document, snippet, page) model.
Relates to #10646.
It is only shown for screen readers, which is inconsistent with the actual visible text.
It also makes the captions unnecessarily verbose, as the dimensions info is not very useful in the image listings
To safely handle non-integer primary keys. This is mostly useful for
snippets, but do it everywhere for consistency and in case of custom
document and image models.
If the aria-label is too specific, e.g. 'Select page', 'Select document'
(and in the case of images it's 'Select image <image title> <image
dimensions>), it is hard for voice control users to click on the
checkbox because they have to specify the full label.
Instead, enforce a simple 'Select' aria-label and use aria-describedby
to describe the checkbox by referring to the title in the title column.