Use GroupIdenticon for missing avatars

This commit is contained in:
kushalpandya 2017-07-31 16:04:25 +05:30
parent b535be35ae
commit 8456899743
2 changed files with 15 additions and 0 deletions

View File

@ -92,6 +92,13 @@ export default {
hasGroups() {
return Object.keys(this.group.subGroups).length > 0;
},
hasAvatar() {
if (this.group.avatarUrl) {
return this.group.avatarUrl.indexOf('/assets/no_group_avatar') === -1;
} else {
return false;
}
},
},
};
</script>
@ -194,9 +201,15 @@ export default {
<a
:href="group.groupPath">
<img
v-if="hasAvatar"
class="avatar s40"
:src="group.avatarUrl"
/>
<group-identicon
v-else
:id=group.id
:name="group.name"
/>
</a>
</div>
<div

View File

@ -5,6 +5,7 @@ import GroupFilterableList from './groups_filterable_list';
import GroupsComponent from './components/groups.vue';
import GroupFolder from './components/group_folder.vue';
import GroupItem from './components/group_item.vue';
import GroupIdenticon from './components/group_identicon.vue';
import GroupsStore from './stores/groups_store';
import GroupsService from './services/groups_service';
import eventHub from './event_hub';
@ -21,6 +22,7 @@ document.addEventListener('DOMContentLoaded', () => {
Vue.component('groups-component', GroupsComponent);
Vue.component('group-folder', GroupFolder);
Vue.component('group-item', GroupItem);
Vue.component('group-identicon', GroupIdenticon);
// eslint-disable-next-line no-new
new Vue({