0
0
mirror of https://github.com/wagtail/wagtail.git synced 2024-11-25 13:10:14 +01:00
Commit Graph

16705 Commits

Author SHA1 Message Date
nandini584
96349aad3e ActionController - Add noop method
- Useful for leveraging data-action approaches without needing a specific method functionality
2023-12-13 11:20:29 +10:00
Andy Chosak
c109c661c1 Docs: Clarify appropriate use of MultipleChooserPanel
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.
2023-12-13 07:32:00 +10:00
LB Johnston
5fa29a6c93 Add changelog/release notes - #11299 2023-12-13 07:17:43 +10:00
Sage Abdullah
260df904e9 Remove sr-only dimensions info in image listing
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
2023-12-13 07:17:06 +10:00
Sage Abdullah
3cd0094b36 Allow TitleColumn to have an id for the title text and use it in snippets
This allows the snippets' checkbox column for bulk actions to refer to
the title column correctly.
2023-12-13 07:17:06 +10:00
Sage Abdullah
539c27bc00 Consistently quote pk for title column's id and referring to it in bulk actions column
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.
2023-12-13 07:17:06 +10:00
Sage Abdullah
abe80bd279 Simplify bulk actions checkbox's aria labels to be consistent
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.
2023-12-13 07:17:06 +10:00
Sage Abdullah
e4ec5f24eb Remove unnecessary accessor in snippets' BulkActionsCheckboxColumn
Not necessary after fbfe8fe75f and 32ff36446b
2023-12-13 07:17:06 +10:00
Sage Abdullah
2cb490a767 Simplify BulkActionsCheckboxColumn to reuse BaseColumn's instance variable
Instead of using obj for the sake of not changing the template when it was first introduced (before the column class was made)
2023-12-13 07:17:06 +10:00
LB Johnston
e101c17aea Add Changelog for #11335 2023-12-13 06:40:43 +10:00
Matt Westcott
f4bcffa9fe Bump telepath to 0.3.1
This ensures that people upgrading to Django 5.0 will have a compatible version. Now that Python <3.8 and Django <3.2 are EOL, there's no reason for anyone to be running an older version.
2023-12-13 06:26:36 +10:00
Matt Westcott
efa15daa95 Release note for #11271 2023-12-12 15:55:26 +00:00
Matt Westcott
937c237345 Rejig formattedfield to populate context as we go 2023-12-12 14:58:28 +00:00
Matt Westcott
a12de4b2cd Add a formattedfieldfromcontext template tag for use on wagtailadmin/shared/field.html
This makes the semantics of undefined variables a bit neater.
2023-12-12 14:58:28 +00:00
Matt Westcott
580ab995ab Do all processing of the field object in the formattedfield tag so that the template doesn't use it 2023-12-12 14:58:27 +00:00
Matt Westcott
8f8d847b78 Move conditional logic for generating ids / labels / help text out of formattedfield template and into tag function 2023-12-12 14:58:27 +00:00
Matt Westcott
e97449dc5f Funnel all invocations of wagtailadmin/shared/field.html through the formattedfield tag
At this point wagtailadmin/shared/field.html is still used by FieldPanel, as well as third-party code. Replace this by a template that simply pulls the relevant context variables from the template and passes them on to `{% formattedfield %}` (which renders them using the old template, now renamed formatted_field.html). This will allow us to move logic from the template to the tag function without breaking the existing wagtailadmin/shared/field.html API.
2023-12-12 14:58:27 +00:00
Matt Westcott
b3bdc0be4a Convert remaining field.html includes to formattedfield tag 2023-12-12 13:54:33 +00:00
Matt Westcott
9b445567f7 Add remaining variables from field.html as parameters to formattedfield 2023-12-12 13:41:25 +00:00
Matt Westcott
ecc6b23d64 Convert templates that extend field.html to use rawformattedfield instead
This will allow us to refactor field.html in ways that don't require preserving the `{% block form_field %}`.
2023-12-12 13:41:25 +00:00
Matt Westcott
89eb53e1d0 Allow specifying the context variable used by BlockInclusionNode
This allows us to pass the content of `{% rawformattedfield %}` as `rendered_field`, making the separate case for `children` unnecessary.
2023-12-12 13:41:25 +00:00
Matt Westcott
d220dc6e8b Convert all basic uses of wagtailadmin/shared/field.html (with no parameters other than field) to formattedfield tag 2023-12-12 13:41:23 +00:00
Matt Westcott
ba29b1832a Introduce a 'formattedfield' tag for use with Django form objects 2023-12-12 13:38:18 +00:00
Matt Westcott
84f885ff17 Rename field/endfield template tag pair to rawformattedfield/endrawformattedfield
This distinguishes the use case of wrapping form fields that are defined manually in HTML, versus working with Django form field objects which will shortly be given a `formattedfield` tag. We could have called these `rawfield` and `field`, but this avoids weirdness like `{% field field=field %}` (or just `{% field %}` which can easily be confused with `{{ field }}`) and better clarifies the purpose of the tag (and in particular why you shouldn't use it for hidden fields).
2023-12-12 13:38:18 +00:00
Sage Abdullah
456515d500
Release note for #11295 2023-12-12 13:08:18 +00:00
Sage Abdullah
feda5cb4b5
Do not set locale in LocaleMixin if model is unset
Previously, the locale will be set even if the view doesn't set a model
attribute. This means that it will load the default locale or the locale
specified by the query param.

However, in practice, this mixin is typically used for views that work
with a translatable model.

Setting the locale when the view doesn't set a model will still cause a
query to get the locale. Since it's unlikely that the view actually
needs to work with a locale if it doesn't set a model, just drop the
support for it so we can eliminate that extra query.
2023-12-12 13:05:59 +00:00
Sage Abdullah
4082acca9b
Remove unnecessary custom code in snippets index view and template
The model_opts is already supplied by generic
IndexView.get_context_data(), and can_add_snippet is already covered by
the can_add context variable in the generic view. For the template, the
only differences are:

- the title tag no longer says 'Snippet <model name>' and instead only
  says '<model name>'
- the body class for the model has been removed
2023-12-12 13:05:59 +00:00
Sage Abdullah
14a245222e
Change default add_item_label in generic IndexView to 'Add (model name)'
Unfortunately can't use 'Add a (model name)' because we can't smartly
handle the case of 'a' vs 'an'
2023-12-12 13:05:59 +00:00
Sage Abdullah
10d052aad5
Add separate block for shared header's base_actions in generic index template
The base_actions was added in 252c4015a0
for the sole purpose of fixing the position of the locale switcher on
snippets index view.

With the upcoming Universal Listings work, all of the actions and
filters will likely be moved to the slim header (breadcrumbs), so this
will be eliminated anyway. However, doing this allows us to refactor the
snippets index view to reuse as much of the generic index view code and
template as possible (see next commit).
2023-12-12 13:05:59 +00:00
Thibaud Colas
b7d2618d93
Remove Safari 14 support in Wagtail admin – update browserslist and TypeScript (#11258)
Co-authored-by: Sage Abdullah <sage.abdullah@torchbox.com>
2023-12-12 10:54:41 +00:00
Tibor Leupold
10c1e12285 Replace template components with standalone laces library (#11292)
Fixes #11105
2023-12-11 14:35:36 +00:00
Matt Westcott
cce05fb1a3 Release note for #11289 2023-12-11 09:11:47 +00:00
Sage Abdullah
3dd32a2e52 Create separate block for bulk actions in generic listing template 2023-12-11 09:09:36 +00:00
Sage Abdullah
52f22ff34f Add tests for customising PagePermissionTester.can_view_revisions 2023-12-11 09:09:36 +00:00
Sage Abdullah
285e8c109a Add tests for ensuring history URL is shown correctly on page views
Not adding a test for a page with custom PagePermissionTester just yet,
as we're still planning to refine the permissions system.
2023-12-11 09:09:36 +00:00
Sage Abdullah
adc6fef1cf Reuse slim_header.html's actions block in page_edit_header.html
Reduce template overrides and make it more consistent with the page
listing header, including using
PagePermissionTester.can_view_revisions() when rendering the link.

When the history button is turned into a proper side panel, we can
refactor this further.
2023-12-11 09:09:36 +00:00
Sage Abdullah
cd12a8404f Consistently use PagePermissionTester.can_view_revisions() for history links in page listing 2023-12-11 09:09:36 +00:00
Sage Abdullah
47fe8754fa Reuse slim_header.html's actions block in page_listing_header.html
The is_root check for the side panels is moved to the view code. For the
"Live" link, the check is already covered by the
page_status_tag_new.html template that checks for page.live and
page.url.
2023-12-11 09:09:36 +00:00
Sage Abdullah
a81c957a15 Override specific blocks in page index template 2023-12-11 09:09:36 +00:00
Sage Abdullah
3d9325c4eb Move page listing title to be defined using get_page_title in the view
Reduces custom template code and aligns with other views that extend WagtailAdminTemplateMixin
2023-12-11 09:09:36 +00:00
Sage Abdullah
00db61d4ea Make page index template extend generic index template
This doesn't really change the rendered HTML as the content block is overridden
2023-12-11 09:09:36 +00:00
LB Johnston
0880078775 Add some recent third party tutorials (December 2023) 2023-12-08 08:01:09 +10:00
Sage Abdullah
71885be427
Fix incorrect heading for Django 5.0 support in release notes 2023-12-07 12:10:31 +00:00
zerolab
cba0c1d69f
Release notes for #11297 2023-12-07 11:34:10 +00:00
Sage Abdullah
868e155c74
Relax Django upper bound in install_requires to the next major version (6.0)
This allows the more "adventurous" to update their requirements so they
can install the next latest Django version (5.1 and 5.2) even if we
haven't officially supported it. As long as we're on top of Django's
updates, this should be OK for the duration of this Wagtail release's
active support period.

However, do not update the default project template's requirements yet,
since we don't want new projects to be installed with Django versions we
haven't officially supported.
2023-12-07 11:34:10 +00:00
zerolab
1be7fd5781
Formalise Django 5.0 support and drop Django < 4.2 support
Ref: https://docs.djangoproject.com/en/stable/releases/5.0/#third-party-library-support-for-older-version-of-django
2023-12-07 11:34:10 +00:00
Felipe Lobato
aa11418d23
Update docs to split out sh command in tutorial (#11311)
* Update create-footer_for_all_pages.md
* Update CONTRIBUTORS.md
2023-12-07 06:57:08 +10:00
Shlomo Markowitz
f9c7df49c8 Add support for modifying default page listing ordering 2023-12-07 06:50:38 +10:00
Sage Abdullah
477762b4da
Update latest.txt for 5.2.2 2023-12-06 17:27:59 +00:00
Sage Abdullah
59b76587df
Fill in release date for 5.2.2 2023-12-06 17:26:20 +00:00