kopia lustrzana https://github.com/wagtail/wagtail
Add scope attribute to TableBlock generated tables for visually impaired users (#5865)
rodzic
06fbde14b3
commit
5e2d12b518
|
@ -32,6 +32,7 @@ Changelog
|
|||
* Fix: Document tags no longer fail to update when replacing the document file at the same time (Matt Westcott)
|
||||
* Fix: Prevent error from very tall / wide images being resized to 0 pixels (Fidel Ramos)
|
||||
* Fix: Remove excess margin when editing snippets (Quadric)
|
||||
* Fix: Added `scope` attribute to table headers in TableBlock output (Quadric)
|
||||
|
||||
|
||||
2.8 (03.02.2020)
|
||||
|
|
|
@ -50,6 +50,7 @@ Bug fixes
|
|||
* Document tags no longer fail to update when replacing the document file at the same time (Matt Westcott)
|
||||
* Prevent error from very tall / wide images being resized to 0 pixels (Fidel Ramos)
|
||||
* Remove excess margin when editing snippets (Quadric)
|
||||
* Added ``scope`` attribute to table headers in TableBlock output (Quadric)
|
||||
|
||||
|
||||
Upgrade considerations
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
<tr>
|
||||
{% for column in table_header %}
|
||||
{% with forloop.counter0 as col_index %}
|
||||
<th {% cell_classname 0 col_index %}>
|
||||
<th scope="col" {% cell_classname 0 col_index %}>
|
||||
{% if column.strip %}
|
||||
{% if html_renderer %}
|
||||
{{ column.strip|safe|linebreaksbr }}
|
||||
|
@ -30,7 +30,7 @@
|
|||
{% for column in row %}
|
||||
{% with forloop.counter0 as col_index %}
|
||||
{% if first_col_is_header and forloop.first %}
|
||||
<th {% cell_classname row_index col_index table_header %}>
|
||||
<th scope="row" {% cell_classname row_index col_index table_header %}>
|
||||
{% if column.strip %}
|
||||
{% if html_renderer %}
|
||||
{{ column.strip|safe|linebreaksbr }}
|
||||
|
|
|
@ -63,7 +63,7 @@ class TestTableBlock(TestCase):
|
|||
expected = """
|
||||
<table role="table">
|
||||
<thead>
|
||||
<tr><th>Test 1</th><th class="htLeft">Test 2</th><th>Test 3</th></tr>
|
||||
<tr><th scope="col">Test 1</th><th scope="col" class="htLeft">Test 2</th><th scope="col">Test 3</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr><td></td><td class="htRight"></td><td></td></tr>
|
||||
|
@ -133,7 +133,7 @@ class TestTableBlock(TestCase):
|
|||
expected = """
|
||||
<table role="table">
|
||||
<thead>
|
||||
<tr><th>Foo</th><th>Bar</th><th>Baz</th></tr>
|
||||
<tr><th scope="col">Foo</th><th scope="col">Bar</th><th scope="col">Baz</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr><td></td><td></td><td></td></tr>
|
||||
|
@ -155,9 +155,9 @@ class TestTableBlock(TestCase):
|
|||
expected = """
|
||||
<table role="table">
|
||||
<tbody>
|
||||
<tr><th>Foo</th><td>Bar</td><td>Baz</td></tr>
|
||||
<tr><th>one</th><td>two</td><td>three</td></tr>
|
||||
<tr><th>four</th><td>five</td><td>six</td></tr>
|
||||
<tr><th scope="row">Foo</th><td>Bar</td><td>Baz</td></tr>
|
||||
<tr><th scope="row">one</th><td>two</td><td>three</td></tr>
|
||||
<tr><th scope="row">four</th><td>five</td><td>six</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
"""
|
||||
|
@ -175,11 +175,11 @@ class TestTableBlock(TestCase):
|
|||
expected = """
|
||||
<table role="table">
|
||||
<thead>
|
||||
<tr><th>Foo</th><th>Bar</th><th>Baz</th></tr>
|
||||
<tr><th scope="col">Foo</th><th scope="col">Bar</th><th scope="col">Baz</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr><th>one</th><td>two</td><td>three</td></tr>
|
||||
<tr><th>four</th><td>five</td><td>six</td></tr>
|
||||
<tr><th scope="row">one</th><td>two</td><td>three</td></tr>
|
||||
<tr><th scope="row">four</th><td>five</td><td>six</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
"""
|
||||
|
|
Ładowanie…
Reference in New Issue