Skip to content

Commit

Permalink
feat: copy amandas code (#97)
Browse files Browse the repository at this point in the history
  • Loading branch information
xnought authored Dec 1, 2023
1 parent d597410 commit 3617892
Showing 1 changed file with 38 additions and 1 deletion.
39 changes: 38 additions & 1 deletion frontend/src/routes/upload/+page.svelte
Original file line number Diff line number Diff line change
@@ -1,10 +1,31 @@
<script lang="ts">
import { Backend, UploadError } from "$lib/backend";
import { Fileupload, Button, Input, Label, Helper } from "flowbite-svelte";
import {
Fileupload,
Button,
Input,
Label,
Helper,
Dropdown,
DropdownItem,
} from "flowbite-svelte";
import { ChevronDownSolid } from "flowbite-svelte-icons";
import { goto } from "$app/navigation";
import { formatProteinName, fileToString } from "$lib/format";
import ArticleEditor from "$lib/ArticleEditor.svelte";
type Organism = {
genus: string;
species: string;
};
const organisms: Organism[] = [
{ genus: "Ganaspis", species: "hookeri" },
{ genus: "Leptopilina", species: "boulardi" },
{ genus: "Leptopilina", species: "heterotoma" },
];
let organism: Organism;
let name: string = "";
let content: string = "";
let files: FileList | undefined; // bind:files on the Fileupload
Expand Down Expand Up @@ -35,6 +56,22 @@
{/if}
</div>

<!-- Species dropdown (hardcoded, not hooked up to backend for now) -->
<div>
<Label for="organism-name" class="blcok mb-2">Organism</Label>
<Button>Select Organism<ChevronDownSolid size="xs" class="ml-2" /></Button
>
<Dropdown>
{#each organisms as dropdownOrganism}
<DropdownItem
on:click={() => {
organism = dropdownOrganism;
}}>{dropdownOrganism.genus} {dropdownOrganism.species}</DropdownItem
>
{/each}
</Dropdown>
</div>

<div>
<ArticleEditor bind:content bind:refs />
</div>
Expand Down

0 comments on commit 3617892

Please sign in to comment.