Skip to content

Commit

Permalink
Add avatar contact img description
Browse files Browse the repository at this point in the history
Signed-off-by: Christopher Ng <chrng8@gmail.com>
  • Loading branch information
Pytal authored and backportbot-nextcloud[bot] committed Mar 3, 2023
1 parent 7a823fb commit 4f3bfb3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 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

0 comments on commit 4f3bfb3

Please sign in to comment.