permissions

This commit is contained in:
2023-10-17 22:57:25 +03:00
parent 4b9e9cb4f6
commit 632684f514
29 changed files with 370 additions and 223 deletions
+23 -18
View File
@@ -14,6 +14,7 @@
export let systemFields;
export let sort;
export let inModal;
export let isWritable;
export let selected = [];
function toggleAll(e) {
@@ -44,16 +45,18 @@
<table class="">
<thead class="table-light">
<tr>
<th>
<input
on:change|preventDefault={toggleAll}
indeterminate={selected.length > 0 &&
{#if isWritable}
<th>
<input
on:change|preventDefault={toggleAll}
indeterminate={selected.length > 0 &&
selected.length < records.length}
checked={selected.length == records.length}
class="form-check-input"
type="checkbox"
/>
</th>
checked={selected.length == records.length}
class="form-check-input"
type="checkbox"
/>
</th>
{/if}
{#each visibleColumns as field}
<th
@@ -79,18 +82,20 @@
class="title-td-contents d-inline-flex justify-content-between w-100 align-items-center"
>
<div class="d-flex align-items-center ">
<div class="form-check">
<input
on:change={(e) =>
{#if isWritable}
<div class="form-check">
<input
on:change={(e) =>
selectRecord(e, record)}
class="form-check-input "
type="checkbox"
checked={selected.find(
class="form-check-input "
type="checkbox"
checked={selected.find(
(r) => r.id === record.id
)}
value={record}
/>
</div>
value={record}
/>
</div>
{/if}
<a