From 02cc78da9251b2ffd896dbf06bbb48e36160edbc Mon Sep 17 00:00:00 2001 From: cel Date: Fri, 10 Mar 2017 17:15:55 -0500 Subject: on publish, show only name of new message --- lib/render.js | 14 +++++++------- lib/serve.js | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'lib') diff --git a/lib/render.js b/lib/render.js index eaca499..ed60216 100644 --- a/lib/render.js +++ b/lib/render.js @@ -199,18 +199,18 @@ Render.prototype.privateLine = function (recps, cb) { Render.prototype.msgLink = function (msg, cb) { var self = this - var el = h('div') + var el = h('span') + var a = h('a', {href: self.toUrl(msg.key)}, msg.key) self.app.unboxMsg(msg, function (err, msg) { if (err) return el.appendChild(u.renderError(err)), cb() - self.renderMsg(msg, false, function (err, msgEl) { - if (err) msgEl = [ - h('a', {href: self.toUrl(msg.key)}, msg.key), - u.renderError(err)] - el.appendChild(h('table.ssb-msgs', msgEl)) + var renderMsg = new RenderMsg(self, self.app, msg, {wrap: false}) + renderMsg.title(function (err, title) { + if (err) return el.appendChild(u.renderError(err)), cb() + a.childNodes[0].textContent = title cb() }) }) - return el + return a } Render.prototype.renderMsg = function (msg, raw, cb) { diff --git a/lib/serve.js b/lib/serve.js index 188b275..8885704 100644 --- a/lib/serve.js +++ b/lib/serve.js @@ -685,7 +685,7 @@ Serve.prototype.wrapPage = function (title, searchQ) { // h('a', {href: '/git'}, 'git') )), self.publishedMsg ? h('div', - 'published:', + 'published ', self.app.render.msgLink(self.publishedMsg, done()) ) : '', content -- cgit v1.2.3