Bring over the repo results formatter
This commit is contained in:
parent
a3fa516761
commit
98fb41b442
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user