aboutsummaryrefslogtreecommitdiff
path: root/views
diff options
context:
space:
mode:
authorJoe Mou <dev@mou.fo>2026-09-21 18:08:48 -0400
committerJoe Mou <dev@mou.fo>2026-09-25 01:43:53 -0400
commitfd1c054c3c10dceb1a8a355c74a0d9e9077aae19 (patch)
treef0f17b19feb6496fef629dfa4af3db72ed249d13 /views
parent499bba129c842c00c1a28d85bc044ab609aee44e (diff)
Add issue details
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Diffstat (limited to 'views')
-rw-r--r--views/_issueComment.eta18
-rw-r--r--views/_issueLabel.eta1
-rw-r--r--views/issue.eta67
3 files changed, 86 insertions, 0 deletions
diff --git a/views/_issueComment.eta b/views/_issueComment.eta
new file mode 100644
index 0000000..8a851e8
--- /dev/null
+++ b/views/_issueComment.eta
@@ -0,0 +1,18 @@
+<div class="box comment" id="<%= it.comment.anchor %>">
+ <header>
+ <span>
+ <% if (it.comment.author) { %>
+ <a href="/<%= it.comment.author %>"><%= it.comment.author %></a>
+ <% } else { %>
+ <span class="placeholder">ghost</span>
+ <% } %>
+ <% if (it.comment.association) { %>
+ <span class="pill"><%= it.comment.association %></span>
+ <% } %>
+ </span>
+ <span class="timestamp">
+ <a href="#<%= it.comment.anchor %>"><time title="<%= it.comment.createdAt %>"><%= it.comment.createdAt.split("T")[0] %></time></a>
+ </span>
+ </header>
+ <%~ it.comment.bodyHtml %>
+</div>
diff --git a/views/_issueLabel.eta b/views/_issueLabel.eta
new file mode 100644
index 0000000..52f622a
--- /dev/null
+++ b/views/_issueLabel.eta
@@ -0,0 +1 @@
+<span class="pill"<% if (it.label.description) { %> title="<%= it.label.description %>"<% } %>><span class="pill-dot" style="background: #<%= it.label.color %>"></span><%= it.label.name %></span>
diff --git a/views/issue.eta b/views/issue.eta
new file mode 100644
index 0000000..0adafe9
--- /dev/null
+++ b/views/issue.eta
@@ -0,0 +1,67 @@
+<%
+layout("/layouts/repo.eta")
+it.path = `issues/${it.number}`
+it.searchType = "issues"
+
+const stateText = it.state !== "CLOSED"
+ ? "Open"
+ : it.stateReason === "NOT_PLANNED"
+ ? "Closed as not planned"
+ : it.stateReason === "DUPLICATE"
+ ? "Closed as duplicate"
+ : "Closed"
+%>
+
+<div class="box">
+ <h2><%~ it.titleHtml %></h2>
+
+ #<%= it.number %>
+ <span class="pill state <%= it.state === "CLOSED" ? "state-closed" : "state-open" %>"><%= stateText %></span>
+ <% if (it.labels.length > 0) { %>
+ <% for (const label of it.labels) { %>
+ <%~ include("./_issueLabel.eta", { label }) %>
+ <% } %>
+ <% } %>
+ <% if (it.assignees.length > 0) { %>
+ assigned to
+ <% for (const assignee of it.assignees) { %>
+ <a href="/<%= assignee %>"><%= assignee %></a>
+ <% } %>
+ <% } %>
+ <% if (it.milestone) { %>
+ milestone <a href="<%= it.milestone.href %>"><%= it.milestone.title %></a>
+ <% } %>
+</div>
+
+<%~ include("./_issueComment.eta", { comment: it.body }) %>
+
+<% for (const item of it.timeline) { %>
+ <% if (item.kind === "comment") { %>
+ <%~ include("./_issueComment.eta", { comment: item }) %>
+ <% } else { %>
+ <div class="issue-event"<% if (item.anchor) { %> id="<%= item.anchor %>"<% } %>>
+ <span>
+ <% if (item.actor) { %>
+ <a href="/<%= item.actor %>"><%= item.actor %></a>
+ <% } else { %>
+ <span class="placeholder">ghost</span>
+ <% } %>
+ <%= item.description %><% if (item.label) { %> <%~ include("./_issueLabel.eta", { label: item.label }) %> label<% } %><% if (item.link) { %> <a href="<%= item.link.href %>"><%= item.link.text %></a><% } %>
+ </span>
+ <span class="timestamp">
+ <% if (item.anchor) { %>
+ <a href="#<%= item.anchor %>"><time title="<%= item.createdAt %>"><%= item.createdAt.split("T")[0] %></time></a>
+ <% } else { %>
+ <time title="<%= item.createdAt %>"><%= item.createdAt.split("T")[0] %></time>
+ <% } %>
+ </span>
+ </div>
+ <% } %>
+<% } %>
+
+<% if (it.hiddenItems > 0) { %>
+ <div class="box placeholder">
+ <%= it.hiddenItems %> later
+ <%= it.hiddenItems === 1 ? "comment or event is" : "comments and events are" %> only on GitHub.
+ </div>
+<% } %>