diff --git a/views/commit.eta b/views/commit.eta index d76d046..c5275d4 100644 --- a/views/commit.eta +++ b/views/commit.eta @@ -22,13 +22,7 @@ -
-

<%= it.commit.stats.total %> lines changed

-

- +<%= it.commit.stats.additions %> - -<%= it.commit.stats.deletions %> -

-
+ <%~ include('partials/commit-stats.eta', {stats: it.commit.stats}) %>

<%= it.commit.committer.full_name || it.commit.committer.login %>

diff --git a/views/issue.eta b/views/issue.eta index a198552..9da42ac 100644 --- a/views/issue.eta +++ b/views/issue.eta @@ -22,13 +22,20 @@
+ <% if (it.prStats) { %> + <%~ include('partials/commit-stats.eta', {stats: it.prStats}) %> + <% } %>

<%= it.issue.user.full_name || it.issue.user.login %>

opened <%= new Intl.DateTimeFormat('en-US', { dateStyle: 'long' }).format(new Date(it.issue.created_at)) %>

+ <% if (it.issue.commits_count) { %> + <%~ include('icons/code-commit.eta') %> +

<%= it.issue.commits_count != 1 ? `${it.issue.commits_count} commits` : `${it.issue.commits_count} commit` %>

+ <% } %> <% if (it.issue.state != 'open') { %>

ยท

-

<%= it.issue.pull_request?.merged ? 'merged' : it.issue.state %>

+

<%= it.issue.merged ? 'merged' : it.issue.state %>

<% } %>
\ No newline at end of file diff --git a/views/partials/commit-stats.eta b/views/partials/commit-stats.eta new file mode 100644 index 0000000..d83a3a0 --- /dev/null +++ b/views/partials/commit-stats.eta @@ -0,0 +1,8 @@ +
+ <%~ include('../icons/file-plus-minus.eta') %> +

<%= it.stats.total %> lines changed

+

+ +<%= it.stats.additions %> + -<%= it.stats.deletions %> +

+
\ No newline at end of file