aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519>2018-05-08 21:21:18 -0400
committercel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519>2018-05-08 21:21:18 -0400
commitb0584f97074489bdd1f5f5a742014874325f4e95 (patch)
treed59a84a114cd769a686b5f5581b6a31d0a02c8b5
parent186eda99a11e79b4bbe1f7ecf07085d6f61a5333 (diff)
downloadpatchfoo-b0584f97074489bdd1f5f5a742014874325f4e95.tar.gz
patchfoo-b0584f97074489bdd1f5f5a742014874325f4e95.zip
Render talenet skill similarity
-rw-r--r--lib/render-msg.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/render-msg.js b/lib/render-msg.js
index 2f204fc..506ccea 100644
--- a/lib/render-msg.js
+++ b/lib/render-msg.js
@@ -286,6 +286,7 @@ RenderMsg.prototype.message = function (cb) {
case 'talenet-idea-create': return this.ideaCreate(cb)
case 'talenet-idea-association': return this.ideaAssocate(cb)
case 'talenet-skill-create': return this.skillCreate(cb)
+ case 'talenet-skill-similarity': return this.skillSimilarity(cb)
case 'talenet-idea-hat': return this.ideaHat(cb)
case 'talenet-idea-update': return this.ideaUpdate(cb)
case 'talenet-idea-comment':
@@ -1535,6 +1536,21 @@ RenderMsg.prototype.ideaCreate = function (cb) {
), cb)
}
+RenderMsg.prototype.skillSimilarity = function (cb) {
+ var self = this
+ var done = multicb({pluck: 1, spread: true})
+ self.link(self.c.skillKey1, done())
+ self.link(self.c.skillKey2, done())
+ var similarity = !!self.c.similarity
+ done(function (err, skill1, skill2) {
+ self.wrapMini(h('span',
+ 'considers ', skill1, ' to be ',
+ similarity ? 'similar to ' : 'not similar to ',
+ skill2
+ ), cb)
+ })
+}
+
RenderMsg.prototype.identitySkillAssign = function (cb) {
var self = this
self.link(self.c.skillKey, function (err, a) {