2b9a1af7fb44400768ffa9e416084651a034c525
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 '<script>0</script>', // This fixes a layout rendering flash on load in FF; do not know why this works but it does.
38 ` <section class="topics">
41 th
.renderTopicRowHeader(),
44 ...(ctx
.topic
&& [ th
.renderTopicRow(ctx
.topic
, ctx
.subscriptions
, false) ] || []),
48 ` <section class="subscriptions">
49 <p>${ctx.subscriptions.length ? ctx.subscriptions.length : 'no'} subscription${(ctx.subscriptions.length === 1) ? '' : 's'}</p>
52 th
.renderSubscriptionRowHeader(),
55 ...(ctx
.subscriptions
&& ctx
.subscriptions
.map(th
.renderSubscriptionRow
)),
61 return th
.htmlPage(2, ctx
, htmlOptions
, content
);