From 83e782c7c567d3747eb4e0a4313f6e7de6f2355f Mon Sep 17 00:00:00 2001 From: Nicolai Ort Date: Wed, 10 Mar 2021 17:16:14 +0100 Subject: [PATCH] Finished scanstationmodal (without i18n) ref #93 --- .../scanstations/AddScanStationModal.svelte | 39 +++++++++++-------- 1 file changed, 22 insertions(+), 17 deletions(-) diff --git a/src/components/scanstations/AddScanStationModal.svelte b/src/components/scanstations/AddScanStationModal.svelte index 3b628584..f340388a 100644 --- a/src/components/scanstations/AddScanStationModal.svelte +++ b/src/components/scanstations/AddScanStationModal.svelte @@ -48,8 +48,9 @@ ScanStationService.scanStationControllerPost(postdata) .then((result) => { description = ""; - track = null; + track = tracks[0].id; enabled = true; + modal_open = false; // Toastify({ text: "Scanstation added", @@ -114,7 +115,8 @@

- Please provide the required information to create a new scanstation + Please provide the required information to create a new + scanstation

@@ -127,9 +129,7 @@ bind:value={track} class="mt-1 focus:ring-indigo-500 focus:border-indigo-500 block w-full shadow-sm rounded-l-md sm:text-sm border-gray-300 border bg-gray-50 text-gray-500 rounded-md p-2"> {#each tracks as t} - + {/each}
@@ -146,19 +146,24 @@ name="description" class="mt-1 focus:ring-indigo-500 focus:border-indigo-500 block w-full shadow-sm rounded-l-md sm:text-sm border-gray-300 border bg-gray-50 text-gray-500 rounded-md p-2" /> - + for="enabled" + class="ml-1 font-medium text-gray-700">Enabled +
+

+ { + enabled = !enabled; + }} + name="enabled" + type="checkbox" + checked={enabled} + class="focus:ring-indigo-500 h-4 w-4 text-indigo-600 border-gray-300 rounded" /> + This scanstation is {#if enabled}enabled{:else}disabled{/if} +

+