From 3c608e0159f165149400aef6b07160373797b31b Mon Sep 17 00:00:00 2001 From: Jacob Karlsson Date: Sat, 7 Jul 2018 12:41:38 +0200 Subject: [PATCH] Add gathering title --- .gitignore | 2 ++ index.js | 3 ++- lib/about.js | 2 ++ render.js | 5 ++++- 4 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ccb2c80 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +node_modules/ +package-lock.json \ No newline at end of file diff --git a/index.js b/index.js index 2a0e012..04a99dd 100644 --- a/index.js +++ b/index.js @@ -411,7 +411,6 @@ exports.init = function (sbot, config) { }}], index: 'DTA' }), - //pull.map(o => { console.log('bl:', o.value.content); return o }), // Only grab messages about attendance pull.filter(o => o.value.content.attendee !== undefined), // Filter "can't attend"-messages @@ -419,7 +418,9 @@ exports.init = function (sbot, config) { pull.unique(o => o.value.content.attendee.link), pull.collect((err, arr) => { if (err) { cb(err) } + msg.value.content.numberAttending = arr.length + cb(null, msg) }) ) diff --git a/lib/about.js b/lib/about.js index 70761c8..a33a919 100644 --- a/lib/about.js +++ b/lib/about.js @@ -29,6 +29,8 @@ module.exports = function (sbot, id, cb) { if (typeof c.name == 'string') feedAbout.name = c.name.replace(/^@?/, '@') if (c.image) feedAbout.image = linkDest(c.image) if (c.description) feedAbout.description = c.description + if (c.title) feedAbout.title = c.title + if (c.startDateTime) feedAbout.startDateTime = c.startDateTime if (c.publicWebHosting != null && author === c.about) feedAbout.publicWebHosting = defalsify(c.publicWebHosting) }, function (err) { if (err) return cb(err) diff --git a/render.js b/render.js index 1d3436b..8e86d27 100644 --- a/render.js +++ b/render.js @@ -537,8 +537,11 @@ function renderGathering(opts, id, c) { desc.innerHTML = marked(c.about.description, opts.marked) const image = h('p', h('img', { src: opts.img_base + c.about.image })) const attending = h('h3.attending', c.numberAttending + ' attending') + const title = h('h2', c.about.title) + console.log('c', c) return h('section', - [image, + [title, + image, attending, desc] )