425ca29 / webui.mjs
diff --git a/webui.mjs b/webui.mjs
index b74417d..e9db725 100644
--- a/webui.mjs
+++ b/webui.mjs
@@ -108,12 +108,18 @@ ${entriesTable(entries, '')}`
return page(name, body)
}
-function feedPost({ id, author, timestamp, text, replyTo }) {
+function feedPost({ id, author, timestamp, text, replyTo, ref, commit, count, commits, updateId }) {
const date = new Date(timestamp).toISOString().slice(0, 16).replace('T', ' ') + ' UTC'
const replyLink = replyTo ? `<br><a href="?post=${encodeURIComponent(replyTo)}">In reply to ${escapeHtml(shortHash(replyTo))}</a>` : ''
+ const content = updateId ? `<p>Pushed ${count} ${count === 1 ? 'commit' : 'commits'} to <code>${escapeHtml(ref.slice('refs/heads/'.length))}</code>
+at <a href="/commit/${escapeHtml(commit)}"><code>${escapeHtml(shortHash(commit))}</code></a>.
+<a href="?update=${encodeURIComponent(updateId)}">Git update ${escapeHtml(shortHash(updateId))}</a></p>
+<ul>${commits.map(item => `<li><a href="/commit/${escapeHtml(item.hash)}"><code>${escapeHtml(shortHash(item.hash))}</code></a> ${escapeHtml(item.subject)}</li>`).join('')}</ul>
+${count > commits.length ? `<p>Showing ${commits.length} of ${count} commits.</p>` : ''}`
+ : `<p>${escapeHtml(text).replace(/\r\n?|\n/g, '<br>\n')}</p>`
return `<p><a href="?author=${encodeURIComponent(author)}"><code>${escapeHtml(shortHash(author))}</code></a>
<a href="?post=${encodeURIComponent(id)}">${date}</a>${replyLink}</p>
-<p>${escapeHtml(text).replace(/\r\n?|\n/g, '<br>\n')}</p>`
+${content}`
}
export function feedPage({ posts, author, post, missing }) {
Git ยท Social feed