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.
Fixes #4602 as per https://github.com/wagtail/wagtail/issues/4602#issuecomment-479539444 (option 2).
Previously, given HTML input such as:
<p>
<i>a bunch of text before <embed alt="somepic" embedtype="image" format="fullwidth" id="1"/> after</i>
</p>
the `<embed>` would start a new block, but the converter would keep hold of references to currently-open tags such as the `<i>`, so that when the corresponding `</i>` tag was encountered, it could match it up to the opening tag and fill in the 'length' field on the resulting InlineStyleRange object. However, since the span length is calculated based on the text content of the _current_ block (which is now "after"), it would obtain the wrong result - or, when there is no content between the embed and the closing tag (and thus no current block), would throw the exception `'NoneType' object has no attribute 'text'`.
In this new approach, when the embed is encountered, the current block is closed _along with all of its styles and entities_, causing the lengths of those spans to be filled in correctly. After inserting the embed, the current block is then set to a replica of the previous block with all those styles and entities reopened, so that when the closing tag is finally encountered, the span length is correctly set based on the new 'after' block.
Some edit handlers, such as the 'unofficial' PerUserContentPanels recipe from #4749, vary their field list according to the current request/instance by hooking into bind_to. This was not being called on the comparison view, meaning that when these edit handlers are in use, the field list was never getting populated and so the view was wrongly reporting no changes.
Note that the bind_to method also allows binding a form, which we do still skip (since the comparison view doesn't construct one).
Improve the generation of `<title>` tags as follows:
* use `page` in preference to `self` (self has been semi-deprecated ever since we added jinja2 support)
* Retrieve current site with `{% wagtail_site %}` rather than page.get_site so that it works on non-pages such as 404s
* Fill in the 'title' block on 404.html
Previously, this would fail, as `user_can_copy_obj` doesn't handle root
pages. Root pages also are special in a number of ways, and handling
copying is tricky and non-obvious.
If someone needs to show root pages (for some reason), they'll have to
special case them themselves.