File tree 3 files changed +11
-8
lines changed 3 files changed +11
-8
lines changed Original file line number Diff line number Diff line change 34
34
{% endfor %}
35
35
</ tbody >
36
36
</ table >
37
- < p class ="paginator ">
37
+ < nav class ="paginator " aria-labelledby ="pagination ">
38
+ < h2 id ="pagination " class ="visually-hidden "> {% blocktranslate with name=opts.verbose_name %}Pagination {{ name }} entries{% endblocktranslate %}</ h2 >
38
39
{% if pagination_required %}
39
40
{% for i in page_range %}
40
41
{% if i == action_list.paginator.ELLIPSIS %}
41
42
{{ action_list.paginator.ELLIPSIS }}
42
43
{% elif i == action_list.number %}
43
- < span class ="this-page "> {{ i }}</ span >
44
+ < span class ="this-page " aria-current =" page " > {{ i }}</ span >
44
45
{% else %}
45
- < a role ="button " href ="?{{ page_var }}={{ i }} " {% if i == action_list.paginator.num_pages %} class ="end " {% endif %} > {{ i }}</ a >
46
+ < a role ="button " href ="?{{ page_var }}={{ i }} " aria-label =" page {{ i }} " {% if i == action_list.paginator.num_pages %} class ="end " {% endif %} > {{ i }}</ a >
46
47
{% endif %}
47
48
{% endfor %}
48
49
{% endif %}
49
50
{{ action_list.paginator.count }} {% blocktranslate count counter=action_list.paginator.count %}entry{% plural %}entries{% endblocktranslate %}
50
- </ p >
51
+ </ nav >
51
52
{% else %}
52
53
< p > {% translate 'This object doesn’t have a change history. It probably wasn’t added via this admin site.' %}</ p >
53
54
{% endif %}
Original file line number Diff line number Diff line change 1
1
{% load admin_list %}
2
2
{% load i18n %}
3
- < p class ="paginator ">
3
+ < nav class ="paginator " aria-labelledby ="pagination ">
4
+ < h2 id ="pagination " class ="visually-hidden "> {% blocktranslate with name=cl.opts.verbose_name_plural %}Pagination {{ name }}{% endblocktranslate %}</ h2 >
4
5
{% if pagination_required %}
5
6
{% for i in page_range %}
6
7
{% paginator_number cl i %}
9
10
{{ cl.result_count }} {% if cl.result_count == 1 %}{{ cl.opts.verbose_name }}{% else %}{{ cl.opts.verbose_name_plural }}{% endif %}
10
11
{% if show_all_url %}< a href ="{{ show_all_url }} " class ="showall "> {% translate 'Show all' %}</ a > {% endif %}
11
12
{% if cl.formset and cl.result_count %}< input type ="submit " name ="_save " class ="default " value ="{% translate 'Save' %} "> {% endif %}
12
- </ p >
13
+ </ nav >
Original file line number Diff line number Diff line change @@ -42,11 +42,12 @@ def paginator_number(cl, i):
42
42
if i == cl .paginator .ELLIPSIS :
43
43
return format_html ("{} " , cl .paginator .ELLIPSIS )
44
44
elif i == cl .page_num :
45
- return format_html ('<span class="this-page">{}</span> ' , i )
45
+ return format_html ('<span class="this-page" aria-current="page" >{}</span> ' , i )
46
46
else :
47
47
return format_html (
48
- '<a role="button" href="{}"{}>{}</a> ' ,
48
+ '<a role="button" href="{}" aria-label="page {}" {}>{}</a> ' ,
49
49
cl .get_query_string ({PAGE_VAR : i }),
50
+ i ,
50
51
mark_safe (' class="end"' if i == cl .paginator .num_pages else "" ),
51
52
i ,
52
53
)
You can’t perform that action at this time.
0 commit comments