47 lines
1.8 KiB
Text
47 lines
1.8 KiB
Text
<% layout('layout') %>
|
|
<%
|
|
let description = it.repo.description?.replace(/https?:\/\/([\S]+)/g, '$1')
|
|
function prettyNumber(number) {
|
|
if (number < 10) return number
|
|
if (number < 1000) return Math.floor(number/10) * 10 + '+'
|
|
return Math.floor(number / 1000)+'k'
|
|
}
|
|
%>
|
|
<div class="main repo">
|
|
<div class="contents">
|
|
<div class="info">
|
|
<p class="author"><span><%= it.repo.owner.full_name || it.repo.owner.login %></span><span class="username">@<%= it.repo.owner.login %></span></p>
|
|
<p class="title"><%= it.repo.name %></p>
|
|
<% if (description) { %>
|
|
<p class="description"><%= description %></p>
|
|
<% } %>
|
|
</div>
|
|
<div class="graphics">
|
|
<img width="120" height="120" src="<%= it.repo.avatar_url || it.repo.owner.avatar_url %>"></img>
|
|
</div>
|
|
</div>
|
|
<div class="info-line">
|
|
<% 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>
|
|
</div>
|
|
<div class="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="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 class="fact">
|
|
<p class="fact-subtitle">Last updated</p>
|
|
<p class="fact-heading"><%= new Intl.DateTimeFormat('en-US', { dateStyle: 'long' }).format(new Date(it.repo.updated_at)) %></p>
|
|
</div>
|
|
</div>
|
|
</div> |