aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519>2017-04-20 14:13:57 -0700
committercel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519>2017-04-20 14:13:57 -0700
commite46be6be1dc1edb50867e971eced70a5a1e78295 (patch)
tree8bcf6b5b5a8212876c49dbb0527e7f019d778a68
parent014985f9272b4c9f82d8d3a48d92e491f875cbf7 (diff)
downloadpatchfoo-e46be6be1dc1edb50867e971eced70a5a1e78295.tar.gz
patchfoo-e46be6be1dc1edb50867e971eced70a5a1e78295.zip
Render some patch-gathering about messages
-rw-r--r--lib/render-msg.js16
1 files changed, 13 insertions, 3 deletions
diff --git a/lib/render-msg.js b/lib/render-msg.js
index eadbcd1..786294f 100644
--- a/lib/render-msg.js
+++ b/lib/render-msg.js
@@ -308,7 +308,8 @@ RenderMsg.prototype.title = function (cb) {
else
self.app.getAbout(self.msg.key, function (err, about) {
if (err) return cb(err)
- if (about.name) return cb(null, about.name)
+ var name = about.name || about.title || about.description
+ if (name) return cb(null, name)
self.message(false, function (err, el) {
if (err) return cb(err)
cb(null, '%' + title(h('div', el).textContent))
@@ -348,19 +349,28 @@ RenderMsg.prototype.link1 = function (link, cb) {
RenderMsg.prototype.about = function (cb) {
var img = u.linkDest(this.c.image)
+ var done = multicb({pluck: 1, spread: true})
+ var elCb = done()
this.wrapMini([
this.c.about === this.msg.value.author ? 'self-identifies' :
['identifies ', h('a', {href: this.toUrl(this.c.about)}, truncate(this.c.about, 10))],
' as ',
this.c.name ? [h('ins', this.c.name), ' '] : '',
this.c.description ? h('div',
- {innerHTML: this.render.markdown(this.c.description)}) : h('br'),
+ {innerHTML: this.render.markdown(this.c.description)}) : '',
+ this.c.title ? h('h3', this.c.title) : '',
+ this.c.attendee ? h('div',
+ this.link1(this.c.attendee.id, done()),
+ this.c.attendee.remove ? ' is not attending' : ' is attending'
+ ) : '',
+ this.c.location ? h('div', 'at ', this.c.location) : '',
img ? h('a', {href: this.toUrl(img)},
h('img.ssb-avatar-image', {
src: this.render.imageUrl(img),
alt: ' ',
})) : ''
- ], cb)
+ ], elCb)
+ done(cb)
}
RenderMsg.prototype.contact = function (cb) {