* Add tests for custom image on multiple image uploader
* Output form media on image add/edit views
* Output form media for 'add image' form within image chooser modal
Note: this won't work reliably if the media is hosted on a CDN, because script tags inserted as part of a jQuery DOM insertion (as modals are) are loaded asynchronously and not guaranteed to complete loading before inline scripts are run. It's better than not having the includes there at all though...
Currently any user with any page permission can view any page revision.
This commit fixes that, and ensures that the user has publish or edit
permission on the page before showing a page revision. If not, the user
is presented with a 403.
This maintains the current behavior if the user has no page permissions,
which is to redirect to the admin home page.
New tests have been added to cover these changes.
Fixes issue 5426.
When editing a rich text field and entering a link to a page whose Page
type overrides get_admin_display_title, the custom admin display title
is used both when browsing to select the page to link to and also when
viewing the rich text editor.
The first behavior is consistent with how custom admin display titles
are used throughout the admin, but the second behavior is not. The
Wagtail user should be able to use the rich text field as a reasonable
preview of what the rendered content will look like for the end user. To
do this, the "real" page title should be used, not the admin one.
This commit alters the data that gets passed to the rich text editor so
that its title is the real page title and not the admin one.
Fixes issue 5131.
Modeladmin handles notification to the user if a model instance has protected ForeignKey
relationships. However, if the protected relation is a OneToOneField it raises an exception:
File ".../wagtail/wagtail/contrib/modeladmin/views.py", line 742, in post
for obj in qs.all():
AttributeError: 'MyRelatedModel' object has no attribute 'all'
because qs in this case is the related instance rather than a queryset of related instances
(as is the case for a ForeignKey).
This commit handles the OneToOneField case as well.
This hook mimics the functiolity provided by `construct_page_action_menu`
in that it constructs the final list of buttons to be shown in the wagtail
admin interface. This means that within this function button's can be
removed, added or re-ordered.
See #4925