1
0
mirror of synced 2024-11-26 06:46:04 +03:00

Bring over the repo results formatter

This commit is contained in:
Kevin Brown 2014-11-01 22:05:21 -04:00
parent a3fa516761
commit 98fb41b442

View File

@ -464,7 +464,22 @@ $.fn.select2.amd.require(["select2/core", "select2/utils"], function (Select2, U
cache: true cache: true
}, },
templateResult: function (repo) { templateResult: function (repo) {
return repo.full_name; var markup = '<div class="row">' +
'<div class="col-sm-1"><img src="' + repo.owner.avatar_url + '" style="max-width: 100%" /></div>' +
'<div class="col-sm-11">' +
'<div class="row">' +
'<div class="col-sm-6">' + repo.full_name + '</div>' +
'<div class="col-sm-3"><i class="fa fa-code-fork"></i> ' + repo.forks_count + '</div>' +
'<div class="col-sm-3"><i class="fa fa-star"></i> ' + repo.stargazers_count + '</div>' +
'</div>';
if (repo.description) {
markup += '<div>' + repo.description + '</div>';
}
markup += '</div></div>';
return markup;
}, },
templateSelection: function (repo) { templateSelection: function (repo) {
return repo.full_name; return repo.full_name;