diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/render-msg.js | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/lib/render-msg.js b/lib/render-msg.js index 96f3b86..6b0513d 100644 --- a/lib/render-msg.js +++ b/lib/render-msg.js @@ -176,6 +176,7 @@ RenderMsg.prototype.message = function (raw, cb) { case 'git-update': return this.gitUpdate(cb) case 'pull-request': return this.gitPullRequest(cb) case 'issue': return this.issue(cb) + case 'music-release-cc': return this.musicRelease(cb) case 'ferment/audio': case 'robeson/audio': return this.audio(cb) @@ -495,3 +496,30 @@ RenderMsg.prototype.audio = function (cb) { : '' ))), cb) } + +RenderMsg.prototype.musicRelease = function (cb) { + var self = this + this.wrap([ + h('table', h('tr', + h('td', + this.c.cover + ? h('a', {href: this.render.imageUrl(this.c.cover)}, h('img', { + src: this.render.imageUrl(this.c.cover), + alt: ' ', + width: 72, + height: 72, + })) + : ''), + h('td', + h('h4.msg-title', this.c.title), + this.c.text + ? h('div', {innerHTML: this.render.markdown(this.c.text)}) + : '' + ) + )), + h('ul', u.toArray(this.c.tracks).filter(Boolean).map(function (track) { + return h('li', + h('a', {href: self.render.toUrl(track.link)}, track.fname)) + })) + ], cb) +} |