Add a check to the datasets page to not display an empty page if there are no datasets
This commit is contained in:
parent
e8d784abb2
commit
c89f2f1c19
1 changed files with 18 additions and 6 deletions
|
|
@ -4,11 +4,23 @@
|
|||
let { data }: PageProps = $props();
|
||||
</script>
|
||||
|
||||
<ul>
|
||||
<svelte:head>
|
||||
<title>List of datasets</title>
|
||||
</svelte:head>
|
||||
|
||||
{#if data.datasets.length}
|
||||
{#each data.datasets as dataset}
|
||||
<li>
|
||||
<strong>{dataset.name}</strong><br />
|
||||
{dataset.description}
|
||||
</li>
|
||||
<nav>
|
||||
<ul>
|
||||
<li>
|
||||
<a href="datasets/{dataset.id}"><strong>{dataset.name}</strong></a><br
|
||||
/>
|
||||
{dataset.description}
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
{/each}
|
||||
</ul>
|
||||
{:else}
|
||||
<h1>No datasets yet!</h1>
|
||||
<p>Try adding a dataset through the backend.</p>
|
||||
{/if}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue