frontend: add more values to page_data and bind them

This commit is contained in:
OleSTEEP 2025-10-16 19:06:20 +03:00
parent b11333b7c6
commit 6a4e10819c
2 changed files with 16 additions and 10 deletions

View file

@ -2,7 +2,7 @@
import Mark from "../mark.svelte"; import Mark from "../mark.svelte";
import AddButton from "../add_button.svelte"; import AddButton from "../add_button.svelte";
let { value = $bindable([]), label = "" } = $props(); let { value = $bindable([]), label } = $props();
let items: string[] = $state([]); let items: string[] = $state([]);
$effect(() => {value = items}); $effect(() => {value = items});

View file

@ -1,4 +1,4 @@
<script> <script lang="ts">
import favicon from '$lib/assets/favicon.svg'; import favicon from '$lib/assets/favicon.svg';
import Authors from '$lib/components/authors.svelte'; import Authors from '$lib/components/authors.svelte';
@ -14,12 +14,18 @@
let { children } = $props(); let { children } = $props();
let page_data = $state({ let page_data = $state({
title: "", cover: null,
description: "", title: "", // DONE
hours_to_read: 0, description: "", // DONE
genres: [], author_id: 0,
tags: [], hours_to_read: 0, // DONE
badges: [] genres: [], // DONE
tags: [], // DONE
badges: [], // DONE
screenshots: [],
pub_date: null,
pub_time: null,
files: []
}); });
</script> </script>
@ -60,7 +66,7 @@
<MarksContainer label="Баджи" bind:value={page_data["badges"]}/> <MarksContainer label="Баджи" bind:value={page_data["badges"]}/>
<p>Скриншоты</p> <p>Скриншоты</p>
<ImageContainer /> <ImageContainer bind:value={page_data["screenshots"]}/>
<!-- Календарь с датой --> <!-- Календарь с датой -->
<p>Дата публикации</p> <p>Дата публикации</p>
@ -69,7 +75,7 @@
<!-- Время публикации --> <!-- Время публикации -->
<div class="horisontal-bar"> <div class="horisontal-bar">
<p>Время публикации</p> <p>Время публикации</p>
<input class="input rounded" type="time"> <input class="input rounded" type="time" bind:value={page_data["pub_time"]}>
</div> </div>
<!-- Файлы --> <!-- Файлы -->