Skip to content

Commit

Permalink
fix: add aria-label to the '+ N more badges' links
Browse files Browse the repository at this point in the history
  • Loading branch information
JakubKopys committed Mar 2, 2022
1 parent 74cdcfc commit e478a82
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
4 changes: 3 additions & 1 deletion templates/article_page.hbs
Expand Up @@ -250,7 +250,9 @@

{{#if (compare (calc author.badges.length "-" 4) ">" 0)}}
<div class="community-badge community-badge-achievements">
{{#link "user_profile" id=author.id filter_by="badges" class="community-badge-achievements-rest"}}{{t 'plus_more' count=(calc author.badges.length "-" 4)}}{{/link}}
<a href="{{page_path "user_profile" id=author.id filter_by="badges"}}" class="community-badge-achievements-rest" aria-label="{{t 'more_awards_to' count=(calc author.badges.length "-" 4) name=author.name}}">
{{t 'plus_more' count=(calc author.badges.length "-" 4)}}
</a>
</div>
{{/if}}
</div>
Expand Down
8 changes: 6 additions & 2 deletions templates/community_post_page.hbs
Expand Up @@ -99,7 +99,9 @@

{{#if (compare (calc post.author.badges.length "-" 4) ">" 0)}}
<div class="community-badge community-badge-achievements">
{{#link "user_profile" id=post.author.id filter_by="badges" class="community-badge-achievements-rest"}}{{t 'plus_more' count=(calc post.author.badges.length "-" 4)}}{{/link}}
<a href="{{page_path "user_profile" id=post.author.id filter_by="badges"}}" class="community-badge-achievements-rest" aria-label="{{t 'more_awards_to' count=(calc post.author.badges.length "-" 4) name=post.author.name}}">
{{t 'plus_more' count=(calc post.author.badges.length "-" 4)}}
</a>
</div>
{{/if}}

Expand Down Expand Up @@ -250,7 +252,9 @@

{{#if (compare (calc author.badges.length "-" 4) ">" 0)}}
<div class="community-badge community-badge-achievements">
{{#link "user_profile" id=author.id filter_by="badges" class="community-badge-achievements-rest"}}{{t 'plus_more' count=(calc author.badges.length "-" 4)}}{{/link}}
<a href="{{page_path "user_profile" id=author.id filter_by="badges"}}" class="community-badge-achievements-rest" aria-label="{{t 'more_awards_to' count=(calc author.badges.length "-" 4) name=author.name}}">
{{t 'plus_more' count=(calc author.badges.length "-" 4)}}
</a>
</div>
{{/if}}
</div>
Expand Down
4 changes: 3 additions & 1 deletion templates/user_profile_page.hbs
Expand Up @@ -46,7 +46,9 @@

{{#if (compare (calc user.badges.length "-" 4) ">" 0)}}
<div class="community-badge community-badge-achievements">
{{#link "user_profile" id=user.id filter_by="badges" class="community-badge-achievements-rest"}}{{t 'plus_more' count=(calc user.badges.length "-" 4)}}{{/link}}
<a href="{{page_path "user_profile" id=user.id filter_by="badges"}}" class="community-badge-achievements-rest" aria-label="{{t 'more_awards_to' count=(calc user.badges.length "-" 4) name=user.name}}">
{{t 'plus_more' count=(calc user.badges.length "-" 4)}}
</a>
</div>
{{/if}}
</div>
Expand Down

0 comments on commit e478a82

Please sign in to comment.