Skip to content

Commit 9c271e6

Browse files
committed
Fix accessibility problems with the search pagination
The problem was that the next/prev links didn't have any text. For some reason, the pagination markup on this page was different than, say, that in crates.hbs. We really should fix rust-lang#8 for real someday 😂
1 parent e18b55f commit 9c271e6

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

app/templates/search.hbs

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -79,17 +79,24 @@
7979
{{/each}}
8080
</div>
8181

82-
<div class='pagination'>
83-
{{#link-to (query-params page=prevPage) class='prev'}}
82+
<nav class='pagination' aria-label="Pagination navigation">
83+
{{#link-to (query-params page=prevPage) class="prev" rel="prev" title="previous page" data-test-pagination-prev=true}}
8484
{{svg-jar "left-pag"}}
8585
{{/link-to}}
86-
{{#each pages as |page|}}
87-
{{#link-to (query-params page=page)}}{{ page }}{{/link-to}}
88-
{{/each}}
89-
{{#link-to (query-params page=nextPage) class='next'}}
86+
<ol>
87+
{{#each pages as |page|}}
88+
<li>
89+
{{#link-to (query-params page=page) title=(concat "Go to page " page)}}
90+
{{ page }}
91+
{{/link-to}}
92+
</li>
93+
{{/each}}
94+
</ol>
95+
{{#link-to (query-params page=nextPage) class="next" rel="next" title="next page" data-test-pagination-next=true}}
9096
{{svg-jar "right-pag"}}
9197
{{/link-to}}
92-
</div>
98+
</nav>
99+
93100
{{else}}
94101
<div id="no-results">
95102
<h2>0 crates found. <a href='https://doc.rust-lang.org/cargo/getting-started/'>Get started</a> and create your own.</h2>

0 commit comments

Comments
 (0)