git ssb

30+

cel / git-ssb-web



Commit bcc4c3555e43a5f9cb02b98de559a806dce9b933

Render comments on issues & pull requests in feed

Charles Lehner committed on 4/21/2016, 2:33:01 AM
Parent: c161479ab3878dc4ae4819e8b18b35cbfc4cf003

Files changed

index.jschanged
locale/en.jsonchanged
locale/eo.jsonchanged
index.jsView
@@ -848,9 +848,11 @@
848848 }
849849 return pull(
850850 feedId ? ssb.createUserStream(opts) : ssb.createFeedStream(opts),
851851 pull.filter(function (msg) {
852- return msg.value.content.type in msgTypes
852+ var c = msg.value.content
853+ return c.type in msgTypes
854+ || (c.type == 'post' && c.repo && c.issue)
853855 }),
854856 typeof filter == 'function' ? filter(opts) : filter,
855857 pull.take(20),
856858 addAuthorName(about),
@@ -959,8 +961,21 @@
959961 author: authorLink,
960962 target: '<tt>' + escapeHTML(c.about) + '</tt>',
961963 name: link([c.about], c.name)
962964 }) + '</section>')
965+ case 'post':
966+ return pullReqs.get(c.issue, function (err, pr) {
967+ if (err) return cb(err)
968+ var type = pr.msg.value.content.type == 'pull-request' ?
969+ 'pull request' : 'issue.'
970+ return cb(null, '<section class="collapse">' + msgLink + '<br>' +
971+ req._t('CommentedOn', {
972+ author: authorLink,
973+ target: req._t(type) + ' ' + link([pr.id], pr.title, true)
974+ }) +
975+ '<blockquote>' + markdown(c.text) + '</blockquote>' +
976+ '</section>')
977+ })
963978 default:
964979 return cb(null, json(msg))
965980 }
966981 }
locale/en.jsonView
@@ -27,8 +27,9 @@
2727 "CreatedRepo": "%{name} created repo %{repo}",
2828 "Pushed": "%{name} pushed to %{repo}",
2929 "OpenedIssue": "%{name} opened %{type} %{title} on %{project}",
3030 "Named": "%{author} named %{target} %{name}",
31+ "CommentedOn": "%{author} commented on %{target}",
3132 "Activity": "Activity",
3233 "Repos": "Repos",
3334 "UpdatedOnDate": "Updated %{date}",
3435 "CreatedOnDate": "Created %{date}",
locale/eo.jsonView
@@ -27,8 +27,9 @@
2727 "CreatedRepo": "%{name} kreis deponejon %{repo}",
2828 "Pushed": "%{name} puŝis al %{repo}",
2929 "OpenedIssue": "%{name} malfermiĝis %{type} %{title} sur %{project}",
3030 "Named": "%{author} nomis %{target} %{name}",
31+ "CommentedOn": "%{author} komentis %{target}",
3132 "Activity": "Aktivaĵo",
3233 "Repos": "Deponejoj",
3334 "UpdatedOnDate": "Ĝisdatigis je %{date}",
3435 "CreatedOnDate": "Kreis je %{date}",

Built with git-ssb-web