abf441adfe8178d5d2a1104e0b848791fc023c16
3 const th
= require('./template-helper');
6 * Show a topic with all of its subscribers.
8 * @param {Object} ctx.topic
9 * @param {Object[]} ctx.subscriptions
10 * @param {Object} options
11 * @param {Object} options.manager
12 * @param {String} options.manager.pageTitle
15 module
.exports
= (ctx
, options
) => {
16 const pageTitle
= `${options.manager.pageTitle} - Topic Details`;
17 const logoUrl
= options
.manager
.logoUrl
;
21 text: '↑ All Topics',
24 const footerEntries
= options
.manager
.footerEntries
;
25 if (!ctx
.subscriptions
) {
26 ctx
.subscriptions
= [];
37 ` <section class="topics">
40 th
.renderTopicRowHeader(),
43 ...(ctx
.topic
&& [ th
.renderTopicRow(ctx
.topic
, ctx
.subscriptions
, false) ] || []),
47 ` <section class="history">
48 <p>Topic Publish History — ${ctx.publishCount} updates in the last ${ctx.publishSpan} days</p>
49 <img title="Topic Publish History" src="${ctx.params.topicId}/history.svg">
51 ` <section class="subscriptions">
52 <p>${ctx.subscriptions.length ? ctx.subscriptions.length : 'no'} subscription${(ctx.subscriptions.length === 1) ? '' : 's'}</p>
55 th
.renderSubscriptionRowHeader(),
58 ...(ctx
.subscriptions
&& ctx
.subscriptions
.map(th
.renderSubscriptionRow
)),
64 return th
.htmlPage(2, ctx
, htmlOptions
, content
);