From 73022a68b920123bf3c150dbce5d5872f6f00669 Mon Sep 17 00:00:00 2001 From: cel Date: Tue, 19 Sep 2017 12:07:12 -1000 Subject: Fix npm-packages view --- lib/serve.js | 33 +++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 12 deletions(-) (limited to 'lib') diff --git a/lib/serve.js b/lib/serve.js index 9686927..b3f886f 100644 --- a/lib/serve.js +++ b/lib/serve.js @@ -1891,18 +1891,27 @@ Serve.prototype.npm = function (url) { version ? [ph('code', version), ' '] : '', distTag ? [ph('code', distTag), ' '] : '' ]), - pull( - self.app.blobMentions({ - name: {$prefix: prefix} - }), - distTag && !version && pull.filter(function (link) { - return link.name.split(':')[3] === distTag - }), - pull.map(function (link) { - return self.app.render.npmPackageMention(link) - }), - pull.map(u.toHTML) - ) + ph('table', [ + ph('thead', ph('tr', [ + ph('td', 'package'), + ph('td', 'version'), + ph('td', 'tag'), + ph('td', 'size'), + ph('td', 'tarball') + ])), + ph('tbody', pull( + self.app.blobMentions({ + name: {$prefix: prefix} + }), + distTag && !version && pull.filter(function (link) { + return link.name.split(':')[3] === distTag + }), + pull.map(function (link) { + return self.app.render.npmPackageMention(link) + }), + pull.map(u.toHTML) + )) + ]) ]), self.wrapPage('npm:'), self.respondSink(200) -- cgit v1.2.3