Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: copy amandas code #97

Merged
merged 1 commit into from
Dec 1, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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