add info-line to repo template
This commit is contained in:
parent
61e9ab6f06
commit
ffe5e13a80
2 changed files with 38 additions and 0 deletions
|
@ -129,3 +129,19 @@ p {
|
|||
margin: 0;
|
||||
border-radius: 100%;
|
||||
}
|
||||
|
||||
.repo .info-line {
|
||||
gap: 1em;
|
||||
}
|
||||
|
||||
.repo-fact {
|
||||
display: flex;
|
||||
font-size: 1.5rem;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.repo-fact .fact-heading {
|
||||
color: #8c91af;
|
||||
font-size: 2rem;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,10 @@
|
|||
<% layout('layout') %>
|
||||
<%
|
||||
function prettyNumber(number) {
|
||||
if (number < 1000) return number
|
||||
return Math.floor(number / 1000)+'k'
|
||||
}
|
||||
%>
|
||||
<div class="main repo">
|
||||
<div class="contents">
|
||||
<div class="info">
|
||||
|
@ -12,4 +18,20 @@
|
|||
<img width="120" height="120" src="<%= it.repo.avatar_url || it.repo.owner.avatar_url %>"></img>
|
||||
</div>
|
||||
</div>
|
||||
<% if (it.repo.open_issues_count > 0 || it.repo.stars_count > 0 || it.repo.forks_count > 0) { %>
|
||||
<div class="info-line">
|
||||
<div class="repo-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>
|
||||
</div>
|
||||
<div class="repo-fact">
|
||||
<p class="fact-heading"><%= prettyNumber(it.repo.stars_count) %></p>
|
||||
<p class="fact-subtitle"><%= (it.repo.stars_count) != 1 ? 'Stars' : 'Star' %></p>
|
||||
</div>
|
||||
<div class="repo-fact">
|
||||
<p class="fact-heading"><%= prettyNumber(it.repo.forks_count) %></p>
|
||||
<p class="fact-subtitle"><%= (it.repo.forks_count) != 1 ? 'Forks' : 'Fork' %></p>
|
||||
</div>
|
||||
</div>
|
||||
<% } %>
|
||||
</div>
|
Loading…
Reference in a new issue