Fixes #3967
If there was no site configured, the listing views in the API would
break with an AttributeError.
Now, the following happens if there is no site record:
- In the Admin API, all pages are returned but links in the response do
not include a domain name
- In the Public API, no pages are returned
The pages listed when browsing the /admin/pages/ explorer differed from
the pages listed in the new React/admin API powered pop-out explorer.
The latter did not pass the queryset through the
'construct_explorer_page_queryset' hook, so pages that should have been
hidden were visible. Visiting these pages in the explorer could then
lead to unexpected behaviours, as hidden sections of the site became
browsable.
A new `for_explorer=1` query parameter has been added to the admin API,
which will pass the page queryset through the
'construct_explorer_page_queryset' hooks.
"View live" buttons in flash messages are now only displayed if the page
has a live URL. Editing pages that do not have a URL will no longer
produce broken buttons.
Fixes #3982
When all pages on a site is private, the last_mods set will be empty
causing a crash when trying to get the max value from it.
This fix adds a test that the set is truthy (not empty) before calling
max.
* add url parsing for ordering
* add data_fields_with_ordering
* send data_fields_with_ordering and use in template
* use full words 'ascending' not 'asc'
* add styles for ordered headings
* add links for changing ordering to headings
* linting
* move field ordering to the form page model
* use form page model field ordering
* view to use rearranged field ordering
* add tests for new submission list ordering
* change to be easier to read
* Update tests to reflect new listing with ordering information
This allows Wagtail to load in many search results for a single search
query. It also fixes the behaviour when the limit is not set (currently
automatically limits to 10 results but now will return all results).