Display avatars in entity search autocomplete

Fixes https://github.com/coreos/bugs/issues/1819
This commit is contained in:
Joseph Schorr 2017-02-21 16:29:01 -05:00
parent 2ef55a5842
commit fcff867bfd
4 changed files with 57 additions and 36 deletions

View file

@ -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;
}
};