mathly / mathly2 /static /access.js
3v324v23's picture
Add specifications for exercise tests, grades, learning path, lesson quizzes, readiness meter, real tests, rewards, simulation tests, skill mastery, smart board, student home, and test countdown
a7ffb22
Raw History Blame Contribute Delete
707 Bytes
// "My access": the signed-in account's own roles and what each allows (open to every account).
import { esc } from "./math.js";
import { ROLE_ALLOWS, ROLE_NAMES, visibleRoles } from "./roles.js";
export async function show(me, view) {
const held = visibleRoles(me.roles).filter(role => me.roles.includes(role));
view(`<section class="card" id="my-access"><h2>讛讛专砖讗讜转 砖诇讬</h2>
<p class="muted" dir="ltr">${esc(me.email)}</p>
<ul class="plain">${held.map(role => `<li><b>${ROLE_NAMES[role]}</b><span>${ROLE_ALLOWS[role]}</span></li>`).join("")}</ul>
${me.roles.includes("developer") ? "" : `<p class="muted">转驻拽讬讚 讞讚砖 谞讜转谉 诪谞讛诇 讛讛专砖讗讜转.</p>`}</section>`);
}