og/views/commit.eta

39 lines
1.3 KiB
Text
Raw Normal View History

2023-08-03 05:40:18 -04:00
<% layout('layout') %>
<%
let title = it.commit.message.split('\n')[0]
let body = it.commit.message.split('\n').slice(1).join('\n').trim()
const titleCharLimit = 50
if (title.length > titleCharLimit) {
title = title.slice(0, titleCharLimit).trim() + '...'
}
%>
<div class="main commit">
<div class="contents">
<div class="info">
<p class="repo-name">@<%= it.commit.repository.full_name %></p>
<p class="title"><%= title %></p>
<% if (body) { %>
<p class="description">
<%= body %>
</p>
<% } %>
</div>
<div class="graphics">
<img width="120" height="120" src="<%= it.commit.committer.avatar_url %>?size=120"></img>
</div>
</div>
2023-08-03 07:54:05 -04:00
<%~ include('partials/commit-stats.eta', {stats: it.commit.stats}) %>
2023-08-03 05:40:18 -04:00
<div class="info-line">
<img class="avatar" width="48" height="48" src="<%= it.commit.committer.avatar_url %>?size=48"></img>
2023-08-03 08:48:52 -04:00
<p class="author"><%= it.commit.committer.full_name || it.commit.committer.name || it.commit.committer.login %></p>
2023-08-03 05:40:18 -04:00
<p>committed <%= new Intl.DateTimeFormat('en-US', { dateStyle: 'long' }).format(new Date(it.commit.created_at)) %></p>
2023-08-03 07:53:49 -04:00
<%~ include('icons/code-commit.eta') %>
2023-08-03 05:40:18 -04:00
<p><%= it.commit.sha.slice(0, 7) %></p>
</div>
2023-09-10 14:48:50 -04:00
</div>
<style>
.commit .repo-name {
font-size: 2.5rem;
color: #6d728f;
}
</style>