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 AddButton from "../add_button.svelte";
let { value = $bindable([]), label = "" } = $props();
let { value = $bindable([]), label } = $props();
let items: string[] = $state([]);
$effect(() => {value = items});

View file

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