diff --git a/ui/src/lib/TablePagination.svelte b/ui/src/lib/TablePagination.svelte new file mode 100644 index 0000000..6d336ce --- /dev/null +++ b/ui/src/lib/TablePagination.svelte @@ -0,0 +1,72 @@ + + + +
+ + + {page_number} von {max_page_number} + + +
\ No newline at end of file diff --git a/ui/src/lib/Views.svelte b/ui/src/lib/Views.svelte index 038a7f7..d20a899 100644 --- a/ui/src/lib/Views.svelte +++ b/ui/src/lib/Views.svelte @@ -1,16 +1,16 @@ - {params.title} + {title}
-

{params.title}

+

{title}

{#if isLoading === true} @@ -49,7 +49,7 @@ - {#each records as record} + {#each actual_records as record} {record.period} {record.workingDays} @@ -59,6 +59,13 @@ {/each} + + + + + + + {/if}
diff --git a/ui/src/routes/views/monthly/+page.svelte b/ui/src/routes/views/monthly/+page.svelte index f542f37..b67d645 100644 --- a/ui/src/routes/views/monthly/+page.svelte +++ b/ui/src/routes/views/monthly/+page.svelte @@ -3,5 +3,5 @@ let { data } = $props(); - + diff --git a/ui/src/routes/views/weekly/+page.svelte b/ui/src/routes/views/weekly/+page.svelte index f542f37..b67d645 100644 --- a/ui/src/routes/views/weekly/+page.svelte +++ b/ui/src/routes/views/weekly/+page.svelte @@ -3,5 +3,5 @@ let { data } = $props(); - + diff --git a/ui/src/routes/views/yearly/+page.svelte b/ui/src/routes/views/yearly/+page.svelte index f542f37..b67d645 100644 --- a/ui/src/routes/views/yearly/+page.svelte +++ b/ui/src/routes/views/yearly/+page.svelte @@ -3,5 +3,5 @@ let { data } = $props(); - + diff --git a/ui/src/routes/working-hours/+page.svelte b/ui/src/routes/working-hours/+page.svelte index 979449f..1788ea2 100644 --- a/ui/src/routes/working-hours/+page.svelte +++ b/ui/src/routes/working-hours/+page.svelte @@ -2,10 +2,13 @@ import documentIcon from "@iconify-icons/oi/document.js"; import wrenchIcon from "@iconify-icons/oi/wrench.js"; import IconifyIcon from "@iconify/svelte"; + import TablePagination from "$lib/TablePagination.svelte"; let { data } = $props(); const TITLE = "Bearbeitung Einträge" /** @type {{workingDay: String, workingTime: String, isHomeOffice: Boolean, }[]|null} **/ - let records = $state([]) + let records = $state(null) + /** @type {{workingDay: String, workingTime: String, isHomeOffice: Boolean, }[]} **/ + let actual_records = $state([]) const init = async () => await data.promise.then( /** * @param {{workingDay: String, workingTime: String, isHomeOffice: Boolean, }[]} data @@ -58,7 +61,7 @@ - {#each records as record} + {#each actual_records as record} {record.workingDay} {record.workingTime} @@ -71,6 +74,13 @@ {/each} + + + + + + + {/if}