aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519>2017-02-02 12:11:43 -0800
committercel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519>2017-02-04 02:53:53 -0800
commit4d7791fb6b9fc2c1063b88069fd8aa2bad0c18f2 (patch)
treefe30ce06e234ae261039871d7d14ccf986b82235
parentbcd5d6924eb4729b6a85e50c3e91495d0c55d3f6 (diff)
downloadpatchfoo-4d7791fb6b9fc2c1063b88069fd8aa2bad0c18f2.tar.gz
patchfoo-4d7791fb6b9fc2c1063b88069fd8aa2bad0c18f2.zip
Render music-release-cc messages
-rw-r--r--lib/render-msg.js28
-rw-r--r--static/styles.css5
2 files changed, 33 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)
+}
diff --git a/static/styles.css b/static/styles.css
index 2210522..a0ec39f 100644
--- a/static/styles.css
+++ b/static/styles.css
@@ -116,3 +116,8 @@ td {
margin-left: .25em;
background-color: #efd;
}
+
+.msg-title {
+ margin: 0;
+ padding: 0;
+}