chore: code formatting

This commit is contained in:
2024-05-11 23:44:09 +02:00
parent 7caf4a0173
commit b6871c0b1f
7 changed files with 60 additions and 26 deletions

View File

@ -4,8 +4,9 @@
<script>
const g_data = $data;
</script>
<link rel="stylesheet" href="w3.css"></link>
<link rel="stylesheet" href="w3.css" />
<style>
/* TODO: tell prettier to ignore this */
/* 2018 Valiant Poppy */
.w3-theme-l5 {color:#000 !important; background-color:#fbf3f3 !important}
.w3-theme-l4 {color:#000 !important; background-color:#f3d7d6 !important}

View File

@ -42,10 +42,27 @@ window.addEventListener('load', function () {
} else if (description.type === 'textarea') {
return html`
<li class="w3-row">
<label class="w3-quarter" for=${'gs_' + key} style="font-weight: bold">${key}</label>
<label class="w3-quarter" for=${'gs_' + key} style="font-weight: bold"
>${key}</label
>
<div class="w3-rest w3-padding">${description.description}</div>
<textarea class="w3-input" style="vertical-align: top; resize: vertical" id=${'gs_' + key}>${description.value}</textarea>
<button class="w3-button w3-right w3-quarter w3-theme-action" @click=${(e) => global_settings_set(key, e.srcElement.previousElementSibling.value)}>Set</button>
<textarea
class="w3-input"
style="vertical-align: top; resize: vertical"
id=${'gs_' + key}
>
${description.value}</textarea
>
<button
class="w3-button w3-right w3-quarter w3-theme-action"
@click=${(e) =>
global_settings_set(
key,
e.srcElement.previousElementSibling.value
)}
>
Set
</button>
</li>
`;
} else {
@ -61,13 +78,17 @@ window.addEventListener('load', function () {
}
const user_template = (user, permissions) => html`
<li class="w3-card w3-margin">
<button class="w3-button w3-theme-action" @click=${(e) => delete_user(user)}>Delete</button>
<button
class="w3-button w3-theme-action"
@click=${(e) => delete_user(user)}
>
Delete
</button>
${user}: ${permissions.map((x) => permission_template(x))}
</li>
`;
const users_template = (users) =>
html`
<header class="w3-container w3-theme-l2"><h2>Users</h2></header>
html` <header class="w3-container w3-theme-l2"><h2>Users</h2></header>
<ul class="w3-ul">
${Object.entries(users).map((u) => user_template(u[0], u[1]))}
</ul>`;