525337dc5ad6e76b3591d6d6297717009cc0d1e4
3 const th
= require('./template-helper');
6 * Show a summary of all topics.
8 * @param {Object[]} ctx.topics
9 * @param {Object} options
10 * @param {Object} options.manager
11 * @param {String} options.manager.pageTitle
14 module
.exports
= (ctx
, options
) => {
15 const pageTitle
= `${options.manager.pageTitle} - Topics`;
16 const logoUrl
= options
.manager
.logoUrl
;
17 const footerEntries
= options
.manager
.footerEntries
;
29 '<script>0</script>', // This fixes a layout rendering flash on load in FF; do not know why this works but it does.
30 ` <section class="topics">
31 <p>${ctx.topics.length ? ctx.topics.length : 'no'} topic${(ctx.topics.length === 1) ? '' : 's'}</p>
34 th
.renderTopicRowHeader(),
37 ...(ctx
.topics
&& ctx
.topics
.map((topic
) => th
.renderTopicRow(topic
, { length: topic
.subscribers
}))),
43 return th
.htmlPage(1, ctx
, htmlOptions
, content
);