X-Git-Url: https://git.squeep.com/?a=blobdiff_plain;f=src%2Ftemplate%2Fadmin-ticket-html.js;h=75d7ce7f7475e957f2e8020d2943c476c130878a;hb=refs%2Fheads%2Fmaster;hp=a0475adc09122d0f9f29dd2b5629b5cc6bc612d5;hpb=52aff9fa0269a628c115f58f0f62faff3f8fc4a4;p=squeep-indie-auther diff --git a/src/template/admin-ticket-html.js b/src/template/admin-ticket-html.js index a0475ad..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,20 +86,20 @@ ${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; const htmlOptions = { - padeIdentifier: 'ticketProffer', + pageIdentifier: 'ticketProffer', pageTitle: options.manager.pageTitle + ' - Ticket Proffer', logoUrl: options.manager.logoUrl, footerEntries: options.manager.footerEntries,