X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=src%2Ftemplate%2Fadmin-html.js;h=f72102f27f8bf09883b930b2eeed054d4f5f6735;hb=f0bf29c75b0fd405ff92fa76f058e61162b87e43;hp=4fee8e74298e9de7fc22713f700060f1f87d2a9d;hpb=fba42a499fe1af051b0982c1f3e8b3873c9ed2fb;p=squeep-indie-auther diff --git a/src/template/admin-html.js b/src/template/admin-html.js index 4fee8e7..f72102f 100644 --- a/src/template/admin-html.js +++ b/src/template/admin-html.js @@ -10,49 +10,79 @@ 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