show commit stats on PRs

This commit is contained in:
hazycora 2023-08-03 06:54:05 -05:00
parent 9f9ea12a0b
commit 6e3e5b9876
No known key found for this signature in database
GPG key ID: 215AF1F81F86940E
3 changed files with 17 additions and 8 deletions

View file

@ -22,13 +22,7 @@
<img width="120" height="120" src="<%= it.commit.committer.avatar_url %>?size=120"></img>
</div>
</div>
<div class="commit-stats info-line">
<p><%= it.commit.stats.total %> lines changed</p>
<p style="display: flex; gap: 0.25em; font-weight: 600;">
<span style="color: #53d37c;">+<%= it.commit.stats.additions %></span>
<span style="color: #d35353;">-<%= it.commit.stats.deletions %></span>
</p>
</div>
<%~ include('partials/commit-stats.eta', {stats: it.commit.stats}) %>
<div class="info-line">
<img class="avatar" width="48" height="48" src="<%= it.commit.committer.avatar_url %>?size=48"></img>
<p class="author"><%= it.commit.committer.full_name || it.commit.committer.login %></p>

View file

@ -22,13 +22,20 @@
<img width="120" height="120" src="<%= it.issue.user.avatar_url %>?size=120"></img>
</div>
</div>
<% if (it.prStats) { %>
<%~ include('partials/commit-stats.eta', {stats: it.prStats}) %>
<% } %>
<div class="info-line">
<img class="avatar" width="48" height="48" src="<%= it.issue.user.avatar_url %>?size=48"></img>
<p class="author"><%= it.issue.user.full_name || it.issue.user.login %></p>
<p>opened <%= new Intl.DateTimeFormat('en-US', { dateStyle: 'long' }).format(new Date(it.issue.created_at)) %></p>
<% if (it.issue.commits_count) { %>
<%~ include('icons/code-commit.eta') %>
<p><%= it.issue.commits_count != 1 ? `${it.issue.commits_count} commits` : `${it.issue.commits_count} commit` %></p>
<% } %>
<% if (it.issue.state != 'open') { %>
<p>·</p>
<p><%= it.issue.pull_request?.merged ? 'merged' : it.issue.state %></p>
<p><%= it.issue.merged ? 'merged' : it.issue.state %></p>
<% } %>
</div>
</div>

View file

@ -0,0 +1,8 @@
<div class="commit-stats info-line">
<%~ include('../icons/file-plus-minus.eta') %>
<p><%= it.stats.total %> lines changed</p>
<p style="display: flex; gap: 0.125em; font-weight: 700;">
<span style="color: #53d37c;">+<%= it.stats.additions %></span>
<span style="color: #d35353;">-<%= it.stats.deletions %></span>
</p>
</div>