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 committed Mar 2, 2023
1 parent 2564d7f commit 1748296
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 1748296

Please sign in to comment.