Fixed volunteer filters.
This commit is contained in:
parent
4c462c9d47
commit
c03498b59e
2 changed files with 9 additions and 5 deletions
|
|
@ -414,7 +414,10 @@
|
|||
<div class="board-assign-row">
|
||||
<select bind:value={assignVolID} style="width:auto">
|
||||
<option value={0}>— Select volunteer —</option>
|
||||
{#each $allVolunteers ?? [] as v}
|
||||
{#each ($allVolunteers ?? [])
|
||||
.filter(v => v.department_id === shift.department_id)
|
||||
.filter(v => !assigned.some(a => a.volunteer.id === v.id))
|
||||
as v}
|
||||
<option value={v.id}>{v.name}</option>
|
||||
{/each}
|
||||
</select>
|
||||
|
|
|
|||
|
|
@ -29,10 +29,11 @@
|
|||
const canConfirm = $derived(['admin', 'staffing', 'colead'].includes(role))
|
||||
const myDeptIDs = $derived(session?.user?.department_ids ?? [])
|
||||
|
||||
// Auto-filter coleads to their department on mount
|
||||
let deptInitialized = $state(false)
|
||||
$effect(() => {
|
||||
if (role === 'colead' && myDeptIDs.length > 0 && !filterDept) {
|
||||
if (!deptInitialized && role === 'colead' && myDeptIDs.length > 0) {
|
||||
filterDept = String(myDeptIDs[0])
|
||||
deptInitialized = true
|
||||
}
|
||||
})
|
||||
|
||||
|
|
@ -228,7 +229,7 @@
|
|||
{/if}
|
||||
<select bind:value={filterStatus} style="width:auto">
|
||||
<option value="">All statuses</option>
|
||||
<option value="unconfirmed">Unconfirmed</option>
|
||||
<option value="unconfirmed">Unregistered</option>
|
||||
<option value="registered">Registered</option>
|
||||
<option value="confirmed">Confirmed</option>
|
||||
<option value="ready">Ready</option>
|
||||
|
|
@ -321,7 +322,7 @@
|
|||
{:else if v.email_confirmed}
|
||||
<span class="badge badge-registered">Registered</span>
|
||||
{:else}
|
||||
<span class="badge badge-unchecked">Unconfirmed</span>
|
||||
<span class="badge badge-unchecked">Unregistered</span>
|
||||
{/if}
|
||||
{#if v.ready_at}
|
||||
<div class="text-muted" style="font-size:0.75rem">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue