diff --git a/src/components/admin/pages/Edit.svelte b/src/components/admin/pages/Edit.svelte index b5a9d12..1f537a9 100644 --- a/src/components/admin/pages/Edit.svelte +++ b/src/components/admin/pages/Edit.svelte @@ -3,11 +3,12 @@ import {ArrowLeftSolid} from "flowbite-svelte-icons"; import {Button, Card, Input, Label, Navbar, NavBrand, NavHamburger, NavUl, Spinner} from "flowbite-svelte"; import {pageRepo} from "../repo/repo.js"; import {mapToMap, nameRegex} from "../util.ts"; -import Editor from "./edit/Editor.svelte"; import TypeAheadSearch from "../components/TypeAheadSearch.svelte"; import {branches} from "../stores/stores.ts"; +import Editor from "./edit/Editor.svelte"; + +$: pagesFuture = $pageRepo.listPages(selectedBranch); -let pagesFuture = $pageRepo.listPages(); let selected: number | null = null; let selectedBranch: string = "master"; @@ -54,6 +55,16 @@ async function deleteBranch() { } } +async function createFile() { + let name = prompt("File name:", "pages/en/[Name]") + if (name) { + await $pageRepo.createFile(`${name}.md`, selectedBranch) + const w = selectedBranch + selectedBranch = "###!" + selectedBranch = w + } +} +