Display avatars in entity search autocomplete
Fixes https://github.com/coreos/bugs/issues/1819
This commit is contained in:
parent
2ef55a5842
commit
fcff867bfd
4 changed files with 57 additions and 36 deletions
|
@ -43,7 +43,7 @@ angular.module('quay').directive('entitySearch', function () {
|
|||
// True if the menu should pull right.
|
||||
'pullRight': '@pullRight'
|
||||
},
|
||||
controller: function($rootScope, $scope, $element, Restangular, UserService, ApiService, UtilService, Config) {
|
||||
controller: function($rootScope, $scope, $element, Restangular, UserService, ApiService, UtilService, AvatarService, Config) {
|
||||
$scope.lazyLoading = true;
|
||||
|
||||
$scope.teams = null;
|
||||
|
@ -286,16 +286,16 @@ angular.module('quay').directive('entitySearch', function () {
|
|||
},
|
||||
'suggestion': function (datum) {
|
||||
template = '<div class="entity-mini-listing">';
|
||||
if (datum.entity.kind == 'user' && !datum.entity.is_robot) {
|
||||
template += '<i class="fa fa-user fa-lg"></i>';
|
||||
if ((datum.entity.kind == 'user' && !datum.entity.is_robot) || (datum.entity.kind == 'org')) {
|
||||
template += '<i class="fa fa-user fa-lg"><img class="avatar-image" src="' +
|
||||
AvatarService.getAvatar(datum.entity.avatar.hash, 20, 'blank') +
|
||||
'"></i>';
|
||||
} else if (datum.entity.kind == 'external') {
|
||||
template += '<i class="fa fa-user fa-lg"></i>';
|
||||
} else if (datum.entity.kind == 'user' && datum.entity.is_robot) {
|
||||
template += '<i class="fa ci-robot fa-lg"></i>';
|
||||
} else if (datum.entity.kind == 'team') {
|
||||
template += '<i class="fa fa-group fa-lg"></i>';
|
||||
} else if (datum.entity.kind == 'org') {
|
||||
template += '<i class="fa">' + AvatarService.getAvatar(datum.entity.avatar, 16) + '</i>';
|
||||
}
|
||||
|
||||
template += '<span class="name">' + datum.value + '</span>';
|
||||
|
|
Reference in a new issue