X-Git-Url: https://git.squeep.com/?a=blobdiff_plain;f=src%2Ftemplate%2Fadmin-topic-details-html.js;h=1d0add005079f356545eae03db8448548af61134;hb=429d914b206ac0e8b8dc8bbb1afad022b8dcf1a2;hp=df13f210f7af70c2686b3955ee3d744f4b2b43db;hpb=ed6dc5a66ce0eaf2dd61f9fb7a5ec048944c68ee;p=websub-hub diff --git a/src/template/admin-topic-details-html.js b/src/template/admin-topic-details-html.js index df13f21..1d0add0 100644 --- a/src/template/admin-topic-details-html.js +++ b/src/template/admin-topic-details-html.js @@ -14,7 +14,7 @@ const th = require('./template-helper'); */ module.exports = (ctx, options) => { const pageTitle = `${options.manager.pageTitle} - Topic Details`; - const headElements = []; + const logoUrl = options.manager.logoUrl; const navLinks = [ { href: '..', @@ -25,20 +25,39 @@ module.exports = (ctx, options) => { if (!ctx.subscriptions) { ctx.subscriptions = []; } - return th.htmlTemplate(2, pageTitle, headElements, navLinks, [ + + const htmlOptions = { + pageTitle, + logoUrl, + navLinks, + footerEntries, + }; + + const content = [ `
`, th.renderTopicRowHeader(), ` `, - ...(ctx.topic && [ th.renderTopicRow(ctx.topic, ctx.subscriptions, false) ]), + ...(ctx.topic && [ th.renderTopicRow(ctx.topic, ctx.subscriptions, false) ] || []), `
`, + `
+

Topic Publish History — ${ctx.publishCount} updates in the last ${ctx.publishSpan} days

+ +
`, `
-

${ctx.subscriptions.length ? ctx.subscriptions.length : 'no'} subscription${(ctx.subscriptions.length === 1) ? '' : 's'}

- +

${ctx.subscriptions.length ? ctx.subscriptions.length : 'no'} subscription${(ctx.subscriptions.length === 1) ? '' : 's'}

`, + ...(ctx.subscriptions.length && [` + + + ${ctx.subscriptionsDelivered} of ${ctx.subscriptions.length} (${Math.ceil(100 * ctx.subscriptions.length / ctx.subscriptionsDelivered)}%) + `] || []), + `
`, th.renderSubscriptionRowHeader(), ` @@ -47,5 +66,7 @@ module.exports = (ctx, options) => { `
`, - ], footerEntries); + ]; + + return th.htmlPage(2, ctx, htmlOptions, content); }; \ No newline at end of file