X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=src%2Ftemplate%2Fadmin-html.js;h=f72102f27f8bf09883b930b2eeed054d4f5f6735;hb=f0bf29c75b0fd405ff92fa76f058e61162b87e43;hp=a6a83a0629f3219fc4b7f2ea59965966494f3e33;hpb=726cd980f0ed5588cfe8cbb2d994d5e4aef6e292;p=squeep-indie-auther diff --git a/src/template/admin-html.js b/src/template/admin-html.js index a6a83a0..f72102f 100644 --- a/src/template/admin-html.js +++ b/src/template/admin-html.js @@ -7,51 +7,82 @@ */ const th = require('./template-helper'); +const { sessionNavLinks } = require('@squeep/authentication-module'); +/** + * + * @param {string} profile profile + * @returns {string} li + */ function renderProfileLI(profile) { - return `\t
  • ${profile}
  • `; + return `\t
  • ${profile}
  • `; } +/** + * + * @param {string} profile profile + * @param {string} scope scope + * @param {boolean} selected is selected + * @returns {string} td + */ function renderProfileScopeIndicator(profile, scope, selected) { const checked = selected ? ' checked' : ''; return `\t\t -\t\t\t +\t\t\t \t\t`; } +/** + * + * @param {string} scope scope + * @param {object} details details + * @param {string[]} profiles profiles + * @returns {string} tr + */ function renderScopeRow(scope, details, profiles) { return `\t ${(profiles || []).map((profile) => renderProfileScopeIndicator(profile, scope, details.profiles.includes(profile))).join('\n')} -\t\t