git ssb

9+

cel / ssb-viewer



Commit bff02dfad025baf27f2ed85aa4ef08854a84c8df

Style git messages better

Anders Rune Jensen committed on 5/12/2017, 11:38:48 AM
Parent: 1b057d84aa726cdc9404a6340cb96c8825329242

Files changed

index.jschanged
render.jschanged
index.jsView
@@ -106,8 +106,9 @@
106106 pull.values(logs),
107107 paramap(addAuthorAbout, 8),
108108 paramap(addFollowAbout, 8),
109109 paramap(addVoteMessage, 8),
110 + paramap(addGitLinks, 8),
110111 pull(renderThread(defaultOpts), wrapPage(about.name)),
111112 toPull(res, function (err) {
112113 if (err) console.error('[viewer]', err)
113114 })
@@ -295,8 +296,25 @@
295296 msg.author = about
296297 cb(null, msg)
297298 })
298299 }
300 +
301 + function addGitLinks(msg, cb) {
302 + if (msg.value.content.type == 'git-update')
303 + getMsg(msg.value.content.repo, function (err, gitRepo) {
304 + if (gitRepo)
305 + msg.value.content.repoName = gitRepo.value.content.name
306 + cb(null, msg)
307 + })
308 + else if (msg.value.content.type == 'issue')
309 + getMsg(msg.value.content.project, function (err, gitRepo) {
310 + if (gitRepo)
311 + msg.value.content.repoName = gitRepo.value.content.name
312 + cb(null, msg)
313 + })
314 + else
315 + cb(null, msg)
316 + }
299317 }
300318
301319 function serveBlob(req, res, sbot, id) {
302320 if (req.headers['if-none-match'] === id) return respond(res, 304)
render.jsView
@@ -388,17 +388,18 @@
388388 renderDefault(c);
389389 }
390390 else if (c.type == "issue") {
391391 return '<span class="status">' +
392- "Created a git issue" +
393- '</span>' +
394- renderDefault(c);
392 + "Created a git issue" + (c.repoName != undefined ? " in repo " + c.repoName : "") + renderPost(opts, c) +
393 + '</span>';
394 + //renderDefault(c);
395395 }
396396 else if (c.type == "git-update") {
397397 return '<span class="status">' +
398- "Did a git update" +
399- '</span>' +
400- renderDefault(c);
398 + "Did a git update " + (c.repoName != undefined ? " in repo " + c.repoName : "") +
399 + "<br/>" +
400 + (c.commits != undefined ? c.commits.map(com => { return "-" +com.title; }).join("<br/>") : "") +
401 + '</span>'
401402 }
402403 else if (c.type == "ssb-dns") {
403404 return '<span class="status">' +
404405 "Updated DNS" +

Built with git-ssb-web