og/views/issue.eta

35 lines
1.1 KiB
Text
Raw Normal View History

2023-08-02 20:00:58 -04:00
<% layout('layout') %>
2023-08-02 20:22:09 -04:00
<%
2023-08-02 20:40:36 -04:00
let title = it.issue.title
const titleCharLimit = 50
if (title.length > titleCharLimit) {
title = title.slice(0, titleCharLimit) + '...'
}
let body = it.issue.body
const bodyCharLimit = 50
if (body.length > bodyCharLimit) {
body = body.slice(0, bodyCharLimit) + '...'
}
2023-08-02 20:22:09 -04:00
%>
2023-08-02 22:03:37 -04:00
<div class="main issue">
2023-08-02 19:10:20 -04:00
<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"
2023-08-02 22:21:14 -04:00
><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 on <%= new Intl.DateTimeFormat('en-US', { dateStyle: 'long' }).format(new Date(it.issue.created_at)) %></p
></div>
2023-08-02 19:10:20 -04:00
</div>