Skip to content

Commit

Permalink
Adds download count to the release section #141
Browse files Browse the repository at this point in the history
  • Loading branch information
redet-G committed Oct 22, 2022
1 parent 490a768 commit a919ed9
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions Website/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,11 +181,16 @@ function renderReleases(releases) {
}

function renderRelease(all, release) {
console.log(release);
release.totalCount = release.assets.reduce(
(total, rel) => total + rel.download_count,
0
);
let assets = renderAssets(release.assets.reverse());
return `${all} <div class="release">
<div style="text-align:center"><b>${release.name}</b></div>
<div style="text-align:center">${new Date(release.published_at)}</div>
<div style="text-align:center">${new Date(release.published_at)} with <b>${
release.totalCount
} </b> Downloads</div>
<div onclick="toggleMore(this,'${
release.id
}')" style="text-align:center;cursor:pointer;font-weight:bolder;opacity: 0.4;">Learn More</div>
Expand Down

0 comments on commit a919ed9

Please sign in to comment.