Currently, the label shown for a StructBlock's collapsed representation takes its content from the first sub-block of the StructBlock, which isn't always what you want. Add a new `label_format` meta option to StructBlock to allow customising this - e.g. `label_format = "Profile for {first_name} {surname}"`
Tabbing (navigation using Tab or Shift + Tab keys) will now close
the menu and move to the next focusable element on the page instead
of focusing the next menu item.
The previous behaviour was a deviation from the ARIA menu practices:
https://w3c.github.io/aria-practices/#menu
Further changes / cleanup:
* Consume keyboard events like arrow down to prevent the browser
from interpreting them.
* Refactor repeated setTimeout and `.focus()` calls into single
`focusElement(el)` function. Let's keep it DRY!
Fixes #7290
- Due to how high-contrast mode works, there was no visual separation between the sidebar and the main content, adding a transparent border resolves this without having any visual impact in non-high contrast mode
- fixes #7456
Attempting to call get_image_model or get_document_model at the top level of a models.py file currently fails with "Models aren't loaded yet". This can be avoided by passing `require_ready=False` to apps.get_model.
This change makes it possible for third-party apps to define abstract models with foreign key references to the possibly-custom image or document model (which can then be subclassed into concrete models in the project itself - defining concrete models in the third-party app probably still isn't safe, as the model will end up being baked into the third-party app's migrations).
* Make more panels type collapsible
* Remove duplicate js in homepage template
* Move collapsible code into its own js file
* Change $li to $target in collapsible.js, as in #6342 Closes #7364, #6342, #6187, #2123
Co-authored by: Fabien Le Frapper <contact@fabienlefrapper.me>
Co-authored-by: Robbie Mackay <rm@robbiemackay.com>
Co-authored-by: Scott Cranfill <scott.cranfill@jpl.nasa.gov>
This allows insight into which images are taking the longest to generate, which fail to render at all, and potentially which images are causing crashes (as in they start, but never stop).
The logging is intentionally only on DEBUG level, so it's opt-in, and is also reasonably quiet so it doesn't bloat logs.
* Pulling in _editor_js.html is unnecessary - the only JS dependency that isn't in form media is now modal_workflow.js. (So close to being able to ditch the template override entirely!)
* Omit the 'clear' button, as this is a required field.
* Converts inline panel anchor to button to make keyboard focusable.
* Adds type='button' and undoes change to expanding_formset.js.
* Release notes for #7346
Co-authored-by: Storm Heg <storm@stormheg.co>
Currently, when a user copies a page for translation, the 'copy' log action is used.
This adds a more specific 'copy_for_translation' operation to be used instead when the user is translating.