Skip to content

Commit

Permalink
Merge pull request #36740 from nextcloud/enh/a11y-contact-img-alt
Browse files Browse the repository at this point in the history
Add avatar contact img description
  • Loading branch information
Pytal authored Mar 3, 2023
2 parents c5da4b8 + 9d904b1 commit 6c79621
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 8 deletions.
5 changes: 5 additions & 0 deletions core/src/OC/contactsmenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ const Contact = Model.extend({
} else {
this.set('hasManyActions', true)
}

const fullName = this.get('fullName')
if (this.get('avatar') && fullName) {
this.set('avatarLabel', t('core', 'Avatar of {fullName}', { fullName }))
}
}
})

Expand Down
4 changes: 2 additions & 2 deletions core/src/OC/contactsmenu/contact.handlebars
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
{{#if contact.profileUrl}}
{{#if contact.profileTitle}}
<a class="profile-link--avatar" href="{{contact.profileUrl}}">
<img src="{{contact.avatar}}&size=32" class="avatar" srcset="{{contact.avatar}}&size=32 1x, {{contact.avatar}}&size=64 2x, {{contact.avatar}}&size=128 4x" alt="">
<img src="{{contact.avatar}}&size=32" class="avatar" srcset="{{contact.avatar}}&size=32 1x, {{contact.avatar}}&size=64 2x, {{contact.avatar}}&size=128 4x" alt="{{contact.avatarLabel}}">
</a>
{{/if}}
{{else}}
<img src="{{contact.avatar}}&size=32" class="avatar" srcset="{{contact.avatar}}&size=32 1x, {{contact.avatar}}&size=64 2x, {{contact.avatar}}&size=128 4x" alt="">
<img src="{{contact.avatar}}&size=32" class="avatar" srcset="{{contact.avatar}}&size=32 1x, {{contact.avatar}}&size=64 2x, {{contact.avatar}}&size=128 4x" alt="{{contact.avatarLabel}}">
{{/if}}
{{else}}
{{#if contact.profileUrl}}
Expand Down
4 changes: 2 additions & 2 deletions dist/core-login.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/core-login.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/core-main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/core-main.js.map

Large diffs are not rendered by default.

0 comments on commit 6c79621

Please sign in to comment.