X-Git-Url: http://git.squeep.com/?p=squeep-indie-auther;a=blobdiff_plain;f=src%2Ftemplate%2Fadmin-html.js;fp=src%2Ftemplate%2Fadmin-html.js;h=085b95a0ed083eaf4fafa4c131a0496664d37f93;hp=0000000000000000000000000000000000000000;hb=b0103b0d496262c438b40bc20304081dbfe41e73;hpb=8ed81748bce7cea7904cac7225b20a60cafdfc16 diff --git a/src/template/admin-html.js b/src/template/admin-html.js new file mode 100644 index 0000000..085b95a --- /dev/null +++ b/src/template/admin-html.js @@ -0,0 +1,214 @@ +'use strict'; + +/** + * This renders the administrative view for an account, + * allowing for adding profile URIs, custom scope bundles, + * and management of issued tokens. + */ + +const th = require('./template-helper'); + + +function renderProfileLI(profile) { + return `\t
  • ${profile}
  • `; +} + + +function renderProfileScopeIndicator(profile, scope, selected) { + const checked = selected ? ' checked' : ''; + return `\t\t +\t\t\t +\t\t`; +} + +function renderScopeRow(scope, details, profiles) { + return `\t +${(profiles || []).map((profile) => renderProfileScopeIndicator(profile, scope, details.profiles.includes(profile))).join('\n')} +\t\t