diff options
author | cel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519> | 2017-12-25 10:20:03 -1000 |
---|---|---|
committer | cel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519> | 2017-12-25 11:26:54 -1000 |
commit | b48b730900193fd19ce40192f0252593efa12f95 (patch) | |
tree | ad8508477605e2e088df7b3fc1e0363fb6298bde /lib | |
parent | 704394335d188f98074906558c73db228c571690 (diff) | |
download | patchfoo-b48b730900193fd19ce40192f0252593efa12f95.tar.gz patchfoo-b48b730900193fd19ce40192f0252593efa12f95.zip |
Render more talenet
Diffstat (limited to 'lib')
-rw-r--r-- | lib/render-msg.js | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/lib/render-msg.js b/lib/render-msg.js index f84b0ae..92ad260 100644 --- a/lib/render-msg.js +++ b/lib/render-msg.js @@ -284,7 +284,8 @@ RenderMsg.prototype.message = function (cb) { case 'talenet-skill-create': return this.skillCreate(cb) case 'talenet-idea-hat': return this.ideaHat(cb) case 'talenet-idea-update': return this.ideaUpdate(cb) - case 'talenet-idea-comment': return this.ideaComment(cb) + case 'talenet-idea-comment': + case 'talenet-idea-comment_reply': return this.ideaComment(cb) default: return this.object(cb) } } @@ -408,8 +409,8 @@ RenderMsg.prototype.title1 = function (cb) { self.chessInviteTitle(cb) else if (self.c.type === 'bookclub') self.bookclubTitle(cb) - else if (self.c.type === 'talenet-skill-create') - cb(null, title(self.c.name)) + else if (self.c.type === 'talenet-skill-create' && self.c.name) + cb(null, self.c.name) else if (self.c.type === 'talenet-idea-create') self.app.getIdeaTitle(self.msg.key, cb) else @@ -490,6 +491,7 @@ var knownAboutProps = { rating: true, ratingType: true, */ + 'talenet-version': true, } RenderMsg.prototype.about = function (cb) { @@ -1511,7 +1513,8 @@ RenderMsg.prototype.identitySkillAssign = function (cb) { var self = this self.link(self.c.skillKey, function (err, a) { self.wrapMini(h('span', - self.c.action === 'assign' ? 'has ' + self.c.action === 'assign' ? 'assigns ' + : self.c.action === 'unassign' ? 'unassigns ' : h('code', self.c.action), ' ', 'skill ', a ), cb) @@ -1525,10 +1528,11 @@ RenderMsg.prototype.ideaSkillAssign = function (cb) { self.link(self.c.ideaKey, done()) done(function (err, skillA, ideaA) { self.wrapMini(h('span', - self.c.action === 'assign' ? 'needs ' + self.c.action === 'assign' ? 'assigns ' + : self.c.action === 'unassign' ? 'unassigns ' : h('code', self.c.action), ' ', 'skill ', skillA, - ' for idea ', + ' to idea ', ideaA ), cb) }) @@ -1538,7 +1542,8 @@ RenderMsg.prototype.ideaAssocate = function (cb) { var self = this self.link(self.c.ideaKey, function (err, a) { self.wrapMini(h('span', - self.c.action === 'associate' ? 'likes ' + self.c.action === 'associate' ? 'associates with ' + : self.c.action === 'disassociate' ? 'disassociates with ' : h('code', self.c.action), ' ', 'idea ', a ), cb) @@ -1550,6 +1555,7 @@ RenderMsg.prototype.ideaHat = function (cb) { self.link(self.c.ideaKey, function (err, a) { self.wrapMini(h('span', self.c.action === 'take' ? 'takes ' + : self.c.action === 'discard' ? 'discards ' : h('code', self.c.action), ' ', 'idea ', a ), cb) @@ -1604,9 +1610,14 @@ RenderMsg.prototype.ideaUpdate = function (cb) { RenderMsg.prototype.ideaComment = function (cb) { var self = this - self.link(self.c.ideaKey, function (err, ideaA) { + var done = multicb({pluck: 1, spread: true}) + self.link(self.c.ideaKey, done()) + self.link(self.c.commentKey, done()) + done(function (err, ideaLink, commentLink) { + if (err) return self.wrap(u.renderError(err), cb) self.wrap(h('div', [ - h('div', h('small', h('span.symbol', '→'), ' idea ', ideaA)), + ideaLink ? h('div', h('small', h('span.symbol', '→'), ' idea ', ideaLink)) : '', + commentLink ? h('div', h('small', h('span.symbol', '↳'), ' comment ', commentLink)) : '', self.c.text ? h('div', {innerHTML: self.render.markdown(self.c.text)}) : '' ]), cb) |