first merge to main 🚀 #71
@ -1,83 +1,165 @@
|
|||||||
<script>
|
<script>
|
||||||
|
import { RunnerOrganisationService } from "@odit/lfk-client-js";
|
||||||
|
import { _ } from "svelte-i18n";
|
||||||
|
import store from "../store";
|
||||||
|
import PromiseError from "./PromiseError.svelte";
|
||||||
|
$: delete_triggered = false;
|
||||||
|
$: save_enabled = false;
|
||||||
export let params;
|
export let params;
|
||||||
|
console.log(params);
|
||||||
|
let data_original = {};
|
||||||
|
$: data_loaded = false;
|
||||||
|
const promise = RunnerOrganisationService.runnerOrganisationControllerGetOne(
|
||||||
|
params.orgid
|
||||||
|
).then((value) => {
|
||||||
|
data_loaded = true;
|
||||||
|
data_original = Object.assign(data_original, value);
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<section class="container p-5">
|
{#if data_loaded}
|
||||||
<span class="mb-1 text-3xl font-extrabold leading-tight">
|
<section class="container p-5">
|
||||||
Orgs
|
<div class="mb-8 text-3xl font-extrabold leading-tight">
|
||||||
</span>
|
{data_original.name}
|
||||||
<p class="mb-8 text-lg text-gray-500">
|
<span data-id="org_actions_${data_original.id}">
|
||||||
configure the tracks & minimum lap times
|
{#if store.state.jwtinfo.userdetails.permissions.includes('USER:DELETE')}
|
||||||
</p>
|
{#if delete_triggered}
|
||||||
<div class="flex flex-row mb-4">
|
<button
|
||||||
<div class="w-full">
|
class="w-full justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-red-600 text-base font-medium text-white hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:ml-3 sm:w-auto sm:text-sm">{$_('confirm-delete')}</button>
|
||||||
<nav class="w-full flex">
|
<button
|
||||||
<ol class="list-none flex flex-row items-center justify-start">
|
on:click={() => {
|
||||||
<li class="mr-2 flex items-center">
|
delete_triggered = !delete_triggered;
|
||||||
<svg
|
}}
|
||||||
stroke="currentColor"
|
class="w-full justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-blue-400 text-base font-medium text-white sm:w-auto sm:text-sm">{$_('cancel')}</button>
|
||||||
fill="none"
|
{/if}
|
||||||
stroke-width="2"
|
{#if !delete_triggered}
|
||||||
viewBox="0 0 24 24"
|
<button
|
||||||
stroke-linecap="round"
|
on:click={() => {
|
||||||
stroke-linejoin="round"
|
delete_triggered = true;
|
||||||
class="h-3 w-3 stroke-current"
|
}}
|
||||||
height="1em"
|
type="button"
|
||||||
width="1em"
|
class="w-full justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-red-600 text-base font-medium text-white hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:ml-3 sm:w-auto sm:text-sm">{$_('delete-user')}</button>
|
||||||
xmlns="http://www.w3.org/2000/svg"><path
|
{/if}
|
||||||
d="M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z" />
|
{/if}
|
||||||
<polyline points="9 22 9 12 15 12 15 22" /></svg>
|
{#if !delete_triggered}
|
||||||
</li>
|
<button
|
||||||
<li class="flex items-center">
|
disabled={!save_enabled}
|
||||||
<a class="mr-2" href="/">Home</a><svg
|
class:opacity-50={!save_enabled}
|
||||||
stroke="currentColor"
|
type="button"
|
||||||
fill="none"
|
class="w-full justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-blue-600 text-base font-medium text-white hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 sm:ml-3 sm:w-auto sm:text-sm">{$_('save-changes')}</button>
|
||||||
stroke-width="2"
|
{/if}
|
||||||
viewBox="0 0 24 24"
|
</span>
|
||||||
stroke-linecap="round"
|
|
||||||
stroke-linejoin="round"
|
|
||||||
class="h-3 w-3 mr-2 stroke-current"
|
|
||||||
height="1em"
|
|
||||||
width="1em"
|
|
||||||
xmlns="http://www.w3.org/2000/svg"><line
|
|
||||||
x1="5"
|
|
||||||
y1="12"
|
|
||||||
x2="19"
|
|
||||||
y2="12" />
|
|
||||||
<polyline points="12 5 19 12 12 19" /></svg>
|
|
||||||
</li>
|
|
||||||
<li class="mr-2 flex items-center">
|
|
||||||
<svg
|
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
|
||||||
viewBox="0 0 24 24"
|
|
||||||
width="24"
|
|
||||||
height="24"><path fill="none" d="M0 0h24v24H0z" />
|
|
||||||
<path
|
|
||||||
d="M21 20h2v2H1v-2h2V3a1 1 0 0 1 1-1h16a1 1 0 0 1 1 1v17zm-2 0V4H5v16h14zM8 11h3v2H8v-2zm0-4h3v2H8V7zm0 8h3v2H8v-2zm5 0h3v2h-3v-2zm0-4h3v2h-3v-2zm0-4h3v2h-3V7z" /></svg>
|
|
||||||
</li>
|
|
||||||
<li class="flex items-center">
|
|
||||||
<a class="mr-2" href="./">Orgs</a><svg
|
|
||||||
stroke="currentColor"
|
|
||||||
fill="none"
|
|
||||||
stroke-width="2"
|
|
||||||
viewBox="0 0 24 24"
|
|
||||||
stroke-linecap="round"
|
|
||||||
stroke-linejoin="round"
|
|
||||||
class="h-3 w-3 mr-2 stroke-current"
|
|
||||||
height="1em"
|
|
||||||
width="1em"
|
|
||||||
xmlns="http://www.w3.org/2000/svg"><line
|
|
||||||
x1="5"
|
|
||||||
y1="12"
|
|
||||||
x2="19"
|
|
||||||
y2="12" />
|
|
||||||
<polyline points="12 5 19 12 12 19" /></svg>
|
|
||||||
</li>
|
|
||||||
<li class="flex items-center">
|
|
||||||
<span class="mr-2">Org-Details #{params.orgid}</span>
|
|
||||||
</li>
|
|
||||||
</ol>
|
|
||||||
</nav>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div class="flex flex-row mb-4">
|
||||||
</section>
|
<div class="w-full">
|
||||||
|
<nav class="w-full flex">
|
||||||
|
<ol class="list-none flex flex-row items-center justify-start">
|
||||||
|
<li class="mr-2 flex items-center">
|
||||||
|
<svg
|
||||||
|
stroke="currentColor"
|
||||||
|
fill="none"
|
||||||
|
stroke-width="2"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
stroke-linecap="round"
|
||||||
|
stroke-linejoin="round"
|
||||||
|
class="h-3 w-3 stroke-current"
|
||||||
|
height="1em"
|
||||||
|
width="1em"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"><path
|
||||||
|
d="M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z" />
|
||||||
|
<polyline points="9 22 9 12 15 12 15 22" /></svg>
|
||||||
|
</li>
|
||||||
|
<li class="flex items-center">
|
||||||
|
<a class="mr-2" href="/">Home</a><svg
|
||||||
|
stroke="currentColor"
|
||||||
|
fill="none"
|
||||||
|
stroke-width="2"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
stroke-linecap="round"
|
||||||
|
stroke-linejoin="round"
|
||||||
|
class="h-3 w-3 mr-2 stroke-current"
|
||||||
|
height="1em"
|
||||||
|
width="1em"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"><line
|
||||||
|
x1="5"
|
||||||
|
y1="12"
|
||||||
|
x2="19"
|
||||||
|
y2="12" />
|
||||||
|
<polyline points="12 5 19 12 12 19" /></svg>
|
||||||
|
</li>
|
||||||
|
<li class="mr-2 flex items-center">
|
||||||
|
<svg
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
width="24"
|
||||||
|
height="24"><path fill="none" d="M0 0h24v24H0z" />
|
||||||
|
<path
|
||||||
|
d="M21 20h2v2H1v-2h2V3a1 1 0 0 1 1-1h16a1 1 0 0 1 1 1v17zm-2 0V4H5v16h14zM8 11h3v2H8v-2zm0-4h3v2H8V7zm0 8h3v2H8v-2zm5 0h3v2h-3v-2zm0-4h3v2h-3v-2zm0-4h3v2h-3V7z" /></svg>
|
||||||
|
</li>
|
||||||
|
<li class="flex items-center">
|
||||||
|
<a class="mr-2" href="./">Orgs</a><svg
|
||||||
|
stroke="currentColor"
|
||||||
|
fill="none"
|
||||||
|
stroke-width="2"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
stroke-linecap="round"
|
||||||
|
stroke-linejoin="round"
|
||||||
|
class="h-3 w-3 mr-2 stroke-current"
|
||||||
|
height="1em"
|
||||||
|
width="1em"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"><line
|
||||||
|
x1="5"
|
||||||
|
y1="12"
|
||||||
|
x2="19"
|
||||||
|
y2="12" />
|
||||||
|
<polyline points="12 5 19 12 12 19" /></svg>
|
||||||
|
</li>
|
||||||
|
<li class="flex items-center">
|
||||||
|
<span class="mr-2">Org-Details #{params.orgid}</span>
|
||||||
|
</li>
|
||||||
|
</ol>
|
||||||
|
</nav>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="text-sm w-full">
|
||||||
|
<label for="name" class="font-medium text-gray-700">Name</label>
|
||||||
|
<input
|
||||||
|
autocomplete="off"
|
||||||
|
placeholder="Name"
|
||||||
|
type="text"
|
||||||
|
bind:value={data_original.name}
|
||||||
|
name="name"
|
||||||
|
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 dark:bg-gray-900 dark:text-gray-100 rounded-md p-2" />
|
||||||
|
</div>
|
||||||
|
<div class="text-sm w-full">
|
||||||
|
<label
|
||||||
|
for="contact"
|
||||||
|
class="font-medium text-gray-700">{$_('contact')}</label>
|
||||||
|
<input
|
||||||
|
autocomplete="off"
|
||||||
|
placeholder={$_('contact')}
|
||||||
|
type="text"
|
||||||
|
bind:value={data_original.contact}
|
||||||
|
name="contact"
|
||||||
|
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 dark:bg-gray-900 dark:text-gray-100 rounded-md p-2" />
|
||||||
|
</div>
|
||||||
|
<div class="text-sm w-full">
|
||||||
|
<label
|
||||||
|
for="address"
|
||||||
|
class="font-medium text-gray-700">{$_('address')}</label>
|
||||||
|
<input
|
||||||
|
autocomplete="off"
|
||||||
|
placeholder={$_('address')}
|
||||||
|
type="text"
|
||||||
|
bind:value={data_original.address}
|
||||||
|
name="address"
|
||||||
|
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 dark:bg-gray-900 dark:text-gray-100 rounded-md p-2" />
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
{:else}
|
||||||
|
{#await promise}
|
||||||
|
organization detail is being loaded...
|
||||||
|
{:catch error}
|
||||||
|
<PromiseError />
|
||||||
|
{/await}
|
||||||
|
{/if}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<script>
|
<script>
|
||||||
import { _ } from "svelte-i18n";
|
import { _ } from "svelte-i18n";
|
||||||
import { UserService, RunnerOrganisationService } from "@odit/lfk-client-js";
|
import { RunnerOrganisationService } from "@odit/lfk-client-js";
|
||||||
import "gridjs/dist/theme/mermaid.css";
|
import "gridjs/dist/theme/mermaid.css";
|
||||||
import store from "../store";
|
import store from "../store";
|
||||||
import OrgsEmptyState from "./OrgsEmptyState.svelte";
|
import OrgsEmptyState from "./OrgsEmptyState.svelte";
|
||||||
|
@ -125,5 +125,7 @@
|
|||||||
"welcome_wavinghand": "Welcome 👋",
|
"welcome_wavinghand": "Welcome 👋",
|
||||||
"your_profile": "Your Profile",
|
"your_profile": "Your Profile",
|
||||||
"organizations": "Organizations",
|
"organizations": "Organizations",
|
||||||
"create-organization": "Create Organization"
|
"create-organization": "Create Organization",
|
||||||
|
"contact": "Contact",
|
||||||
|
"address": "Address"
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user