diff --git a/static/css/directives/ui/entity-search.css b/static/css/directives/ui/entity-search.css index dcc5d6ab6..22b46a3e3 100644 --- a/static/css/directives/ui/entity-search.css +++ b/static/css/directives/ui/entity-search.css @@ -55,4 +55,53 @@ .entity-search-element .menuitem .avatar { margin-right: 4px; +} + +.entity-mini-listing { + margin: 2px; + white-space: nowrap !important; + position: relative; +} + +.entity-mini-listing i { + margin-right: 8px; + position: relative; +} + +.entity-mini-listing i.fa { + width: 20px; + text-align: center; + font-size: 16px; + line-height: 16px; + color: #444; +} + +.entity-mini-listing i.fa-exclamation-triangle { + position: absolute; + right: -14px; + top: 4px; + color: #c09853; +} + +.entity-mini-listing i.fa.ci-robot { + position: relative; + top: -2px; +} + +.entity-mini-listing i.fa .avatar-image { + position: absolute; + top: -2px; + left: 0px; +} + +.entity-mini-listing .warning { + margin-top: 6px; + font-size: 10px; + padding: 4px; +} + +.entity-mini-listing span.title { + color: #aaa; + font-size: 12px; + display: block; } \ No newline at end of file diff --git a/static/css/quay.css b/static/css/quay.css index e02a5beca..257d897bb 100644 --- a/static/css/quay.css +++ b/static/css/quay.css @@ -1135,35 +1135,6 @@ form input.ng-valid.ng-dirty, text-overflow: ellipsis; } -.entity-mini-listing { - margin: 2px; - white-space: nowrap !important; - position: relative; -} - -.entity-mini-listing i { - margin-right: 8px; -} - -.entity-mini-listing i.fa-exclamation-triangle { - position: absolute; - right: -14px; - top: 4px; - color: #c09853; -} - -.entity-mini-listing .warning { - margin-top: 6px; - font-size: 10px; - padding: 4px; -} - -.entity-mini-listing span.title { - color: #aaa; - font-size: 12px; - display: block; -} - .editable { position: relative; } diff --git a/static/js/directives/ui/entity-search.js b/static/js/directives/ui/entity-search.js index ae80c19ed..178062a3b 100644 --- a/static/js/directives/ui/entity-search.js +++ b/static/js/directives/ui/entity-search.js @@ -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 = '
'; - if (datum.entity.kind == 'user' && !datum.entity.is_robot) { - template += ''; + if ((datum.entity.kind == 'user' && !datum.entity.is_robot) || (datum.entity.kind == 'org')) { + template += ''; } else if (datum.entity.kind == 'external') { template += ''; } else if (datum.entity.kind == 'user' && datum.entity.is_robot) { template += ''; } else if (datum.entity.kind == 'team') { template += ''; - } else if (datum.entity.kind == 'org') { - template += '' + AvatarService.getAvatar(datum.entity.avatar, 16) + ''; } template += '' + datum.value + ''; diff --git a/static/js/services/avatar-service.js b/static/js/services/avatar-service.js index bfbccb8b7..0b1503bfe 100644 --- a/static/js/services/avatar-service.js +++ b/static/js/services/avatar-service.js @@ -6,7 +6,7 @@ angular.module('quay').factory('AvatarService', ['Config', '$sanitize', 'md5', var avatarService = {}; var cache = {}; - avatarService.getAvatar = function(hash, opt_size) { + avatarService.getAvatar = function(hash, opt_size, opt_notfound) { var size = opt_size || 16; switch (Config['AVATAR_KIND']) { case 'local': @@ -14,7 +14,8 @@ angular.module('quay').factory('AvatarService', ['Config', '$sanitize', 'md5', break; case 'gravatar': - return '//www.gravatar.com/avatar/' + hash + '?d=404&size=' + size; + var notfound = opt_notfound || '404'; + return '//www.gravatar.com/avatar/' + hash + '?d=' + notfound + '&size=' + size; break; } };