display checkbox conditionally

This commit is contained in:
maxDorninger
2025-06-22 15:15:50 +02:00
parent ca8a102277
commit 529b578b0b
4 changed files with 22 additions and 13 deletions

View File

@@ -104,6 +104,8 @@ export interface Show {
seasons: Season[]; // items: { $ref: #/components/schemas/Season }, type: array
id: string; // type: string, format: uuid
continuous_download: boolean;
ended: boolean;
}
export interface PublicShow {
@@ -115,6 +117,7 @@ export interface PublicShow {
seasons: PublicSeason[]; // items: { $ref: #/components/schemas/Season }, type: array
id: string; // type: string, format: uuid
continuous_download: boolean;
ended: boolean;
}

View File

@@ -94,20 +94,22 @@
class="w-full md:w-1/3 flex-auto rounded-xl bg-muted/50 p-4"
>
{#if user().is_superuser}
<div class="my-2 mx-1 block">
<Checkbox
checked={show().continuous_download}
onCheckedChange={() => {
{#if !show().ended}
<div class="my-2 mx-1 block">
<Checkbox
checked={show().continuous_download}
onCheckedChange={() => {
toggle_continuous_download()
}}
id="continuous-download-checkbox"
id="continuous-download-checkbox"
/>
<Label for="continuous-download-checkbox">
Enable automatic download of future seasons
</Label>
<hr>
</div>
/>
<Label for="continuous-download-checkbox">
Enable automatic download of future seasons
</Label>
<hr>
</div>
{/if}
<DownloadSeasonDialog show={show()}/>
{/if}
<RequestSeasonDialog show={show()}/>