mirror of
https://github.com/ivabus/www
synced 2024-11-22 08:55:05 +03:00
#294 index maintainer data
This commit is contained in:
parent
d3e1a4066d
commit
8504d6595f
2 changed files with 6 additions and 4 deletions
|
@ -121,11 +121,13 @@
|
||||||
if (searchInput.value) {
|
if (searchInput.value) {
|
||||||
const term = searchInput.value;
|
const term = searchInput.value;
|
||||||
const packages = getPackageThumbs();
|
const packages = getPackageThumbs();
|
||||||
|
for(let pkg of packages) {
|
||||||
|
pkg.match_score = getMatchScore(term, pkg.dataset);
|
||||||
|
}
|
||||||
const sortedPackages = packages.sort((a, b) => {
|
const sortedPackages = packages.sort((a, b) => {
|
||||||
const aScore = getMatchScore(term, a.dataset);
|
return b.match_score - (a ? a.match_score : 0);
|
||||||
const bScore = getMatchScore(term, b.dataset);
|
|
||||||
return bScore - aScore;
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const grid = document.getElementById('packageGrid');
|
const grid = document.getElementById('packageGrid');
|
||||||
grid.textContent = '';
|
grid.textContent = '';
|
||||||
let searchCount = 0;
|
let searchCount = 0;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<div class="card card-thumbnail" style="width: 100%" data-name="{{- .name -}}" data-popularity="{{- .dl_count -}}" data-last_modified="{{- .last_modified -}}" data-description="{{- .desc -}}">
|
<div class="card card-thumbnail" style="width: 100%" data-name="{{- .name -}}" data-popularity="{{- .dl_count -}}" data-last_modified="{{- .last_modified -}}" data-description="{{- .desc -}}" data-maintainer="{{- .maintainer -}}">
|
||||||
<a href="/+{{- lower .full_name -}}/">
|
<a href="/+{{- lower .full_name -}}/">
|
||||||
<div class="p-3">
|
<div class="p-3">
|
||||||
<figure class="card-img-top" >
|
<figure class="card-img-top" >
|
||||||
|
|
Loading…
Reference in a new issue