Notifications page: one list of toggles, without group headings
This commit is contained in:
parent
a6960c25a2
commit
5863639e1a
3 changed files with 15 additions and 25 deletions
|
|
@ -569,7 +569,6 @@ async function notifications() {
|
|||
else device = row("This device", "Turn notifications on to get the ones picked below here, even with the panel closed.", '<button class="btn primary" type="button" data-act="notif-on">Turn on</button>');
|
||||
|
||||
const dis = d.available ? "" : "disabled";
|
||||
const groups = [...new Set(d.types.map((t) => t.group))];
|
||||
v.innerHTML = `
|
||||
<div class="page-head">
|
||||
<div><h1>Notifications</h1><p class="sub">Get bans, gags, mutes and server alerts on your phone or computer. Nothing about your own actions is sent to you.</p></div>
|
||||
|
|
@ -589,11 +588,10 @@ async function notifications() {
|
|||
|
||||
<section class="panel">
|
||||
<div class="panel-head"><div><h2>What to send</h2><p>For all your devices.</p></div></div>
|
||||
${groups.map((g) => `<div class="notif-group">${esc(g)}</div>
|
||||
${d.types.filter((t) => t.group === g).map((t) => row(esc(t.label), t.help ? esc(t.help) : "",
|
||||
t.ready
|
||||
? `<button class="switch" type="button" role="switch" aria-checked="${p.types.includes(t.key)}" aria-label="${esc(t.label)}" data-ntype="${esc(t.key)}" ${dis}></button>`
|
||||
: `<span class="tag">Coming later</span><button class="switch" type="button" role="switch" aria-checked="false" aria-label="${esc(t.label)}" disabled></button>`)).join("")}`).join("")}
|
||||
${d.types.map((t) => row(esc(t.label), t.help ? esc(t.help) : "",
|
||||
t.ready
|
||||
? `<button class="switch" type="button" role="switch" aria-checked="${p.types.includes(t.key)}" aria-label="${esc(t.label)}" data-ntype="${esc(t.key)}" ${dis}></button>`
|
||||
: `<span class="tag">Coming later</span><button class="switch" type="button" role="switch" aria-checked="false" aria-label="${esc(t.label)}" disabled></button>`)).join("")}
|
||||
</section>
|
||||
</div>`;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue