Finished scanstationmodal (without i18n)

ref #93
This commit is contained in:
Nicolai Ort 2021-03-10 17:16:14 +01:00
parent 9ee768551f
commit 83e782c7c5

View File

@ -48,8 +48,9 @@
ScanStationService.scanStationControllerPost(postdata) ScanStationService.scanStationControllerPost(postdata)
.then((result) => { .then((result) => {
description = ""; description = "";
track = null; track = tracks[0].id;
enabled = true; enabled = true;
modal_open = false;
// //
Toastify({ Toastify({
text: "Scanstation added", text: "Scanstation added",
@ -114,7 +115,8 @@
</h3> </h3>
<div class="mt-2 mb-6"> <div class="mt-2 mb-6">
<p class="text-sm text-gray-500"> <p class="text-sm text-gray-500">
Please provide the required information to create a new scanstation Please provide the required information to create a new
scanstation
</p> </p>
</div> </div>
<div class="grid grid-cols-6 gap-6"> <div class="grid grid-cols-6 gap-6">
@ -127,9 +129,7 @@
bind:value={track} 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"> 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 tracks as t}
<option value={t.id}> <option value={t.id}>{t.name || t.distance}</option>
{t.name || t.distance}
</option>
{/each} {/each}
</select> </select>
</div> </div>
@ -146,19 +146,24 @@
name="description" 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" /> 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" />
</div> </div>
<!-- <div class="col-span-6"> <div class="col-span-6">
<label <label
for="trackname" for="enabled"
class="block text-sm font-medium text-gray-700">{$_('middle-name')}</label> class="ml-1 font-medium text-gray-700">Enabled</label>
<input <br />
autocomplete="off" <p class="text-gray-500">
placeholder={$_('middle-name')} <input
bind:value={middlename_input_value} id="enabled"
bind:this={middlename_input} on:change={() => {
type="text" enabled = !enabled;
name="trackname" }}
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" /> name="enabled"
</div> --> 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}
</p>
</div>
</div> </div>
</div> </div>
</div> </div>