update html template dependency and templates
[websub-hub] / src / template / admin-topic-details-html.js
index df13f210f7af70c2686b3955ee3d744f4b2b43db..8a20ec7db96119bf64d2bfcc4f0204634b5c83b5 100644 (file)
@@ -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,14 +25,22 @@ module.exports = (ctx, options) => {
   if (!ctx.subscriptions) {
     ctx.subscriptions = [];
   }
-  return th.htmlTemplate(2, pageTitle, headElements, navLinks, [
+
+  const htmlOptions = {
+    pageTitle,
+    logoUrl,
+    navLinks,
+    footerEntries,
+  };
+
+  const content = [
     `      <section class="topics">
         <table>
           <thead>`,
     th.renderTopicRowHeader(),
     `          </thead>
         <tbody>`,
-    ...(ctx.topic && [ th.renderTopicRow(ctx.topic, ctx.subscriptions, false) ]),
+    ...(ctx.topic && [ th.renderTopicRow(ctx.topic, ctx.subscriptions, false) ] || []),
     `        </tbody>
         </table>
       </section>`,
@@ -47,5 +55,7 @@ module.exports = (ctx, options) => {
     `          </tbody>
         </table>
       </section>`,
-  ], footerEntries);
+  ];
+
+  return th.htmlPage(2, ctx, htmlOptions, content);
 };
\ No newline at end of file