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 ` <section class="topics">
30 <p>${ctx.topics.length ? ctx.topics.length : 'no'} topic${(ctx.topics.length === 1) ? '' : 's'}</p>
33 th
.renderTopicRowHeader(),
36 ...(ctx
.topics
&& ctx
.topics
.map((topic
) => th
.renderTopicRow(topic
, { length: topic
.subscribers
}))),
42 return th
.htmlPage(1, ctx
, htmlOptions
, content
);