og/views/issue.eta
2023-08-03 00:57:43 -05:00

39 lines
1.3 KiB
Text

<% layout('layout') %>
<%
let title = it.issue.title
const titleCharLimit = 50
if (title.length > titleCharLimit) {
title = title.slice(0, titleCharLimit).trim() + '...'
}
let body = it.issue.body
const bodyCharLimit = 50
if (body.length > bodyCharLimit) {
body = body.slice(0, bodyCharLimit).trim() + '...'
}
%>
<div class="main issue">
<div class="contents">
<div class="info">
<p class="repo-name">@<%= it.issue.repository?.full_name || it.issue.base.repo.full_name %></p>
<p class="title"><span class="number">#<%= it.issue.number %></span><%~ include('spanwords', {text: title})
%></p>
<% if (it.issue.body) { %>
<p class="description">
<%= body %>
</p>
<% } %>
</div>
<div class="graphics">
<img width="120" height="120" src="<%= it.issue.user.avatar_url %>?size=120"></img>
</div>
</div>
<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.state != 'open') { %>
<p>·</p>
<p><%= it.issue.pull_request?.merged ? 'merged' : it.issue.state %></p>
<% } %>
</div>
</div>