mirror of
https://github.com/jakobkordez/ham-reserve.git
synced 2025-05-16 00:30:28 +00:00
Change reservations table
This commit is contained in:
parent
b88573d48d
commit
7458b01116
@ -1,18 +1,16 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import type { Reservation } from '$lib/interfaces/reservation.interface';
|
import type { Reservation } from '$lib/interfaces/reservation.interface';
|
||||||
|
import { createTimeState } from '$lib/stores/time-state.svelte';
|
||||||
import { getUTCDateString, getUTCTimeString } from '$lib/util/date.util';
|
import { getUTCDateString, getUTCTimeString } from '$lib/util/date.util';
|
||||||
import {
|
import { faCaretLeft, faCaretRight } from '@fortawesome/free-solid-svg-icons';
|
||||||
faCaretLeft,
|
|
||||||
faCaretRight,
|
|
||||||
faFileCircleCheck,
|
|
||||||
faFileCircleExclamation
|
|
||||||
} from '@fortawesome/free-solid-svg-icons';
|
|
||||||
import Fa from 'svelte-fa';
|
import Fa from 'svelte-fa';
|
||||||
|
|
||||||
let { reservations, pageSize = 5 }: { reservations: Reservation[]; pageSize: number } = $props();
|
let { reservations, pageSize = 5 }: { reservations: Reservation[]; pageSize: number } = $props();
|
||||||
|
|
||||||
let page = $state(0);
|
let page = $state(0);
|
||||||
|
|
||||||
|
const now = createTimeState(10_000);
|
||||||
|
|
||||||
function formatDateTime(r: Reservation) {
|
function formatDateTime(r: Reservation) {
|
||||||
const d = getUTCDateString;
|
const d = getUTCDateString;
|
||||||
const t = getUTCTimeString;
|
const t = getUTCTimeString;
|
||||||
@ -28,8 +26,7 @@
|
|||||||
<col />
|
<col />
|
||||||
<col />
|
<col />
|
||||||
<col />
|
<col />
|
||||||
<col />
|
<col width="0" />
|
||||||
<col />
|
|
||||||
</colgroup>
|
</colgroup>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
@ -51,16 +48,25 @@
|
|||||||
<td>
|
<td>
|
||||||
{reservation.modes.join(', ')}
|
{reservation.modes.join(', ')}
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<!-- <td>
|
||||||
{#if reservation.startDateTime < new Date()}
|
{#if reservation.startDateTime < new Date()}
|
||||||
<Fa
|
<Fa
|
||||||
icon={reservation.logSummary ? faFileCircleCheck : faFileCircleExclamation}
|
icon={reservation.logSummary ? faFileCircleCheck : faFileCircleExclamation}
|
||||||
class="h-5 w-5 {reservation.logSummary ? 'text-green-400' : 'text-orange-300'}"
|
class="h-5 w-5 {reservation.logSummary ? 'text-green-400' : 'text-orange-300'}"
|
||||||
/>
|
/>
|
||||||
{/if}
|
{/if}
|
||||||
</td>
|
</td> -->
|
||||||
<td>
|
<td>
|
||||||
<a href="/reservation/{reservation._id}" class="btn btn-sm">Več</a>
|
<a
|
||||||
|
href="/reservation/{reservation._id}"
|
||||||
|
class="btn btn-sm border-2 {reservation.startDateTime < now.time
|
||||||
|
? reservation.logSummary
|
||||||
|
? 'border-green-400'
|
||||||
|
: 'btn-warning'
|
||||||
|
: ''}"
|
||||||
|
>
|
||||||
|
Več
|
||||||
|
</a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{/each}
|
{/each}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user