diff options
author | Deiwin Sarjas <deiwin.sarjas@gmail.com> | 2014-12-02 16:55:52 +0200 |
---|---|---|
committer | Deiwin Sarjas <deiwin.sarjas@gmail.com> | 2014-12-02 16:55:52 +0200 |
commit | 54ef1cee1d25ce823531cd3e3571a6b3b847d1ea (patch) | |
tree | e9a132832c40445551abf822ef2ef55f3f5dbcca /public/ng | |
parent | 48bb0fadc2ddc362fe2da272767aba614f691645 (diff) | |
download | gitea-54ef1cee1d25ce823531cd3e3571a6b3b847d1ea.tar.gz gitea-54ef1cee1d25ce823531cd3e3571a6b3b847d1ea.zip |
add full name to found users' list
Diffstat (limited to 'public/ng')
-rw-r--r-- | public/ng/js/gogs.js | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/public/ng/js/gogs.js b/public/ng/js/gogs.js index 3578cd7cb9..1d5a113eeb 100644 --- a/public/ng/js/gogs.js +++ b/public/ng/js/gogs.js @@ -203,6 +203,9 @@ var Gogs = {}; // Search users by keyword. Gogs.searchUsers = function (val, $target) { + var notEmpty = function (str) { + return str && str.length > 0; + } $.ajax({ url: Gogs.AppSubUrl + '/api/v1/users/search?q=' + val, dataType: "json", @@ -210,7 +213,11 @@ var Gogs = {}; if (json.ok && json.data.length) { var html = ''; $.each(json.data, function (i, item) { - html += '<li><a><img src="' + item.avatar_url + '">' + item.username + '</a></li>'; + html += '<li><a><img src="' + item.avatar_url + '">' + item.username; + if (notEmpty(item.full_name)) { + html += ' (' + item.full_name + ')'; + } + html += '</a></li>'; }); $target.html(html); $target.toggleShow(); |