From e4a693f50a8342ed1a54b74e1a202b44c8e62981 Mon Sep 17 00:00:00 2001 From: Marijke Luttekes Date: Mon, 20 May 2024 14:39:09 -0300 Subject: Fixed #35189 -- Improved admin collapsible fieldsets by using
elements. This work improves the accessibility of the add and change pages in the admin site by adding
and elements to the collapsible fieldsets. This has the nice side effect of no longer requiring custom JavaScript helpers to implement the fieldsets' show/hide capabilities. Thanks to James Scholes for the accessibility advice, and to Sarah Boyce and Tom Carrick for reviews. Co-authored-by: Natalia <124304+nessita@users.noreply.github.com> Co-authored-by: Sarah Boyce <42296566+sarahboyce@users.noreply.github.com> --- docs/ref/contrib/admin/index.txt | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'docs/ref') diff --git a/docs/ref/contrib/admin/index.txt b/docs/ref/contrib/admin/index.txt index 2a5652c24b..b7e94c7387 100644 --- a/docs/ref/contrib/admin/index.txt +++ b/docs/ref/contrib/admin/index.txt @@ -424,9 +424,16 @@ subclass:: "classes": ["wide", "collapse"], } - Fieldsets with the ``collapse`` style will be initially collapsed in - the admin and replaced with a small "click to expand" link. Fieldsets - with the ``wide`` style will be given extra horizontal space. + Fieldsets with the ``wide`` style will be given extra horizontal + space in the admin interface. + Fieldsets with a name and the ``collapse`` style will be initially + collapsed, using an expandable widget with a toggle for switching + their visibility. + + .. versionchanged:: 5.1 + + ``fieldsets`` using the ``collapse`` class now use ``
`` + and ```` elements, provided they define a ``name``. * ``description`` A string of optional extra text to be displayed at the top of each @@ -2308,8 +2315,12 @@ The ``InlineModelAdmin`` class adds or customizes: A list or tuple containing extra CSS classes to apply to the fieldset that is rendered for the inlines. Defaults to ``None``. As with classes configured in :attr:`~ModelAdmin.fieldsets`, inlines with a ``collapse`` - class will be initially collapsed and their header will have a small "show" - link. + class will be initially collapsed using an expandable widget. + + .. versionchanged:: 5.1 + + ``fieldsets`` using the ``collapse`` class now use ``
`` and + ```` elements, provided they define a ``name``. .. attribute:: InlineModelAdmin.extra -- cgit v1.3