X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=src%2Ftemplate%2Fadmin-ticket-html.js;h=9622aa5acdea1738417d6b5950fbdc4d44d022bc;hb=HEAD;hp=4bb2d0660032b9d23cdde24bfe78443b61fef956;hpb=4b7809255e4d2f07171963aacbe7488e93931da1;p=squeep-indie-auther diff --git a/src/template/admin-ticket-html.js b/src/template/admin-ticket-html.js index 4bb2d06..75d7ce7 100644 --- a/src/template/admin-ticket-html.js +++ b/src/template/admin-ticket-html.js @@ -8,10 +8,20 @@ const th = require('./template-helper'); const { sessionNavLinks } = require('@squeep/authentication-module'); +/** + * + * @param {string} profile profile + * @returns {string} option + */ function renderProfileOption(profile) { return ``; } +/** + * + * @param {string} scope scope + * @returns {string} tr + */ function renderScopeCheckboxTR(scope) { const defaultChecked = ['read']; const checked = defaultChecked.includes(scope) ? ' checked' : ''; @@ -21,6 +31,11 @@ function renderScopeCheckboxTR(scope) { `; } +/** + * + * @param {object} ctx context + * @returns {string} section + */ function mainContent(ctx) { const profileOptions = th.indented(4, (ctx?.profilesScopes?.profiles || []).map((profile) => renderProfileOption(profile))) .join('\n'); @@ -71,15 +86,15 @@ ${scopesCheckboxRows} /** * - * @param {Object} ctx - * @param {Object} ctx.profilesScopes.scopeIndex - * @param {String[]} ctx.profileScopes.profiles - * @param {Object} options - * @param {Object} options.manager - * @param {String} options.manager.pageTitle - * @param {String} options.manager.logoUrl - * @param {String[]} options.manager.footerEntries - * @returns {String} + * @param {object} ctx context + * @param {object} ctx.profilesScopes.scopeIndex scopes structure + * @param {string[]} ctx.profileScopes.profiles profile + * @param {object} options options + * @param {object} options.manager manager options + * @param {string} options.manager.pageTitle page title + * @param {string} options.manager.logoUrl logo url + * @param {string[]} options.manager.footerEntries footer entries + * @returns {string} page */ module.exports = (ctx, options) => { const pagePathLevel = 1;