show total commits on repo page
This commit is contained in:
parent
6e3e5b9876
commit
a11787b18d
1 changed files with 7 additions and 2 deletions
|
@ -2,7 +2,8 @@
|
|||
<%
|
||||
let description = it.repo.description?.replace(/https?:\/\/([\S]+)/g, '$1')
|
||||
function prettyNumber(number) {
|
||||
if (number < 1000) return number
|
||||
if (number < 10) return number
|
||||
if (number < 1000) return Math.floor(number/10) * 10 + '+'
|
||||
return Math.floor(number / 1000)+'k'
|
||||
}
|
||||
%>
|
||||
|
@ -20,7 +21,11 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="info-line">
|
||||
<% if (it.repo.open_issues_count > 0 || it.repo.stars_count > 0 || it.repo.forks_count > 0) { %>
|
||||
<% if (!it.repo.empty) { %>
|
||||
<div class="fact">
|
||||
<p class="fact-heading"><%= prettyNumber(it.repo.commits_count) %></p>
|
||||
<p class="fact-subtitle"><%= (it.repo.commits_count) != 1 ? 'Commits' : 'Commit' %></p>
|
||||
</div>
|
||||
<div class="fact">
|
||||
<p class="fact-heading"><%= prettyNumber(it.repo.open_issues_count) %></p>
|
||||
<p class="fact-subtitle"><%= (it.repo.open_issues_count) != 1 ? 'Issues' : 'Issue' %></p>
|
||||
|
|
Loading…
Reference in a new issue