-
+
-
-
-
-
-
-
+
diff --git a/src/lib/components/form_editor/question_input_editor/question_base_input.svelte b/src/lib/components/form_editor/question_input_editor/question_base_input.svelte
new file mode 100644
index 0000000..18b2f93
--- /dev/null
+++ b/src/lib/components/form_editor/question_input_editor/question_base_input.svelte
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
+
diff --git a/src/lib/components/form/question_input_editor/question_input_editor.svelte b/src/lib/components/form_editor/question_input_editor/question_input_editor.svelte
similarity index 54%
rename from src/lib/components/form/question_input_editor/question_input_editor.svelte
rename to src/lib/components/form_editor/question_input_editor/question_input_editor.svelte
index 7de09ab..f40e9bf 100644
--- a/src/lib/components/form/question_input_editor/question_input_editor.svelte
+++ b/src/lib/components/form_editor/question_input_editor/question_input_editor.svelte
@@ -5,11 +5,7 @@
// export let value: Question;
-
+
+
+
diff --git a/src/lib/components/form/question_list_editor/add_item.svelte b/src/lib/components/form_editor/question_list_editor/add_item.svelte
similarity index 100%
rename from src/lib/components/form/question_list_editor/add_item.svelte
rename to src/lib/components/form_editor/question_list_editor/add_item.svelte
diff --git a/src/lib/components/form/question_list_editor/delete_item.svelte b/src/lib/components/form_editor/question_list_editor/delete_item.svelte
similarity index 100%
rename from src/lib/components/form/question_list_editor/delete_item.svelte
rename to src/lib/components/form_editor/question_list_editor/delete_item.svelte
diff --git a/src/lib/components/form/question_list_editor/question_list_editor.svelte b/src/lib/components/form_editor/question_list_editor/question_list_editor.svelte
similarity index 68%
rename from src/lib/components/form/question_list_editor/question_list_editor.svelte
rename to src/lib/components/form_editor/question_list_editor/question_list_editor.svelte
index c5f9ff2..c3714d8 100644
--- a/src/lib/components/form/question_list_editor/question_list_editor.svelte
+++ b/src/lib/components/form_editor/question_list_editor/question_list_editor.svelte
@@ -3,26 +3,24 @@
import { QuestionType } from '$lib/form';
import ListInput from '$lib/components/list_input/list_input.svelte';
import QuestionInput from '$lib/components/question_input/question_input.svelte';
- import QuestionInputEditor from '$lib/components/form/question_input_editor/question_input_editor.svelte';
+ import QuestionInputEditor from '$lib/components/form_editor/question_input_editor/question_input_editor.svelte';
import AddItem from './add_item.svelte';
import DeleteItem from './delete_item.svelte';
- export let data: QuestionList;
+ export let value: QuestionList;
import type { ItemProps, Components } from './list_input.ts';
- export let data: ItemProps[] = [];
export let components: Components;
+ export let value: ItemProps[] = [];
function deleteItem(i: number): void {
- data.splice(i, 1);
- // data = [...data];
+ value.splice(i, 1);
}
function addItem(item: ItemProps): void {
- data.push(item);
+ value.push(item);
}
+
+ // TODO: Make sortable items.
- {#each data as item, i}
+ {#each value as item, i}
deleteItem(i)} />
diff --git a/src/lib/components/question_input/question_inputs.svelte b/src/lib/components/question_input/question_inputs.svelte
new file mode 100644
index 0000000..2ff88a0
--- /dev/null
+++ b/src/lib/components/question_input/question_inputs.svelte
@@ -0,0 +1,12 @@
+
+
+{#each data as question (question.name)}
+
+{:else}
+
+{/each}
diff --git a/src/lib/form/form.ts b/src/lib/form/form.ts
index 87db17c..99fc783 100644
--- a/src/lib/form/form.ts
+++ b/src/lib/form/form.ts
@@ -40,35 +40,20 @@ export interface Form {
questions: QuestionList;
/**
- * message is the Discord message that the form is linked to.
+ * discordMessageID is the ID of the Discord message that the form is linked to (if any).
*/
- message?: DiscordMessage;
+ discordMessageID?: ID;
/**
- * schedule is the schedule for the form.
- *
- * If undefined, the form is always open and immediately posted to Discord when created.
+ * discordChannelID is the ID of the Discord channel that the message is in.
*/
- schedule?: FormSchedule;
-
- /**
- * allowsMultipleSubmissions is whether or not the form allows multiple
- * submissions. Defaults to false.
- */
- allowsMultipleSubmissions?: boolean;
+ discordChannelID: ID;
/**
- * anonymized is whether or not the form's submissions are anonymized.
- *
- * Defaults to false.
+ * discordThreadID is the ID of the Discord thread that the message is in.
*/
- anonymized?: boolean;
-}
+ discordThreadID?: ID;
-/**
- * FormSchedule is the schedule for a form.
- */
-export interface FormSchedule {
/**
* startDate is the start time for the form.
*
@@ -87,28 +72,19 @@ export interface FormSchedule {
* timezone is the timezone ID for the form. Defaults to UTC/GMT.
*/
timezone?: string;
-}
-/**
- * DiscordMessage is a Discord message.
- */
-export interface DiscordMessage {
/**
- * id is the ID of the Discord message that the form is linked to (if any).
- */
- id?: ID;
-
- /**
- * channelID is the ID of the Discord channel that the message is in.
+ * allowsMultipleSubmissions is whether or not the form allows multiple
+ * submissions. Defaults to false.
*/
- channelID: ID;
+ allowsMultipleSubmissions?: boolean;
/**
- * threadID is the ID of the Discord thread that the message is in.
+ * anonymized is whether or not the form's submissions are anonymized.
+ *
+ * Defaults to false.
*/
- threadID?: ID;
-
- // TODO: Add guild ID to target specific guild.
+ anonymized?: boolean;
}
/**
diff --git a/src/routes/forms/[form_id]/+page.svelte b/src/routes/forms/[form_id]/+page.svelte
index fe5d2b0..29cd523 100644
--- a/src/routes/forms/[form_id]/+page.svelte
+++ b/src/routes/forms/[form_id]/+page.svelte
@@ -1,13 +1,13 @@
{#if data.form}
-
+
{:else}