aboutsummaryrefslogtreecommitdiff
path: root/lib/render-msg.js
diff options
context:
space:
mode:
authorcel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519>2017-12-06 16:01:59 -0800
committercel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519>2017-12-06 16:01:59 -0800
commitef2fab24f57268bc2a96e74078855dfad047fd5b (patch)
tree8ef7549f61c577487b9ff830ddea9ca88db09429 /lib/render-msg.js
parent00885846f2c98059a4b95b2d18b4a4a8f22f7901 (diff)
downloadpatchfoo-ef2fab24f57268bc2a96e74078855dfad047fd5b.tar.gz
patchfoo-ef2fab24f57268bc2a96e74078855dfad047fd5b.zip
Render npm-packages dependencyBranch, versionBranch
Diffstat (limited to 'lib/render-msg.js')
-rw-r--r--lib/render-msg.js16
1 files changed, 15 insertions, 1 deletions
diff --git a/lib/render-msg.js b/lib/render-msg.js
index e25d1b7..51db2a7 100644
--- a/lib/render-msg.js
+++ b/lib/render-msg.js
@@ -1062,9 +1062,23 @@ RenderMsg.prototype.npmPublish = function (cb) {
RenderMsg.prototype.npmPackages = function (cb) {
var self = this
+ var done = multicb({pluck: 1, spread: true})
+ var elCb = done()
+ function renderIdLink(id) {
+ return [h('a', {href: self.toUrl(id)}, truncate(id, 8)), ' ']
+ }
self.render.npmPackageMentions(self.c.mentions, function (err, el) {
if (err) return cb(err)
- self.wrap(el, cb)
+ self.wrap(h('div', [
+ el,
+ Array.isArray(self.c.dependencyBranch) ? h('div',
+ 'dependencies via: ', self.c.dependencyBranch.map(renderIdLink)
+ ) : '',
+ Array.isArray(self.c.versionBranch) ? h('div',
+ 'previous versions: ', self.c.versionBranch.map(renderIdLink)
+ ) : ''
+ ]), elCb)
+ return done(cb)
})
}