X-Git-Url: https://git.squeep.com/?a=blobdiff_plain;f=src%2Ftemplate%2Froot-html.js;h=c6095dc4384bd59e0792a3754d55b59a76bad609;hb=refs%2Fheads%2Fmaster;hp=1c3f4ebec70a547e9151cd08a1d93e9fbda48f2e;hpb=726cd980f0ed5588cfe8cbb2d994d5e4aef6e292;p=squeep-indie-auther
diff --git a/src/template/root-html.js b/src/template/root-html.js
index 1c3f4eb..c6095dc 100644
--- a/src/template/root-html.js
+++ b/src/template/root-html.js
@@ -1,7 +1,11 @@
'use strict';
const th = require('./template-helper');
+const { sessionNavLinks } = require('@squeep/authentication-module');
+/**
+ * @returns {string} section
+ */
function aboutSection() {
return `
@@ -18,6 +22,10 @@ function aboutSection() {
`;
}
+/**
+ * @param {string} contactHTML content
+ * @returns {string} section
+ */
function contactSection(contactHTML) {
let section = '';
if (contactHTML) {
@@ -30,37 +38,31 @@ ${contactHTML}
/**
*
- * @param {Object} ctx
- * @param {Object} options
- * @param {Object} options.manager
- * @param {String} options.manager.pageTitle
- * @param {String[]} options.manager.footerEntries
- * @param {String} options.adminContactHTML
- * @returns {String}
+ * @param {object} ctx context
+ * @param {object} options options
+ * @param {object} options.manager manager options
+ * @param {string} options.manager.pageTitle page title
+ * @param {string[]} options.manager.footerEntries footer entries
+ * @param {string=} options.adminContactHTML content
+ * @returns {string} page
*/
module.exports = (ctx, options) => {
+ const pagePathLevel = 0;
const contactHTML = options.adminContactHTML;
const htmlOptions = {
+ pageIdentifier: 'root',
pageTitle: options.manager.pageTitle,
logoUrl: options.manager.logoUrl,
footerEntries: options.manager.footerEntries,
- navLinks: [
- {
- text: 'Admin',
- href: 'admin/',
- },
- {
- text: 'Ticket',
- href: 'admin/ticket',
- },
- ],
headElements: [
``,
],
};
+ th.navLinks(pagePathLevel, ctx, htmlOptions);
+ sessionNavLinks(pagePathLevel, ctx, htmlOptions);
const content = [
aboutSection(),
contactSection(contactHTML),
];
- return th.htmlPage(1, ctx, htmlOptions, content);
+ return th.htmlPage(pagePathLevel, ctx, htmlOptions, content);
};
\ No newline at end of file