From d8c17aa10c7f41e692fb6f5d0bf2fab7a90b9374 Mon Sep 17 00:00:00 2001 From: David Smith Date: Fri, 14 May 2021 08:46:22 +0100 Subject: [PATCH] Refs #32338 -- Improved accessibility of RadioSelect examples in docs. Co-authored-by: Thibaud Colas --- docs/intro/tutorial04.txt | 16 +++---- docs/ref/forms/widgets.txt | 85 +++++++++++++++++++++----------------- 2 files changed, 55 insertions(+), 46 deletions(-) diff --git a/docs/intro/tutorial04.txt b/docs/intro/tutorial04.txt index 414156b56c5..4dae8892ae9 100644 --- a/docs/intro/tutorial04.txt +++ b/docs/intro/tutorial04.txt @@ -20,16 +20,16 @@ tutorial, so that the template contains an HTML ``
`` element: .. code-block:: html+django :caption: polls/templates/polls/detail.html -

{{ question.question_text }}

- - {% if error_message %}

{{ error_message }}

{% endif %} - {% csrf_token %} - {% for choice in question.choice_set.all %} - -
- {% endfor %} +
+

{{ question.question_text }}

+ {% if error_message %}

{{ error_message }}

{% endif %} + {% for choice in question.choice_set.all %} + +
+ {% endfor %} +
diff --git a/docs/ref/forms/widgets.txt b/docs/ref/forms/widgets.txt index 3a930d298c5..802ba0055e1 100644 --- a/docs/ref/forms/widgets.txt +++ b/docs/ref/forms/widgets.txt @@ -718,28 +718,34 @@ that specifies the template used to render each choice. For example, for the .. code-block:: html+django - {% for radio in myform.beatles %} -
- {{ radio }} -
- {% endfor %} +
+ {{ myform.beatles.label }} + {% for radio in myform.beatles %} +
+ {{ radio }} +
+ {% endfor %} +
This would generate the following HTML: .. code-block:: html -
- -
-
- -
-
- -
-
- -
+
+ Radio buttons +
+ +
+
+ +
+
+ +
+
+ +
+
That included the ``