Style git messages better
This commit is contained in:
@@ -107,6 +107,7 @@ exports.init = function (sbot, config) {
|
||||
paramap(addAuthorAbout, 8),
|
||||
paramap(addFollowAbout, 8),
|
||||
paramap(addVoteMessage, 8),
|
||||
paramap(addGitLinks, 8),
|
||||
pull(renderThread(defaultOpts), wrapPage(about.name)),
|
||||
toPull(res, function (err) {
|
||||
if (err) console.error('[viewer]', err)
|
||||
@@ -296,6 +297,23 @@ exports.init = function (sbot, config) {
|
||||
cb(null, msg)
|
||||
})
|
||||
}
|
||||
|
||||
function addGitLinks(msg, cb) {
|
||||
if (msg.value.content.type == 'git-update')
|
||||
getMsg(msg.value.content.repo, function (err, gitRepo) {
|
||||
if (gitRepo)
|
||||
msg.value.content.repoName = gitRepo.value.content.name
|
||||
cb(null, msg)
|
||||
})
|
||||
else if (msg.value.content.type == 'issue')
|
||||
getMsg(msg.value.content.project, function (err, gitRepo) {
|
||||
if (gitRepo)
|
||||
msg.value.content.repoName = gitRepo.value.content.name
|
||||
cb(null, msg)
|
||||
})
|
||||
else
|
||||
cb(null, msg)
|
||||
}
|
||||
}
|
||||
|
||||
function serveBlob(req, res, sbot, id) {
|
||||
|
||||
@@ -389,15 +389,16 @@ function render(opts, c) {
|
||||
}
|
||||
else if (c.type == "issue") {
|
||||
return '<span class="status">' +
|
||||
"Created a git issue" +
|
||||
'</span>' +
|
||||
renderDefault(c);
|
||||
"Created a git issue" + (c.repoName != undefined ? " in repo " + c.repoName : "") + renderPost(opts, c) +
|
||||
'</span>';
|
||||
//renderDefault(c);
|
||||
}
|
||||
else if (c.type == "git-update") {
|
||||
return '<span class="status">' +
|
||||
"Did a git update" +
|
||||
'</span>' +
|
||||
renderDefault(c);
|
||||
"Did a git update " + (c.repoName != undefined ? " in repo " + c.repoName : "") +
|
||||
"<br/>" +
|
||||
(c.commits != undefined ? c.commits.map(com => { return "-" +com.title; }).join("<br/>") : "") +
|
||||
'</span>'
|
||||
}
|
||||
else if (c.type == "ssb-dns") {
|
||||
return '<span class="status">' +
|
||||
|
||||
Reference in New Issue
Block a user