Compare commits
6
Commits
1.8.1
...
fecf3b59a3
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fecf3b59a3
|
||
|
|
18a4623e71
|
||
|
|
968a7ccc0e
|
||
|
|
6249502a88
|
||
|
|
8a78034079
|
||
|
|
7633b7b056
|
@@ -2,8 +2,16 @@
|
|||||||
|
|
||||||
All notable changes to this project will be documented in this file. Dates are displayed in UTC.
|
All notable changes to this project will be documented in this file. Dates are displayed in UTC.
|
||||||
|
|
||||||
|
#### [1.8.2](https://git.odit.services/lfk/frontend/compare/1.8.1...1.8.2)
|
||||||
|
|
||||||
|
- feat: improvement of card,certificate,sponsoringcontract action buttons [`7633b7b`](https://git.odit.services/lfk/frontend/commit/7633b7b05671342bc30e0bbecbcd9450e06b5e4d)
|
||||||
|
- feat(dashboard): active item for teams + runners [`8a78034`](https://git.odit.services/lfk/frontend/commit/8a780340792445fff1f78db994fb78acb5da8304)
|
||||||
|
|
||||||
#### [1.8.1](https://git.odit.services/lfk/frontend/compare/1.8.0...1.8.1)
|
#### [1.8.1](https://git.odit.services/lfk/frontend/compare/1.8.0...1.8.1)
|
||||||
|
|
||||||
|
> 26 March 2025
|
||||||
|
|
||||||
|
- 🚀RELEASE v1.8.1 [`b8e6b24`](https://git.odit.services/lfk/frontend/commit/b8e6b24bf32379c3f4a1679d422e6fdcc45f7c99)
|
||||||
- fix(pdf_generation): Only load direct runners for direct calls [`97b7ca9`](https://git.odit.services/lfk/frontend/commit/97b7ca931f607ee64509ad10c2269632fc691091)
|
- fix(pdf_generation): Only load direct runners for direct calls [`97b7ca9`](https://git.odit.services/lfk/frontend/commit/97b7ca931f607ee64509ad10c2269632fc691091)
|
||||||
|
|
||||||
#### [1.8.0](https://git.odit.services/lfk/frontend/compare/1.7.0...1.8.0)
|
#### [1.8.0](https://git.odit.services/lfk/frontend/compare/1.7.0...1.8.0)
|
||||||
|
|||||||
+1
-1
@@ -13,7 +13,7 @@
|
|||||||
|
|
||||||
<body>
|
<body>
|
||||||
<span style="display: none; visibility: hidden" id="buildinfo"
|
<span style="display: none; visibility: hidden" id="buildinfo"
|
||||||
>RELEASE_INFO-1.8.1-RELEASE_INFO</span
|
>RELEASE_INFO-1.8.2-RELEASE_INFO</span
|
||||||
>
|
>
|
||||||
<noscript>You need to enable JavaScript to run this app.</noscript>
|
<noscript>You need to enable JavaScript to run this app.</noscript>
|
||||||
<script src="/env.js"></script>
|
<script src="/env.js"></script>
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@odit/lfk-frontend",
|
"name": "@odit/lfk-frontend",
|
||||||
"version": "1.8.1",
|
"version": "1.8.2",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"i18n-order": "node order.js",
|
"i18n-order": "node order.js",
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
modal_open = true;
|
modal_open = true;
|
||||||
}}
|
}}
|
||||||
type="button"
|
type="button"
|
||||||
class="w-full inline-flex 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:w-auto sm:text-sm mt-1 sm:mt-0"
|
class="w-full inline-flex 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:w-auto sm:text-sm mb-1 lg:mb-0"
|
||||||
>
|
>
|
||||||
{$_("add-card")}
|
{$_("add-card")}
|
||||||
</button>
|
</button>
|
||||||
@@ -29,7 +29,7 @@
|
|||||||
bulk_modal_open = true;
|
bulk_modal_open = true;
|
||||||
}}
|
}}
|
||||||
type="button"
|
type="button"
|
||||||
class="w-full inline-flex 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:w-auto sm:text-sm mt-1 sm:mt-0"
|
class="w-full inline-flex 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:w-auto sm:text-sm mb-1 lg:mb-0"
|
||||||
>
|
>
|
||||||
{$_("create-bulk-cards")}
|
{$_("create-bulk-cards")}
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
@@ -162,7 +162,7 @@
|
|||||||
class:opacity-50={!save_enabled}
|
class:opacity-50={!save_enabled}
|
||||||
type="button"
|
type="button"
|
||||||
on:click={submit}
|
on:click={submit}
|
||||||
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:w-auto sm:text-sm"
|
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:w-auto sm:text-sm mb-1 lg:mb-0"
|
||||||
>{$_("save-changes")}</button
|
>{$_("save-changes")}</button
|
||||||
>
|
>
|
||||||
{/if}
|
{/if}
|
||||||
|
|||||||
@@ -16,7 +16,8 @@
|
|||||||
<section class="min-h-screen bg-gray-50">
|
<section class="min-h-screen bg-gray-50">
|
||||||
<div
|
<div
|
||||||
class:collapsed_navigation={!navOpen}
|
class:collapsed_navigation={!navOpen}
|
||||||
class="select-none fixed top-0 left-0 z-20 h-full pb-10 overflow-x-hidden overflow-y-auto transition origin-left transform border-r w-60 bg-gray-50"
|
style="z-index:2;"
|
||||||
|
class="select-none fixed top-0 left-0 h-full pb-10 overflow-x-hidden overflow-y-auto transition origin-left transform border-r w-60 bg-gray-50"
|
||||||
>
|
>
|
||||||
<a href="/" class="flex items-center px-4 py-5">
|
<a href="/" class="flex items-center px-4 py-5">
|
||||||
<img src="/lfk-logo.png" alt="Logo" class="h-10" />
|
<img src="/lfk-logo.png" alt="Logo" class="h-10" />
|
||||||
@@ -42,7 +43,7 @@
|
|||||||
</a>
|
</a>
|
||||||
{#if store.state.jwtinfo.userdetails.permissions.includes("RUNNER:GET")}
|
{#if store.state.jwtinfo.userdetails.permissions.includes("RUNNER:GET")}
|
||||||
<a
|
<a
|
||||||
class:activenav={$router.path === "/runners/"}
|
class:activenav={$router.path.includes("/runners/")}
|
||||||
class="flex items-center px-4 py-3 transition cursor-pointer group hover:bg-gray-200 hover:text-gray-900 w-full font-semibold"
|
class="flex items-center px-4 py-3 transition cursor-pointer group hover:bg-gray-200 hover:text-gray-900 w-full font-semibold"
|
||||||
href="/runners/"
|
href="/runners/"
|
||||||
>
|
>
|
||||||
@@ -63,7 +64,7 @@
|
|||||||
{/if}
|
{/if}
|
||||||
{#if store.state.jwtinfo.userdetails.permissions.includes("TEAM:GET")}
|
{#if store.state.jwtinfo.userdetails.permissions.includes("TEAM:GET")}
|
||||||
<a
|
<a
|
||||||
class:activenav={$router.path === "/teams/"}
|
class:activenav={$router.path.includes("/teams/")}
|
||||||
class="flex items-center px-4 py-3 transition cursor-pointer group hover:bg-gray-200 hover:text-gray-900 w-full font-semibold"
|
class="flex items-center px-4 py-3 transition cursor-pointer group hover:bg-gray-200 hover:text-gray-900 w-full font-semibold"
|
||||||
href="/teams/"
|
href="/teams/"
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -193,7 +193,7 @@
|
|||||||
class:opacity-50={!save_enabled}
|
class:opacity-50={!save_enabled}
|
||||||
type="button"
|
type="button"
|
||||||
on:click={submit}
|
on:click={submit}
|
||||||
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:w-auto sm:text-sm"
|
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:w-auto sm:text-sm mb-1 lg:mb-0"
|
||||||
>{$_("save-changes")}</button
|
>{$_("save-changes")}</button
|
||||||
>
|
>
|
||||||
{/if}
|
{/if}
|
||||||
|
|||||||
@@ -153,7 +153,7 @@
|
|||||||
class:opacity-50={!save_enabled}
|
class:opacity-50={!save_enabled}
|
||||||
type="button"
|
type="button"
|
||||||
on:click={submit}
|
on:click={submit}
|
||||||
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:w-auto sm:text-sm"
|
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:w-auto sm:text-sm mb-1 lg:mb-0"
|
||||||
>{$_("save-changes")}</button
|
>{$_("save-changes")}</button
|
||||||
>
|
>
|
||||||
{/if}
|
{/if}
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
modal_open = true;
|
modal_open = true;
|
||||||
}}
|
}}
|
||||||
type="button"
|
type="button"
|
||||||
class="w-full inline-flex 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:w-auto sm:text-sm mt-1 sm:mt-0"
|
class="w-full inline-flex 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:w-auto sm:text-sm mb-1 lg:mb-0"
|
||||||
>
|
>
|
||||||
{$_("add-donor")}
|
{$_("add-donor")}
|
||||||
</button>
|
</button>
|
||||||
@@ -59,7 +59,7 @@
|
|||||||
hiddenElement.remove();
|
hiddenElement.remove();
|
||||||
}}
|
}}
|
||||||
type="button"
|
type="button"
|
||||||
class="w-full inline-flex 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:w-auto sm:text-sm mt-1 sm:mt-0"
|
class="w-full inline-flex 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:w-auto sm:text-sm mb-1 lg:mb-0"
|
||||||
>
|
>
|
||||||
{$_("sponsoring-quittungs-liste_herunterladen")}
|
{$_("sponsoring-quittungs-liste_herunterladen")}
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
@@ -146,7 +146,7 @@
|
|||||||
class:opacity-50={!save_enabled}
|
class:opacity-50={!save_enabled}
|
||||||
type="button"
|
type="button"
|
||||||
on:click={submit}
|
on:click={submit}
|
||||||
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:w-auto sm:text-sm"
|
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:w-auto sm:text-sm mb-1 lg:mb-0"
|
||||||
>{$_("save-changes")}</button
|
>{$_("save-changes")}</button
|
||||||
>
|
>
|
||||||
{/if}
|
{/if}
|
||||||
|
|||||||
@@ -141,7 +141,7 @@
|
|||||||
class:opacity-50={save_enabled}
|
class:opacity-50={save_enabled}
|
||||||
type="button"
|
type="button"
|
||||||
on:click={submit}
|
on:click={submit}
|
||||||
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:w-auto sm:text-sm"
|
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:w-auto sm:text-sm mb-1 lg:mb-0"
|
||||||
>{$_("save-changes")}</button
|
>{$_("save-changes")}</button
|
||||||
>
|
>
|
||||||
{:else}
|
{:else}
|
||||||
|
|||||||
@@ -1,108 +0,0 @@
|
|||||||
<script>
|
|
||||||
import { _ } from "svelte-i18n";
|
|
||||||
import { clickOutside } from "../base/outsideclick";
|
|
||||||
|
|
||||||
import { RunnerOrganizationService } from "@odit/lfk-client-js";
|
|
||||||
|
|
||||||
import { createEventDispatcher } from "svelte";
|
|
||||||
export let modal_open;
|
|
||||||
export let delete_org;
|
|
||||||
const dispatch = createEventDispatcher();
|
|
||||||
function cancelDelete() {
|
|
||||||
modal_open = false;
|
|
||||||
dispatch("cancelDelete", { id: delete_org.id });
|
|
||||||
}
|
|
||||||
function deleteOrg() {
|
|
||||||
RunnerOrganizationService.runnerOrganizationControllerRemove(
|
|
||||||
delete_org.id,
|
|
||||||
true
|
|
||||||
)
|
|
||||||
.then((resp) => {
|
|
||||||
toast($_("organization-deleted"));
|
|
||||||
location.replace("./");
|
|
||||||
})
|
|
||||||
.catch((err) => {});
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
{#if modal_open}
|
|
||||||
<div
|
|
||||||
class="fixed z-10 inset-0 overflow-y-auto"
|
|
||||||
use:clickOutside
|
|
||||||
on:click_outside={cancelDelete}
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
class="flex items-end justify-center min-h-screen pt-4 px-4 pb-20 text-center sm:block sm:p-0"
|
|
||||||
>
|
|
||||||
<div class="fixed inset-0 transition-opacity" aria-hidden="true">
|
|
||||||
<div
|
|
||||||
class="absolute inset-0 bg-gray-500 opacity-75"
|
|
||||||
data-id="modal_backdrop"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<span
|
|
||||||
class="hidden sm:inline-block sm:align-middle sm:h-screen"
|
|
||||||
aria-hidden="true">​</span
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
class="inline-block align-bottom bg-white rounded-lg text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-lg sm:w-full"
|
|
||||||
role="dialog"
|
|
||||||
aria-modal="true"
|
|
||||||
aria-labelledby="modal-headline"
|
|
||||||
>
|
|
||||||
<div class="bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4">
|
|
||||||
<div class="sm:flex sm:items-start">
|
|
||||||
<div
|
|
||||||
class="mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-blue-100 sm:mx-0 sm:h-10 sm:w-10"
|
|
||||||
>
|
|
||||||
<svg
|
|
||||||
class="h-6 w-6 text-blue-600"
|
|
||||||
fill="currentColor"
|
|
||||||
width="24"
|
|
||||||
height="24"
|
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
|
||||||
viewBox="0 0 640 512"
|
|
||||||
><path
|
|
||||||
fill="currentColor"
|
|
||||||
d="M96 224c35.3 0 64-28.7 64-64s-28.7-64-64-64-64 28.7-64 64 28.7 64 64 64zm448 0c35.3 0 64-28.7 64-64s-28.7-64-64-64-64 28.7-64 64 28.7 64 64 64zm32 32h-64c-17.6 0-33.5 7.1-45.1 18.6 40.3 22.1 68.9 62 75.1 109.4h66c17.7 0 32-14.3 32-32v-32c0-35.3-28.7-64-64-64zm-256 0c61.9 0 112-50.1 112-112S381.9 32 320 32 208 82.1 208 144s50.1 112 112 112zm76.8 32h-8.3c-20.8 10-43.9 16-68.5 16s-47.6-6-68.5-16h-8.3C179.6 288 128 339.6 128 403.2V432c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48v-28.8c0-63.6-51.6-115.2-115.2-115.2zm-223.7-13.4C161.5 263.1 145.6 256 128 256H64c-35.3 0-64 28.7-64 64v32c0 17.7 14.3 32 32 32h65.9c6.3-47.4 34.9-87.3 75.2-109.4z"
|
|
||||||
/></svg
|
|
||||||
>
|
|
||||||
</div>
|
|
||||||
<div class="mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left">
|
|
||||||
<h3 class="text-lg leading-6 font-medium text-gray-900">
|
|
||||||
{$_("attention")}
|
|
||||||
</h3>
|
|
||||||
<div class="mt-2 mb-6">
|
|
||||||
<p class="text-sm text-gray-500">
|
|
||||||
{$_(
|
|
||||||
"do-you-want-to-delete-the-organization-delete_org-name",
|
|
||||||
{
|
|
||||||
values: { orgname: delete_org.name },
|
|
||||||
}
|
|
||||||
)}<br />
|
|
||||||
{$_("all-associated-teams-and-runners-will-be-deleted-too")}
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="bg-gray-50 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse">
|
|
||||||
<button
|
|
||||||
on:click={deleteOrg}
|
|
||||||
type="button"
|
|
||||||
class="w-full inline-flex 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-organization-and-associated-teams-runners")}
|
|
||||||
</button>
|
|
||||||
<button
|
|
||||||
on:click={cancelDelete}
|
|
||||||
type="button"
|
|
||||||
class="mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"
|
|
||||||
>
|
|
||||||
{$_("cancel-keep-organization")}
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{/if}
|
|
||||||
@@ -0,0 +1,104 @@
|
|||||||
|
<script>
|
||||||
|
import { _ } from "svelte-i18n";
|
||||||
|
import { clickOutside } from "../base/outsideclick";
|
||||||
|
|
||||||
|
import { RunnerOrganizationService } from "@odit/lfk-client-js";
|
||||||
|
|
||||||
|
import { createEventDispatcher } from "svelte";
|
||||||
|
export let modal_open;
|
||||||
|
export let delete_org;
|
||||||
|
const dispatch = createEventDispatcher();
|
||||||
|
function cancelDelete() {
|
||||||
|
modal_open = false;
|
||||||
|
dispatch("cancelDelete", { id: delete_org.id });
|
||||||
|
}
|
||||||
|
function deleteOrg() {
|
||||||
|
RunnerOrganizationService.runnerOrganizationControllerRemove(
|
||||||
|
delete_org.id,
|
||||||
|
true
|
||||||
|
)
|
||||||
|
.then((resp) => {
|
||||||
|
toast($_("organization-deleted"));
|
||||||
|
location.replace("./");
|
||||||
|
})
|
||||||
|
.catch((err) => {});
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
{#if modal_open}
|
||||||
|
<div
|
||||||
|
class="fixed z-10 inset-0 overflow-y-auto"
|
||||||
|
use:clickOutside
|
||||||
|
on:click_outside={cancelDelete}
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
class="flex items-end justify-center min-h-screen pt-4 px-4 pb-20 text-center sm:block sm:p-0"
|
||||||
|
>
|
||||||
|
<div class="fixed inset-0 transition-opacity" aria-hidden="true">
|
||||||
|
<div
|
||||||
|
class="absolute inset-0 bg-gray-500 opacity-75"
|
||||||
|
data-id="modal_backdrop"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<span
|
||||||
|
class="hidden sm:inline-block sm:align-middle sm:h-screen"
|
||||||
|
aria-hidden="true">​</span
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
class="inline-block align-bottom bg-white rounded-lg text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-lg sm:w-full"
|
||||||
|
role="dialog"
|
||||||
|
aria-modal="true"
|
||||||
|
aria-labelledby="modal-headline"
|
||||||
|
>
|
||||||
|
<div class="bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4">
|
||||||
|
<div class="sm:flex sm:items-start">
|
||||||
|
<div
|
||||||
|
class="mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-blue-100 sm:mx-0 sm:h-10 sm:w-10"
|
||||||
|
>
|
||||||
|
<svg
|
||||||
|
class="h-6 w-6 text-blue-600"
|
||||||
|
fill="currentColor"
|
||||||
|
width="24"
|
||||||
|
height="24"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
viewBox="0 0 640 512"
|
||||||
|
><path
|
||||||
|
fill="currentColor"
|
||||||
|
d="M96 224c35.3 0 64-28.7 64-64s-28.7-64-64-64-64 28.7-64 64 28.7 64 64 64zm448 0c35.3 0 64-28.7 64-64s-28.7-64-64-64-64 28.7-64 64 28.7 64 64 64zm32 32h-64c-17.6 0-33.5 7.1-45.1 18.6 40.3 22.1 68.9 62 75.1 109.4h66c17.7 0 32-14.3 32-32v-32c0-35.3-28.7-64-64-64zm-256 0c61.9 0 112-50.1 112-112S381.9 32 320 32 208 82.1 208 144s50.1 112 112 112zm76.8 32h-8.3c-20.8 10-43.9 16-68.5 16s-47.6-6-68.5-16h-8.3C179.6 288 128 339.6 128 403.2V432c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48v-28.8c0-63.6-51.6-115.2-115.2-115.2zm-223.7-13.4C161.5 263.1 145.6 256 128 256H64c-35.3 0-64 28.7-64 64v32c0 17.7 14.3 32 32 32h65.9c6.3-47.4 34.9-87.3 75.2-109.4z"
|
||||||
|
/></svg
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
<div class="mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left">
|
||||||
|
<h3 class="text-lg leading-6 font-medium text-gray-900">
|
||||||
|
{$_("do-you-want-to-delete-the-organization-delete_org-name", {
|
||||||
|
values: { orgname: delete_org.name },
|
||||||
|
})}
|
||||||
|
</h3>
|
||||||
|
<div class="mt-2 mb-6">
|
||||||
|
<p class="text-sm text-gray-500">
|
||||||
|
{$_("all-associated-teams-and-runners-will-be-deleted-too")}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="bg-gray-50 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse">
|
||||||
|
<button
|
||||||
|
on:click={deleteOrg}
|
||||||
|
type="button"
|
||||||
|
class="w-full inline-flex 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-organization-and-associated-teams-runners")}
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
on:click={cancelDelete}
|
||||||
|
type="button"
|
||||||
|
class="mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"
|
||||||
|
>
|
||||||
|
{$_("cancel-keep-organization")}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
@@ -13,8 +13,7 @@
|
|||||||
import GenerateRunnerCertificates from "../pdf_generation/GenerateRunnerCertificates.svelte";
|
import GenerateRunnerCertificates from "../pdf_generation/GenerateRunnerCertificates.svelte";
|
||||||
import GenerateSponsoringContracts from "../pdf_generation/GenerateSponsoringContracts.svelte";
|
import GenerateSponsoringContracts from "../pdf_generation/GenerateSponsoringContracts.svelte";
|
||||||
import ImportRunnerModal from "../runners/ImportRunnerModal.svelte";
|
import ImportRunnerModal from "../runners/ImportRunnerModal.svelte";
|
||||||
import ConfirmOrgDeletion from "./ConfirmOrgDeletion.svelte";
|
import ConfirmOrgDeletionModal from "./ConfirmOrgDeletionModal.svelte";
|
||||||
$: delete_triggered = false;
|
|
||||||
$: address_valid_or_none =
|
$: address_valid_or_none =
|
||||||
(isAddress1Valid && iszipcodevalid && iscityvalid) ||
|
(isAddress1Valid && iszipcodevalid && iscityvalid) ||
|
||||||
editable.address_checked === false;
|
editable.address_checked === false;
|
||||||
@@ -79,10 +78,7 @@
|
|||||||
toast($_("organization-deleted"));
|
toast($_("organization-deleted"));
|
||||||
location.replace("./");
|
location.replace("./");
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {});
|
||||||
modal_open = true;
|
|
||||||
delete_org = original_object;
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
function submit() {
|
function submit() {
|
||||||
if (data_loaded === true && save_enabled) {
|
if (data_loaded === true && save_enabled) {
|
||||||
@@ -142,7 +138,7 @@
|
|||||||
opened_from="OrgDetail"
|
opened_from="OrgDetail"
|
||||||
bind:import_modal_open
|
bind:import_modal_open
|
||||||
/>
|
/>
|
||||||
<ConfirmOrgDeletion bind:modal_open bind:delete_org />
|
<ConfirmOrgDeletionModal bind:modal_open bind:delete_org />
|
||||||
{#if data_loaded}
|
{#if data_loaded}
|
||||||
<section class="container p-5">
|
<section class="container p-5">
|
||||||
<div class="flex flex-row mb-4">
|
<div class="flex flex-row mb-4">
|
||||||
@@ -173,7 +169,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="mb-4 text-3xl font-extrabold leading-tight">
|
<div class="mb-4 text-3xl font-extrabold leading-tight">
|
||||||
{original_object.name} [#{params.orgid}]
|
{original_object.name} [#{params.orgid}]
|
||||||
<span data-id="org_actions_${editable.id}">
|
<div data-id="org_actions_${editable.id}">
|
||||||
<GenerateSponsoringContracts
|
<GenerateSponsoringContracts
|
||||||
bind:sponsoring_contracts_show
|
bind:sponsoring_contracts_show
|
||||||
bind:generate_orgs
|
bind:generate_orgs
|
||||||
@@ -192,42 +188,25 @@
|
|||||||
</button>
|
</button>
|
||||||
{/if}
|
{/if}
|
||||||
{#if store.state.jwtinfo.userdetails.permissions.includes("RUNNER:DELETE")}
|
{#if store.state.jwtinfo.userdetails.permissions.includes("RUNNER:DELETE")}
|
||||||
{#if delete_triggered}
|
|
||||||
<button
|
|
||||||
on:click={deleteOrganization}
|
|
||||||
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:w-auto sm:text-sm"
|
|
||||||
>{$_("confirm-delete")}</button
|
|
||||||
>
|
|
||||||
<button
|
|
||||||
on:click={() => {
|
|
||||||
delete_triggered = !delete_triggered;
|
|
||||||
}}
|
|
||||||
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
|
|
||||||
>
|
|
||||||
{/if}
|
|
||||||
{#if !delete_triggered}
|
|
||||||
<button
|
|
||||||
on:click={() => {
|
|
||||||
delete_triggered = true;
|
|
||||||
}}
|
|
||||||
type="button"
|
|
||||||
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:w-auto sm:text-sm"
|
|
||||||
>{$_("delete-organization")}</button
|
|
||||||
>
|
|
||||||
{/if}
|
|
||||||
{/if}
|
|
||||||
{#if !delete_triggered}
|
|
||||||
<button
|
<button
|
||||||
on:click={submit}
|
on:click={() => {
|
||||||
disabled={!save_enabled}
|
modal_open = true;
|
||||||
class:opacity-50={!save_enabled}
|
delete_org = original_object;
|
||||||
|
}}
|
||||||
type="button"
|
type="button"
|
||||||
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:w-auto sm:text-sm"
|
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:w-auto sm:text-sm"
|
||||||
>{$_("save-changes")}</button
|
>{$_("delete-organization")}</button
|
||||||
>
|
>
|
||||||
{/if}
|
{/if}
|
||||||
</span>
|
<button
|
||||||
|
on:click={submit}
|
||||||
|
disabled={!save_enabled}
|
||||||
|
class:opacity-50={!save_enabled}
|
||||||
|
type="button"
|
||||||
|
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:w-auto sm:text-sm mb-1 lg:mb-0"
|
||||||
|
>{$_("save-changes")}</button
|
||||||
|
>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="text-sm w-full mt-2">
|
<div class="text-sm w-full mt-2">
|
||||||
<label for="name" class="font-semibold text-gray-700">{$_("name")}</label>
|
<label for="name" class="font-semibold text-gray-700">{$_("name")}</label>
|
||||||
|
|||||||
@@ -1,244 +0,0 @@
|
|||||||
<script>
|
|
||||||
import { _ } from "svelte-i18n";
|
|
||||||
import GenerateSponsoringContracts from "../pdf_generation/GenerateSponsoringContracts.svelte";
|
|
||||||
let modal_open = false;
|
|
||||||
let delete_org = {};
|
|
||||||
import { RunnerOrganizationService } from "@odit/lfk-client-js";
|
|
||||||
import store from "../../store";
|
|
||||||
import OrgsEmptyState from "./OrgsEmptyState.svelte";
|
|
||||||
import ConfirmOrgDeletion from "./ConfirmOrgDeletion.svelte";
|
|
||||||
import GenerateRunnerCards from "../pdf_generation/GenerateRunnerCards.svelte";
|
|
||||||
import GenerateRunnerCertificates from "../pdf_generation/GenerateRunnerCertificates.svelte";
|
|
||||||
import toast from "svelte-french-toast";
|
|
||||||
$: searchvalue = "";
|
|
||||||
$: active_deletes = [];
|
|
||||||
$: sponsoring_contracts_show = current_organizations.some(
|
|
||||||
(r) => r.is_selected === true
|
|
||||||
);
|
|
||||||
$: cards_show = current_organizations.some((r) => r.is_selected === true);
|
|
||||||
$: generate_orgs = current_organizations.filter(
|
|
||||||
(r) => r.is_selected === true
|
|
||||||
);
|
|
||||||
$: certificates_show = current_organizations.some(
|
|
||||||
(r) => r.is_selected === true
|
|
||||||
);
|
|
||||||
export let current_organizations = [];
|
|
||||||
|
|
||||||
const promise =
|
|
||||||
RunnerOrganizationService.runnerOrganizationControllerGetAll().then(
|
|
||||||
(val) => {
|
|
||||||
current_organizations = val;
|
|
||||||
}
|
|
||||||
);
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<ConfirmOrgDeletion
|
|
||||||
on:cancelDelete={(event) => {
|
|
||||||
modal_open = false;
|
|
||||||
active_deletes[event.detail.id] = false;
|
|
||||||
}}
|
|
||||||
bind:modal_open
|
|
||||||
bind:delete_org
|
|
||||||
/>
|
|
||||||
{#if store.state.jwtinfo.userdetails.permissions.includes("ORGANIZATION:GET")}
|
|
||||||
{#await promise}
|
|
||||||
<div
|
|
||||||
class="bg-teal-lightest border-t-4 border-teal rounded-b text-teal-darkest px-4 py-3 shadow-md my-2"
|
|
||||||
role="alert"
|
|
||||||
>
|
|
||||||
<p class="font-bold">{$_("organizations-are-being-loaded")}</p>
|
|
||||||
<p class="text-sm">{$_("this-might-take-a-moment")}</p>
|
|
||||||
</div>
|
|
||||||
{:then}
|
|
||||||
{#if current_organizations.length === 0}
|
|
||||||
<OrgsEmptyState />
|
|
||||||
{:else}
|
|
||||||
<input
|
|
||||||
type="search"
|
|
||||||
bind:value={searchvalue}
|
|
||||||
placeholder={$_("datatable.search")}
|
|
||||||
aria-label={$_("datatable.search")}
|
|
||||||
class="mb-2 w-full sm:w-auto mt-1 sm:mt-0 p-2 rounded-md border"
|
|
||||||
/>
|
|
||||||
<div class="h-12">
|
|
||||||
<GenerateSponsoringContracts
|
|
||||||
bind:sponsoring_contracts_show
|
|
||||||
bind:generate_orgs
|
|
||||||
/>
|
|
||||||
<GenerateRunnerCards bind:cards_show bind:generate_orgs />
|
|
||||||
<GenerateRunnerCertificates bind:certificates_show bind:generate_orgs />
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
class="shadow border-b border-gray-200 sm:rounded-lg overflow-x-scroll"
|
|
||||||
>
|
|
||||||
<table class="divide-y divide-gray-200 w-full">
|
|
||||||
<thead class="bg-gray-50">
|
|
||||||
<tr class="odd:bg-white even:bg-gray-100">
|
|
||||||
<th
|
|
||||||
scope="col"
|
|
||||||
class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"
|
|
||||||
>
|
|
||||||
<button
|
|
||||||
on:click={() => {
|
|
||||||
const newstate = !current_organizations.some(
|
|
||||||
(r) => r.is_selected === true
|
|
||||||
);
|
|
||||||
current_organizations = current_organizations.map((r) => {
|
|
||||||
r.is_selected = newstate;
|
|
||||||
return r;
|
|
||||||
});
|
|
||||||
}}
|
|
||||||
class="underline cursor-pointer select-none"
|
|
||||||
>{#if current_organizations.some((r) => r.is_selected === true)}
|
|
||||||
{$_("deselect-all")}
|
|
||||||
{:else}{$_("select-all")}{/if}
|
|
||||||
</button>
|
|
||||||
</th>
|
|
||||||
<th
|
|
||||||
scope="col"
|
|
||||||
class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"
|
|
||||||
>
|
|
||||||
{$_("name")}
|
|
||||||
</th>
|
|
||||||
<th
|
|
||||||
scope="col"
|
|
||||||
class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"
|
|
||||||
>
|
|
||||||
{$_("address")}
|
|
||||||
</th>
|
|
||||||
<th
|
|
||||||
scope="col"
|
|
||||||
class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"
|
|
||||||
>
|
|
||||||
{$_("contact")}
|
|
||||||
</th>
|
|
||||||
<th scope="col" class="relative px-6 py-3">
|
|
||||||
<span class="sr-only">{$_("action")}</span>
|
|
||||||
</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody class="divide-y divide-gray-200">
|
|
||||||
{#each current_organizations as o}
|
|
||||||
{#if Object.values(o)
|
|
||||||
.toString()
|
|
||||||
.toLowerCase()
|
|
||||||
.includes(searchvalue)}
|
|
||||||
<tr
|
|
||||||
class="odd:bg-white even:bg-gray-100"
|
|
||||||
data-rowid="org_{o.id}"
|
|
||||||
>
|
|
||||||
<td class="px-6 py-4 whitespace-nowrap">
|
|
||||||
<input
|
|
||||||
bind:checked={o.is_selected}
|
|
||||||
type="checkbox"
|
|
||||||
class="focus:ring-indigo-500 h-4 w-4 text-indigo-600 border-gray-300 rounded"
|
|
||||||
/>
|
|
||||||
</td>
|
|
||||||
<td class="px-6 py-4 whitespace-nowrap">
|
|
||||||
<div class="flex items-center">
|
|
||||||
<div class="text-sm font-medium text-gray-900">
|
|
||||||
{o.name}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</td>
|
|
||||||
<td class="px-6 py-4 whitespace-nowrap">
|
|
||||||
<div class="flex items-center">
|
|
||||||
<div class="text-sm font-medium text-gray-900">
|
|
||||||
{#if o.address.address1 !== null}
|
|
||||||
{o.address.address1}<br />
|
|
||||||
<!-- {o.address.address2 || ''}<br /> -->
|
|
||||||
{o.address.postalcode}
|
|
||||||
{o.address.city}
|
|
||||||
{o.address.country}
|
|
||||||
{/if}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</td>
|
|
||||||
<td class="px-6 py-4 whitespace-nowrap">
|
|
||||||
<div class="flex items-center">
|
|
||||||
<div class="text-sm font-medium text-gray-900">
|
|
||||||
{#if o.contact}
|
|
||||||
<a
|
|
||||||
href="../contacts/{o.contact.id}"
|
|
||||||
class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-gray-100 text-gray-800 border border-current"
|
|
||||||
>{o.contact.firstname}
|
|
||||||
{o.contact.middlename || ""}
|
|
||||||
{o.contact.lastname}</a
|
|
||||||
>
|
|
||||||
{:else}{$_("no-contact-specified")}{/if}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</td>
|
|
||||||
{#if active_deletes[o.id] === true}
|
|
||||||
<td
|
|
||||||
class="px-6 py-4 whitespace-nowrap text-right text-sm font-medium"
|
|
||||||
>
|
|
||||||
<button
|
|
||||||
on:click={() => {
|
|
||||||
active_deletes[o.id] = false;
|
|
||||||
}}
|
|
||||||
tabindex="0"
|
|
||||||
class="ml-4 text-indigo-600 hover:text-indigo-900 cursor-pointer"
|
|
||||||
>{$_("cancel-delete")}</button
|
|
||||||
>
|
|
||||||
<button
|
|
||||||
on:click={() => {
|
|
||||||
toast.loading($_("deleting-organization"));
|
|
||||||
RunnerOrganizationService.runnerOrganizationControllerRemove(
|
|
||||||
o.id,
|
|
||||||
false
|
|
||||||
)
|
|
||||||
.then((resp) => {
|
|
||||||
current_organizations =
|
|
||||||
current_organizations.filter(
|
|
||||||
(obj) => obj.id !== o.id
|
|
||||||
);
|
|
||||||
toast($_("organization-deleted"));
|
|
||||||
})
|
|
||||||
.catch((err) => {
|
|
||||||
modal_open = true;
|
|
||||||
delete_org = o;
|
|
||||||
});
|
|
||||||
}}
|
|
||||||
tabindex="0"
|
|
||||||
class="ml-4 text-red-600 hover:text-red-900 cursor-pointer"
|
|
||||||
>{$_("confirm-delete")}</button
|
|
||||||
>
|
|
||||||
</td>
|
|
||||||
{:else}
|
|
||||||
<td
|
|
||||||
class="px-6 py-4 whitespace-nowrap text-right text-sm font-medium"
|
|
||||||
>
|
|
||||||
<a
|
|
||||||
href="./{o.id}"
|
|
||||||
class="text-indigo-600 hover:text-indigo-900"
|
|
||||||
>{$_("details")}</a
|
|
||||||
>
|
|
||||||
{#if store.state.jwtinfo.userdetails.permissions.includes("ORGANIZATION:DELETE")}
|
|
||||||
<button
|
|
||||||
on:click={() => {
|
|
||||||
active_deletes[o.id] = true;
|
|
||||||
}}
|
|
||||||
tabindex="0"
|
|
||||||
class="ml-4 text-red-600 hover:text-red-900 cursor-pointer"
|
|
||||||
>{$_("delete")}</button
|
|
||||||
>
|
|
||||||
{/if}
|
|
||||||
</td>
|
|
||||||
{/if}
|
|
||||||
</tr>
|
|
||||||
{/if}
|
|
||||||
{/each}
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
{/if}
|
|
||||||
{:catch error}
|
|
||||||
<div class="text-white px-6 py-4 border-0 rounded relative mb-4 bg-red-500">
|
|
||||||
<span class="inline-block align-middle mr-8">
|
|
||||||
<b class="capitalize">{$_("general_promise_error")}</b>
|
|
||||||
{error}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
{/await}
|
|
||||||
{/if}
|
|
||||||
+245
-45
@@ -1,53 +1,253 @@
|
|||||||
<script>
|
<script>
|
||||||
import { _ } from "svelte-i18n";
|
import GenerateSponsoringContracts from "../pdf_generation/GenerateSponsoringContracts.svelte";
|
||||||
import store from "../../store";
|
let delete_org = {};
|
||||||
import AddOrgModal from "./AddOrgModal.svelte";
|
import { RunnerOrganizationService } from "@odit/lfk-client-js";
|
||||||
export let modal_open = false;
|
import store from "../../store";
|
||||||
import OrgOverview from "./OrgOverview.svelte";
|
import OrgsEmptyState from "./OrgsEmptyState.svelte";
|
||||||
import ImportRunnerModal from "../runners/ImportRunnerModal.svelte";
|
import ConfirmOrgDeletionModal from "./ConfirmOrgDeletionModal.svelte";
|
||||||
let current_organizations = [];
|
import GenerateRunnerCards from "../pdf_generation/GenerateRunnerCards.svelte";
|
||||||
export let import_modal_open = false;
|
import GenerateRunnerCertificates from "../pdf_generation/GenerateRunnerCertificates.svelte";
|
||||||
|
import toast from "svelte-french-toast";
|
||||||
|
$: searchvalue = "";
|
||||||
|
$: active_deletes = [];
|
||||||
|
$: sponsoring_contracts_show = current_organizations.some(
|
||||||
|
(r) => r.is_selected === true
|
||||||
|
);
|
||||||
|
$: cards_show = current_organizations.some((r) => r.is_selected === true);
|
||||||
|
$: generate_orgs = current_organizations.filter(
|
||||||
|
(r) => r.is_selected === true
|
||||||
|
);
|
||||||
|
$: certificates_show = current_organizations.some(
|
||||||
|
(r) => r.is_selected === true
|
||||||
|
);
|
||||||
|
let current_organizations = [];
|
||||||
|
|
||||||
|
const promise =
|
||||||
|
RunnerOrganizationService.runnerOrganizationControllerGetAll().then(
|
||||||
|
(val) => {
|
||||||
|
current_organizations = val;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
import { _ } from "svelte-i18n";
|
||||||
|
import AddOrgModal from "./AddOrgModal.svelte";
|
||||||
|
let delete_modal_open = false;
|
||||||
|
let modal_open = false;
|
||||||
|
import ImportRunnerModal from "../runners/ImportRunnerModal.svelte";
|
||||||
|
let import_modal_open = false;
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<section class="container p-5">
|
<section class="container p-5">
|
||||||
<h4 class="mb-1 text-3xl font-extrabold leading-tight">
|
<h4 class="mb-1 text-3xl font-extrabold leading-tight">
|
||||||
{$_("organizations")}
|
{$_("organizations")}
|
||||||
</h4>
|
</h4>
|
||||||
{#if store.state.jwtinfo.userdetails.permissions.includes("ORGANIZATION:CREATE")}
|
{#if store.state.jwtinfo.userdetails.permissions.includes("ORGANIZATION:CREATE")}
|
||||||
<button
|
<button
|
||||||
on:click={() => {
|
on:click={() => {
|
||||||
modal_open = true;
|
modal_open = true;
|
||||||
}}
|
}}
|
||||||
type="button"
|
type="button"
|
||||||
class="w-full inline-flex 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:w-auto sm:text-sm mt-1 sm:mt-0"
|
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:w-auto sm:text-sm mb-1 lg:mb-0"
|
||||||
>
|
>
|
||||||
{$_("create-organization")}
|
{$_("create-organization")}
|
||||||
</button>
|
</button>
|
||||||
{/if}
|
{/if}
|
||||||
{#if store.state.jwtinfo.userdetails.permissions.includes("RUNNER:IMPORT")}
|
{#if store.state.jwtinfo.userdetails.permissions.includes("RUNNER:IMPORT")}
|
||||||
<button
|
<button
|
||||||
on:click={() => {
|
on:click={() => {
|
||||||
import_modal_open = true;
|
import_modal_open = true;
|
||||||
}}
|
}}
|
||||||
type="button"
|
type="button"
|
||||||
class="w-full inline-flex 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:w-auto sm:text-sm mt-1 sm:mt-0"
|
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:w-auto sm:text-sm mb-1 lg:mb-0"
|
||||||
>
|
>
|
||||||
{$_("import-runners")}
|
{$_("import-runners")}
|
||||||
</button>
|
</button>
|
||||||
{/if}
|
{/if}
|
||||||
<OrgOverview bind:current_organizations />
|
<ConfirmOrgDeletionModal
|
||||||
|
on:cancelDelete={(event) => {
|
||||||
|
delete_modal_open = false;
|
||||||
|
active_deletes[event.detail.id] = false;
|
||||||
|
}}
|
||||||
|
bind:modal_open={delete_modal_open}
|
||||||
|
bind:delete_org
|
||||||
|
/>
|
||||||
|
{#if store.state.jwtinfo.userdetails.permissions.includes("ORGANIZATION:GET")}
|
||||||
|
{#await promise}
|
||||||
|
<div
|
||||||
|
class="bg-teal-lightest border-t-4 border-teal rounded-b text-teal-darkest px-4 py-3 shadow-md my-2"
|
||||||
|
role="alert"
|
||||||
|
>
|
||||||
|
<p class="font-bold">{$_("organizations-are-being-loaded")}</p>
|
||||||
|
<p class="text-sm">{$_("this-might-take-a-moment")}</p>
|
||||||
|
</div>
|
||||||
|
{:then}
|
||||||
|
{#if current_organizations.length === 0}
|
||||||
|
<OrgsEmptyState />
|
||||||
|
{:else}
|
||||||
|
<input
|
||||||
|
type="search"
|
||||||
|
bind:value={searchvalue}
|
||||||
|
placeholder={$_("datatable.search")}
|
||||||
|
aria-label={$_("datatable.search")}
|
||||||
|
class="w-full sm:w-auto sm:mt-0 p-2 rounded-md border mb-1 lg:mb-0"
|
||||||
|
/>
|
||||||
|
<GenerateSponsoringContracts
|
||||||
|
bind:sponsoring_contracts_show
|
||||||
|
bind:generate_orgs
|
||||||
|
/>
|
||||||
|
<GenerateRunnerCards bind:cards_show bind:generate_orgs />
|
||||||
|
<GenerateRunnerCertificates bind:certificates_show bind:generate_orgs />
|
||||||
|
<div
|
||||||
|
class="shadow border-b border-gray-200 sm:rounded-lg overflow-x-scroll"
|
||||||
|
>
|
||||||
|
<table class="divide-y divide-gray-200 w-full">
|
||||||
|
<thead class="bg-gray-50">
|
||||||
|
<tr class="odd:bg-white even:bg-gray-100">
|
||||||
|
<th
|
||||||
|
scope="col"
|
||||||
|
class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"
|
||||||
|
>
|
||||||
|
<button
|
||||||
|
on:click={() => {
|
||||||
|
const newstate = !current_organizations.some(
|
||||||
|
(r) => r.is_selected === true
|
||||||
|
);
|
||||||
|
current_organizations = current_organizations.map((r) => {
|
||||||
|
r.is_selected = newstate;
|
||||||
|
return r;
|
||||||
|
});
|
||||||
|
}}
|
||||||
|
class="underline cursor-pointer select-none"
|
||||||
|
>{#if current_organizations.some((r) => r.is_selected === true)}
|
||||||
|
{$_("deselect-all")}
|
||||||
|
{:else}{$_("select-all")}{/if}
|
||||||
|
</button>
|
||||||
|
</th>
|
||||||
|
<th
|
||||||
|
scope="col"
|
||||||
|
class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"
|
||||||
|
>
|
||||||
|
{$_("name")}
|
||||||
|
</th>
|
||||||
|
<th
|
||||||
|
scope="col"
|
||||||
|
class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"
|
||||||
|
>
|
||||||
|
{$_("address")}
|
||||||
|
</th>
|
||||||
|
<th
|
||||||
|
scope="col"
|
||||||
|
class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"
|
||||||
|
>
|
||||||
|
{$_("contact")}
|
||||||
|
</th>
|
||||||
|
<th scope="col" class="relative px-6 py-3">
|
||||||
|
<span class="sr-only">{$_("action")}</span>
|
||||||
|
</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody class="divide-y divide-gray-200">
|
||||||
|
{#each current_organizations as o}
|
||||||
|
{#if Object.values(o)
|
||||||
|
.toString()
|
||||||
|
.toLowerCase()
|
||||||
|
.includes(searchvalue)}
|
||||||
|
<tr
|
||||||
|
class="odd:bg-white even:bg-gray-100"
|
||||||
|
data-rowid="org_{o.id}"
|
||||||
|
>
|
||||||
|
<td class="px-6 py-4 whitespace-nowrap">
|
||||||
|
<input
|
||||||
|
bind:checked={o.is_selected}
|
||||||
|
type="checkbox"
|
||||||
|
class="focus:ring-indigo-500 h-4 w-4 text-indigo-600 border-gray-300 rounded"
|
||||||
|
/>
|
||||||
|
</td>
|
||||||
|
<td class="px-6 py-4 whitespace-nowrap">
|
||||||
|
<div class="flex items-center">
|
||||||
|
<div class="text-sm font-medium text-gray-900">
|
||||||
|
{o.name}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td class="px-6 py-4 whitespace-nowrap">
|
||||||
|
<div class="flex items-center">
|
||||||
|
<div class="text-sm font-medium text-gray-900">
|
||||||
|
{#if o.address.address1 !== null}
|
||||||
|
{o.address.address1}<br />
|
||||||
|
<!-- {o.address.address2 || ''}<br /> -->
|
||||||
|
{o.address.postalcode}
|
||||||
|
{o.address.city}
|
||||||
|
{o.address.country}
|
||||||
|
{/if}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td class="px-6 py-4 whitespace-nowrap">
|
||||||
|
<div class="flex items-center">
|
||||||
|
<div class="text-sm font-medium text-gray-900">
|
||||||
|
{#if o.contact}
|
||||||
|
<a
|
||||||
|
href="../contacts/{o.contact.id}"
|
||||||
|
class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-gray-100 text-gray-800 border border-current"
|
||||||
|
>{o.contact.firstname}
|
||||||
|
{o.contact.middlename || ""}
|
||||||
|
{o.contact.lastname}</a
|
||||||
|
>
|
||||||
|
{:else}{$_("no-contact-specified")}{/if}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td
|
||||||
|
class="px-6 py-4 whitespace-nowrap text-right text-sm font-medium"
|
||||||
|
>
|
||||||
|
<a
|
||||||
|
href="./{o.id}"
|
||||||
|
class="text-indigo-600 hover:text-indigo-900"
|
||||||
|
>{$_("details")}</a
|
||||||
|
>
|
||||||
|
{#if store.state.jwtinfo.userdetails.permissions.includes("ORGANIZATION:DELETE")}
|
||||||
|
<button
|
||||||
|
on:click={() => {
|
||||||
|
active_deletes[o.id] = true;
|
||||||
|
delete_modal_open = true;
|
||||||
|
delete_org = o;
|
||||||
|
}}
|
||||||
|
tabindex="0"
|
||||||
|
class="ml-4 text-red-600 hover:text-red-900 cursor-pointer"
|
||||||
|
>{$_("delete")}</button
|
||||||
|
>
|
||||||
|
{/if}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
{/if}
|
||||||
|
{/each}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
|
{:catch error}
|
||||||
|
<div
|
||||||
|
class="text-white px-6 py-4 border-0 rounded relative mb-4 bg-red-500"
|
||||||
|
>
|
||||||
|
<span class="inline-block align-middle mr-8">
|
||||||
|
<b class="capitalize">{$_("general_promise_error")}</b>
|
||||||
|
{error}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
{/await}
|
||||||
|
{/if}
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
{#if store.state.jwtinfo.userdetails.permissions.includes("ORGANIZATION:CREATE")}
|
{#if store.state.jwtinfo.userdetails.permissions.includes("ORGANIZATION:CREATE")}
|
||||||
<AddOrgModal bind:current_organizations bind:modal_open />
|
<AddOrgModal bind:current_organizations bind:modal_open />
|
||||||
<ImportRunnerModal
|
<ImportRunnerModal
|
||||||
on:cancelDelete={(event) => {
|
on:cancelDelete={(event) => {
|
||||||
import_modal_open = false;
|
import_modal_open = false;
|
||||||
}}
|
}}
|
||||||
passed_team={{}}
|
passed_team={{}}
|
||||||
passed_org={{}}
|
passed_org={{}}
|
||||||
passed_orgs={current_organizations}
|
passed_orgs={current_organizations}
|
||||||
opened_from="OrgOverview"
|
opened_from="OrgOverview"
|
||||||
bind:import_modal_open
|
bind:import_modal_open
|
||||||
/>
|
/>
|
||||||
{/if}
|
{/if}
|
||||||
|
|||||||
@@ -178,25 +178,20 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#if cards_show}
|
{#if cards_show}
|
||||||
<div>
|
<button
|
||||||
<p class="text-base">{$_("generate-runnercards")}</p>
|
on:click={() => {
|
||||||
<div class="inline-flex rounded-lg shadow-2xs">
|
generateRunnerCards("de");
|
||||||
<button
|
}}
|
||||||
on:click={() => {
|
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:w-auto sm:text-sm mb-1 lg:mb-0"
|
||||||
generateRunnerCards("de");
|
>
|
||||||
}}
|
{$_("generate-runnercards")}: DE
|
||||||
class="py-3 px-4 inline-flex items-center gap-x-2 -ms-px first:rounded-s-lg first:ms-0 last:rounded-e-lg text-sm font-medium focus:z-10 border border-gray-200 bg-blue-600 text-white shadow-2xs hover:bg-blue-800 focus:outline-hidden focus:bg-blue-800 disabled:opacity-50 disabled:pointer-events-none"
|
</button>
|
||||||
>
|
<button
|
||||||
DE
|
on:click={() => {
|
||||||
</button>
|
generateRunnerCards("en");
|
||||||
<button
|
}}
|
||||||
on:click={() => {
|
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:w-auto sm:text-sm mb-1 lg:mb-0"
|
||||||
generateRunnerCards("en");
|
>
|
||||||
}}
|
{$_("generate-runnercards")}: EN
|
||||||
class="py-3 px-4 inline-flex items-center gap-x-2 -ms-px first:rounded-s-lg first:ms-0 last:rounded-e-lg text-sm font-medium focus:z-10 border border-gray-200 bg-blue-600 text-white shadow-2xs hover:bg-blue-800 focus:outline-hidden focus:bg-blue-800 disabled:opacity-50 disabled:pointer-events-none"
|
</button>
|
||||||
>
|
|
||||||
EN
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{/if}
|
{/if}
|
||||||
|
|||||||
@@ -156,25 +156,20 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#if certificates_show}
|
{#if certificates_show}
|
||||||
<div>
|
<button
|
||||||
<p class="text-base">{$_("generate-runner-certificates")}</p>
|
on:click={() => {
|
||||||
<div class="inline-flex rounded-lg shadow-2xs">
|
generateCertificates("de");
|
||||||
<button
|
}}
|
||||||
on:click={() => {
|
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:w-auto sm:text-sm mb-1 lg:mb-0"
|
||||||
generateCertificates("de");
|
>
|
||||||
}}
|
{$_("generate-runner-certificates")}: DE
|
||||||
class="py-3 px-4 inline-flex items-center gap-x-2 -ms-px first:rounded-s-lg first:ms-0 last:rounded-e-lg text-sm font-medium focus:z-10 border border-gray-200 bg-blue-600 text-white shadow-2xs hover:bg-blue-800 focus:outline-hidden focus:bg-blue-800 disabled:opacity-50 disabled:pointer-events-none"
|
</button>
|
||||||
>
|
<button
|
||||||
DE
|
on:click={() => {
|
||||||
</button>
|
generateCertificates("en");
|
||||||
<button
|
}}
|
||||||
on:click={() => {
|
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:w-auto sm:text-sm mb-1 lg:mb-0"
|
||||||
generateCertificates("en");
|
>
|
||||||
}}
|
{$_("generate-runner-certificates")}: EN
|
||||||
class="py-3 px-4 inline-flex items-center gap-x-2 -ms-px first:rounded-s-lg first:ms-0 last:rounded-e-lg text-sm font-medium focus:z-10 border border-gray-200 bg-blue-600 text-white shadow-2xs hover:bg-blue-800 focus:outline-hidden focus:bg-blue-800 disabled:opacity-50 disabled:pointer-events-none"
|
</button>
|
||||||
>
|
|
||||||
EN
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{/if}
|
{/if}
|
||||||
|
|||||||
@@ -119,25 +119,20 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#if sponsoring_contracts_show}
|
{#if sponsoring_contracts_show}
|
||||||
<div>
|
<button
|
||||||
<p class="text-base">{$_("generate-sponsoring-contracts")}</p>
|
on:click={() => {
|
||||||
<div class="inline-flex rounded-lg shadow-2xs">
|
generateSponsoringContract("de");
|
||||||
<button
|
}}
|
||||||
on:click={() => {
|
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:w-auto sm:text-sm mb-1 lg:mb-0"
|
||||||
generateSponsoringContract("de");
|
>
|
||||||
}}
|
{$_("generate-sponsoring-contracts")}: DE
|
||||||
class="py-3 px-4 inline-flex items-center gap-x-2 -ms-px first:rounded-s-lg first:ms-0 last:rounded-e-lg text-sm font-medium focus:z-10 border border-gray-200 bg-blue-600 text-white shadow-2xs hover:bg-blue-800 focus:outline-hidden focus:bg-blue-800 disabled:opacity-50 disabled:pointer-events-none"
|
</button>
|
||||||
>
|
<button
|
||||||
DE
|
on:click={() => {
|
||||||
</button>
|
generateSponsoringContract("en");
|
||||||
<button
|
}}
|
||||||
on:click={() => {
|
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:w-auto sm:text-sm mb-1 lg:mb-0"
|
||||||
generateSponsoringContract("en");
|
>
|
||||||
}}
|
{$_("generate-sponsoring-contracts")}: EN
|
||||||
class="py-3 px-4 inline-flex items-center gap-x-2 -ms-px first:rounded-s-lg first:ms-0 last:rounded-e-lg text-sm font-medium focus:z-10 border border-gray-200 bg-blue-600 text-white shadow-2xs hover:bg-blue-800 focus:outline-hidden focus:bg-blue-800 disabled:opacity-50 disabled:pointer-events-none"
|
</button>
|
||||||
>
|
|
||||||
EN
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{/if}
|
{/if}
|
||||||
|
|||||||
@@ -125,20 +125,8 @@
|
|||||||
{original_data.firstname}
|
{original_data.firstname}
|
||||||
{original_data.middlename || ""}
|
{original_data.middlename || ""}
|
||||||
{original_data.lastname} [#{params.runnerid}]
|
{original_data.lastname} [#{params.runnerid}]
|
||||||
<span
|
<span data-id="runner_actions_${editable.id}">
|
||||||
class="grid md:grid-cols-3 gap-1 md:gap-2"
|
|
||||||
data-id="runner_actions_${editable.id}"
|
|
||||||
>
|
|
||||||
{#if store.state.jwtinfo.userdetails.permissions.includes("RUNNER:DELETE")}
|
{#if store.state.jwtinfo.userdetails.permissions.includes("RUNNER:DELETE")}
|
||||||
<GenerateSponsoringContracts
|
|
||||||
bind:sponsoring_contracts_show
|
|
||||||
bind:generate_runners
|
|
||||||
/>
|
|
||||||
<GenerateRunnerCards bind:cards_show bind:generate_runners />
|
|
||||||
<GenerateRunnerCertificates
|
|
||||||
bind:certificates_show
|
|
||||||
bind:generate_runners
|
|
||||||
/>
|
|
||||||
<div>
|
<div>
|
||||||
{#if delete_triggered}
|
{#if delete_triggered}
|
||||||
<button
|
<button
|
||||||
@@ -167,10 +155,19 @@
|
|||||||
class:opacity-50={!save_enabled}
|
class:opacity-50={!save_enabled}
|
||||||
type="button"
|
type="button"
|
||||||
on:click={submit}
|
on:click={submit}
|
||||||
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:w-auto sm:text-sm"
|
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:w-auto sm:text-sm mb-1 lg:mb-0"
|
||||||
>{$_("save-changes")}</button
|
>{$_("save-changes")}</button
|
||||||
>
|
>
|
||||||
{/if}
|
{/if}
|
||||||
|
<GenerateSponsoringContracts
|
||||||
|
bind:sponsoring_contracts_show
|
||||||
|
bind:generate_runners
|
||||||
|
/>
|
||||||
|
<GenerateRunnerCards bind:cards_show bind:generate_runners />
|
||||||
|
<GenerateRunnerCertificates
|
||||||
|
bind:certificates_show
|
||||||
|
bind:generate_runners
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
</span>
|
</span>
|
||||||
@@ -259,7 +256,9 @@
|
|||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
<div class="text-sm w-full mt-2">
|
<div class="text-sm w-full mt-2">
|
||||||
<label for="phone" class="font-semibold text-gray-700">{$_("phone")}</label>
|
<label for="phone" class="font-semibold text-gray-700"
|
||||||
|
>{$_("phone")}</label
|
||||||
|
>
|
||||||
<input
|
<input
|
||||||
autocomplete="off"
|
autocomplete="off"
|
||||||
placeholder={$_("phone")}
|
placeholder={$_("phone")}
|
||||||
|
|||||||
@@ -1,60 +1,317 @@
|
|||||||
<script>
|
<script>
|
||||||
import { _ } from "svelte-i18n";
|
import {
|
||||||
import store from "../../store";
|
RunnerOrganizationService,
|
||||||
import AddRunnerModal from "./AddRunnerModal.svelte";
|
RunnerService,
|
||||||
import ImportRunnerModal from "./ImportRunnerModal.svelte";
|
RunnerTeamService,
|
||||||
import RunnersOverview from "./RunnersOverview.svelte";
|
} from "@odit/lfk-client-js";
|
||||||
$: current_runners = [];
|
import {
|
||||||
export let modal_open = false;
|
createSvelteTable,
|
||||||
export let import_modal_open = false;
|
flexRender,
|
||||||
let addRunners;
|
getCoreRowModel,
|
||||||
|
getFilteredRowModel,
|
||||||
|
getPaginationRowModel,
|
||||||
|
getSortedRowModel,
|
||||||
|
renderComponent,
|
||||||
|
} from "@tanstack/svelte-table";
|
||||||
|
import { onMount } from "svelte";
|
||||||
|
import { writable } from "svelte/store";
|
||||||
|
import GenerateRunnerCards from "../pdf_generation/GenerateRunnerCards.svelte";
|
||||||
|
import GenerateRunnerCertificates from "../pdf_generation/GenerateRunnerCertificates.svelte";
|
||||||
|
import GenerateSponsoringContracts from "../pdf_generation/GenerateSponsoringContracts.svelte";
|
||||||
|
import InputElement from "../shared/InputElement.svelte";
|
||||||
|
import TableActions from "../shared/TableActions.svelte";
|
||||||
|
import { groupFilter } from "../shared/tablefilters";
|
||||||
|
import DeleteRunnerModal from "./DeleteRunnerModal.svelte";
|
||||||
|
import TableBottom from "../shared/TableBottom.svelte";
|
||||||
|
import TableHeader from "../shared/TableHeader.svelte";
|
||||||
|
|
||||||
|
$: selectedRunners =
|
||||||
|
$table?.getSelectedRowModel().rows.map((row) => row.original) || [];
|
||||||
|
$: selected =
|
||||||
|
$table?.getSelectedRowModel().rows.map((row) => row.index) || [];
|
||||||
|
|
||||||
|
$: active_delete = undefined;
|
||||||
|
let dataLoaded = false;
|
||||||
|
export let current_runners = [];
|
||||||
|
$: sponsoring_contracts_show = selected.length > 0;
|
||||||
|
$: cards_show = selected.length > 0;
|
||||||
|
$: certificates_show = selected.length > 0;
|
||||||
|
$: teams = [];
|
||||||
|
$: orgs = [];
|
||||||
|
|
||||||
|
export const addRunners = (runners) => {
|
||||||
|
current_runners = current_runners.concat(...runners);
|
||||||
|
options.update((options) => ({
|
||||||
|
...options,
|
||||||
|
data: current_runners,
|
||||||
|
}));
|
||||||
|
};
|
||||||
|
|
||||||
|
//Section table
|
||||||
|
const columns = [
|
||||||
|
{
|
||||||
|
accessorKey: "id",
|
||||||
|
header: () => "id",
|
||||||
|
filterFn: `equalsString`,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
accessorKey: "firstname",
|
||||||
|
header: () => $_("first-name"),
|
||||||
|
filterFn: `includesString`,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
accessorKey: "middlename",
|
||||||
|
header: () => $_("middle-name"),
|
||||||
|
cell: (info) => {
|
||||||
|
if (!info || !info.getValue()) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
return info.getValue();
|
||||||
|
},
|
||||||
|
filterFn: `includesString`,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
accessorKey: "lastname",
|
||||||
|
header: () => $_("last-name"),
|
||||||
|
filterFn: `includesString`,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
accessorKey: "group",
|
||||||
|
header: () => $_("group"),
|
||||||
|
cell: (info) => {
|
||||||
|
const group = info.getValue();
|
||||||
|
if (group.responseType === "RUNNERORGANIZATION") {
|
||||||
|
return group.name;
|
||||||
|
}
|
||||||
|
return `${group.parentGroup.name} > ${group.name}`;
|
||||||
|
},
|
||||||
|
filterFn: `group`,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
accessorKey: "distance",
|
||||||
|
header: () => $_("distance"),
|
||||||
|
cell: (info) => {
|
||||||
|
if (info.getValue() < 1000) {
|
||||||
|
return `${info.getValue()} m`;
|
||||||
|
}
|
||||||
|
return `${(info.getValue() / 1000).toFixed(1)} km`;
|
||||||
|
},
|
||||||
|
enableColumnFilter: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
accessorKey: "actions",
|
||||||
|
header: () => $_("action"),
|
||||||
|
cell: (info) => {
|
||||||
|
return renderComponent(TableActions, {
|
||||||
|
detailsLink: `./${info.row.original.id}`,
|
||||||
|
deleteAction: () => {
|
||||||
|
active_delete =
|
||||||
|
current_runners[
|
||||||
|
current_runners.findIndex((r) => r.id == info.row.original.id)
|
||||||
|
];
|
||||||
|
},
|
||||||
|
deleteEnabled:
|
||||||
|
store.state.jwtinfo.userdetails.permissions.includes(
|
||||||
|
"RUNNER:DELETE"
|
||||||
|
),
|
||||||
|
});
|
||||||
|
},
|
||||||
|
enableColumnFilter: false,
|
||||||
|
enableSorting: false,
|
||||||
|
},
|
||||||
|
];
|
||||||
|
const options = writable({
|
||||||
|
data: [],
|
||||||
|
columns: columns,
|
||||||
|
filterFns: {
|
||||||
|
group: groupFilter,
|
||||||
|
},
|
||||||
|
initialState: {
|
||||||
|
pagination: {
|
||||||
|
pageSize: 50,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
enableRowSelection: true,
|
||||||
|
getCoreRowModel: getCoreRowModel(),
|
||||||
|
getFilteredRowModel: getFilteredRowModel(),
|
||||||
|
getPaginationRowModel: getPaginationRowModel(),
|
||||||
|
getSortedRowModel: getSortedRowModel(),
|
||||||
|
});
|
||||||
|
const table = createSvelteTable(options);
|
||||||
|
|
||||||
|
async function deleteRunner(delete_runner_id) {
|
||||||
|
await RunnerService.runnerControllerRemove(delete_runner_id, true);
|
||||||
|
current_runners = current_runners.filter((r) => r.id !== delete_runner_id);
|
||||||
|
options.update((options) => ({
|
||||||
|
...options,
|
||||||
|
data: current_runners,
|
||||||
|
}));
|
||||||
|
toast($_("runner-deleted"));
|
||||||
|
}
|
||||||
|
|
||||||
|
onMount(async () => {
|
||||||
|
RunnerTeamService.runnerTeamControllerGetAll().then((val) => {
|
||||||
|
teams = val;
|
||||||
|
});
|
||||||
|
RunnerOrganizationService.runnerOrganizationControllerGetAll().then(
|
||||||
|
(val) => {
|
||||||
|
orgs = val;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
let page = 0;
|
||||||
|
while (page >= 0) {
|
||||||
|
const runners = await RunnerService.runnerControllerGetAll(page, 500);
|
||||||
|
if (runners.length == 0) {
|
||||||
|
page = -2;
|
||||||
|
}
|
||||||
|
|
||||||
|
current_runners = current_runners.concat(...runners);
|
||||||
|
options.update((options) => ({
|
||||||
|
...options,
|
||||||
|
data: current_runners,
|
||||||
|
}));
|
||||||
|
|
||||||
|
dataLoaded = true;
|
||||||
|
page++;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
import { _ } from "svelte-i18n";
|
||||||
|
import store from "../../store";
|
||||||
|
import AddRunnerModal from "./AddRunnerModal.svelte";
|
||||||
|
import ImportRunnerModal from "./ImportRunnerModal.svelte";
|
||||||
|
$: current_runners = [];
|
||||||
|
export let modal_open = false;
|
||||||
|
export let import_modal_open = false;
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<section class="container p-5">
|
<section class="container p-5">
|
||||||
<h4 class="mb-1 text-3xl font-extrabold leading-tight">
|
<h4 class="mb-1 text-3xl font-extrabold leading-tight">
|
||||||
{$_("runners")}
|
{$_("runners")}
|
||||||
</h4>
|
</h4>
|
||||||
{#if store.state.jwtinfo.userdetails.permissions.includes("RUNNER:CREATE")}
|
{#if store.state.jwtinfo.userdetails.permissions.includes("RUNNER:CREATE")}
|
||||||
<button
|
<button
|
||||||
on:click={() => {
|
on:click={() => {
|
||||||
modal_open = true;
|
modal_open = true;
|
||||||
}}
|
}}
|
||||||
type="button"
|
type="button"
|
||||||
class="w-full inline-flex 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:w-auto sm:text-sm mt-1 sm:mt-0"
|
class="w-full inline-flex 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:w-auto sm:text-sm mb-1 lg:mb-0"
|
||||||
>
|
>
|
||||||
{$_("laeufer-hinzufuegen")}
|
{$_("laeufer-hinzufuegen")}
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
on:click={() => {
|
on:click={() => {
|
||||||
import_modal_open = true;
|
import_modal_open = true;
|
||||||
}}
|
}}
|
||||||
type="button"
|
type="button"
|
||||||
class="w-full inline-flex 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:w-auto sm:text-sm mt-1 sm:mt-0"
|
class="w-full inline-flex 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:w-auto sm:text-sm mb-1 lg:mb-0"
|
||||||
>
|
>
|
||||||
{$_("import-runners")}
|
{$_("import-runners")}
|
||||||
</button>
|
</button>
|
||||||
{/if}
|
{/if}
|
||||||
<RunnersOverview bind:current_runners bind:addRunners />
|
<DeleteRunnerModal
|
||||||
|
delete_runner={active_delete}
|
||||||
|
modal_open={active_delete != undefined}
|
||||||
|
on:delete={(event) => {
|
||||||
|
deleteRunner(event.detail.id);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
{#if store.state.jwtinfo.userdetails.permissions.includes("RUNNER:GET")}
|
||||||
|
{#if !dataLoaded}
|
||||||
|
<div
|
||||||
|
class="bg-teal-lightest border-t-4 border-teal rounded-b text-teal-darkest px-4 py-3 shadow-md my-2"
|
||||||
|
role="alert"
|
||||||
|
>
|
||||||
|
<p class="font-bold">{$_("runners-are-being-loaded")}</p>
|
||||||
|
<p class="text-sm">{$_("this-might-take-a-moment")}</p>
|
||||||
|
</div>
|
||||||
|
{:else}
|
||||||
|
<GenerateSponsoringContracts
|
||||||
|
bind:sponsoring_contracts_show
|
||||||
|
bind:generate_runners={selectedRunners}
|
||||||
|
/>
|
||||||
|
<GenerateRunnerCards
|
||||||
|
bind:cards_show
|
||||||
|
bind:generate_runners={selectedRunners}
|
||||||
|
/>
|
||||||
|
<GenerateRunnerCertificates
|
||||||
|
bind:certificates_show
|
||||||
|
bind:generate_runners={selectedRunners}
|
||||||
|
/>
|
||||||
|
<div class="overflow-x-auto">
|
||||||
|
<table class="w-full">
|
||||||
|
<thead class="border-b border-gray-400">
|
||||||
|
{#each $table.getHeaderGroups() as headerGroup}
|
||||||
|
<tr class="select-none">
|
||||||
|
<th class="inset-y-0 left-0 px-4 py-2 text-left w-px">
|
||||||
|
<InputElement
|
||||||
|
type="checkbox"
|
||||||
|
checked={$table.getIsAllRowsSelected()}
|
||||||
|
indeterminate={$table.getIsSomeRowsSelected()}
|
||||||
|
on:change={() => $table.toggleAllRowsSelected()}
|
||||||
|
/>
|
||||||
|
</th>
|
||||||
|
{#each headerGroup.headers as header}
|
||||||
|
<TableHeader {header} />
|
||||||
|
{/each}
|
||||||
|
</tr>
|
||||||
|
{/each}
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
{#each $table.getRowModel().rows as row}
|
||||||
|
<tr class="odd:bg-white even:bg-gray-100">
|
||||||
|
<td class="inset-y-0 left-0 px-4 py-2 text-center w-px">
|
||||||
|
<InputElement
|
||||||
|
type="checkbox"
|
||||||
|
checked={row.getIsSelected()}
|
||||||
|
on:change={() => row.toggleSelected()}
|
||||||
|
/>
|
||||||
|
</td>
|
||||||
|
{#each row.getVisibleCells() as cell}
|
||||||
|
<td>
|
||||||
|
<svelte:component
|
||||||
|
this={flexRender(
|
||||||
|
cell.column.columnDef.cell,
|
||||||
|
cell.getContext()
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
</td>
|
||||||
|
{/each}
|
||||||
|
</tr>
|
||||||
|
{/each}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<div class="h-2" />
|
||||||
|
{/if}
|
||||||
|
{/if}
|
||||||
|
<TableBottom {table} {selected} />
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
{#if store.state.jwtinfo.userdetails.permissions.includes("RUNNER:CREATE")}
|
{#if store.state.jwtinfo.userdetails.permissions.includes("RUNNER:CREATE")}
|
||||||
<AddRunnerModal
|
<AddRunnerModal
|
||||||
bind:modal_open
|
bind:modal_open
|
||||||
on:created={(event) => {
|
on:created={(event) => {
|
||||||
addRunners(event.detail.runners);
|
addRunners(event.detail.runners);
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<ImportRunnerModal
|
<ImportRunnerModal
|
||||||
on:cancelDelete={(event) => {
|
on:cancelDelete={(event) => {
|
||||||
import_modal_open = false;
|
import_modal_open = false;
|
||||||
}}
|
}}
|
||||||
passed_team={{}}
|
passed_team={{}}
|
||||||
passed_orgs={[]}
|
passed_orgs={[]}
|
||||||
passed_org={{}}
|
passed_org={{}}
|
||||||
opened_from="RunnerOverview"
|
opened_from="RunnerOverview"
|
||||||
bind:import_modal_open
|
bind:import_modal_open
|
||||||
on:created={(event) => {
|
on:created={(event) => {
|
||||||
addRunners(event.detail.runners);
|
addRunners(event.detail.runners);
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
|
<style>
|
||||||
|
table tbody tr td:nth-child(2) {
|
||||||
|
font-family: monospace;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|||||||
@@ -1,267 +0,0 @@
|
|||||||
<script>
|
|
||||||
import {
|
|
||||||
RunnerOrganizationService,
|
|
||||||
RunnerService,
|
|
||||||
RunnerTeamService,
|
|
||||||
} from "@odit/lfk-client-js";
|
|
||||||
import {
|
|
||||||
createSvelteTable,
|
|
||||||
flexRender,
|
|
||||||
getCoreRowModel,
|
|
||||||
getFilteredRowModel,
|
|
||||||
getPaginationRowModel,
|
|
||||||
getSortedRowModel,
|
|
||||||
renderComponent,
|
|
||||||
} from "@tanstack/svelte-table";
|
|
||||||
import { onMount } from "svelte";
|
|
||||||
import { _ } from "svelte-i18n";
|
|
||||||
import { writable } from "svelte/store";
|
|
||||||
import store from "../../store";
|
|
||||||
import GenerateRunnerCards from "../pdf_generation/GenerateRunnerCards.svelte";
|
|
||||||
import GenerateRunnerCertificates from "../pdf_generation/GenerateRunnerCertificates.svelte";
|
|
||||||
import GenerateSponsoringContracts from "../pdf_generation/GenerateSponsoringContracts.svelte";
|
|
||||||
import InputElement from "../shared/InputElement.svelte";
|
|
||||||
import TableActions from "../shared/TableActions.svelte";
|
|
||||||
import { groupFilter } from "../shared/tablefilters";
|
|
||||||
import DeleteRunnerModal from "./DeleteRunnerModal.svelte";
|
|
||||||
import TableBottom from "../shared/TableBottom.svelte";
|
|
||||||
import TableHeader from "../shared/TableHeader.svelte";
|
|
||||||
|
|
||||||
$: selectedRunners =
|
|
||||||
$table?.getSelectedRowModel().rows.map((row) => row.original) || [];
|
|
||||||
$: selected =
|
|
||||||
$table?.getSelectedRowModel().rows.map((row) => row.index) || [];
|
|
||||||
|
|
||||||
$: active_delete = undefined;
|
|
||||||
let dataLoaded = false;
|
|
||||||
export let current_runners = [];
|
|
||||||
$: sponsoring_contracts_show = selected.length > 0;
|
|
||||||
$: cards_show = selected.length > 0;
|
|
||||||
$: certificates_show = selected.length > 0;
|
|
||||||
$: teams = [];
|
|
||||||
$: orgs = [];
|
|
||||||
|
|
||||||
export const addRunners = (runners) => {
|
|
||||||
current_runners = current_runners.concat(...runners);
|
|
||||||
options.update((options) => ({
|
|
||||||
...options,
|
|
||||||
data: current_runners,
|
|
||||||
}));
|
|
||||||
};
|
|
||||||
|
|
||||||
//Section table
|
|
||||||
const columns = [
|
|
||||||
{
|
|
||||||
accessorKey: "id",
|
|
||||||
header: () => "id",
|
|
||||||
filterFn: `equalsString`,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
accessorKey: "firstname",
|
|
||||||
header: () => $_("first-name"),
|
|
||||||
filterFn: `includesString`,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
accessorKey: "middlename",
|
|
||||||
header: () => $_("middle-name"),
|
|
||||||
cell: (info) => {
|
|
||||||
if (!info || !info.getValue()) {
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
return info.getValue();
|
|
||||||
},
|
|
||||||
filterFn: `includesString`,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
accessorKey: "lastname",
|
|
||||||
header: () => $_("last-name"),
|
|
||||||
filterFn: `includesString`,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
accessorKey: "group",
|
|
||||||
header: () => $_("group"),
|
|
||||||
cell: (info) => {
|
|
||||||
const group = info.getValue();
|
|
||||||
if (group.responseType === "RUNNERORGANIZATION") {
|
|
||||||
return group.name;
|
|
||||||
}
|
|
||||||
return `${group.parentGroup.name} > ${group.name}`;
|
|
||||||
},
|
|
||||||
filterFn: `group`,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
accessorKey: "distance",
|
|
||||||
header: () => $_("distance"),
|
|
||||||
cell: (info) => {
|
|
||||||
if (info.getValue() < 1000) {
|
|
||||||
return `${info.getValue()} m`;
|
|
||||||
}
|
|
||||||
return `${(info.getValue() / 1000).toFixed(1)} km`;
|
|
||||||
},
|
|
||||||
enableColumnFilter: false,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
accessorKey: "actions",
|
|
||||||
header: () => $_("action"),
|
|
||||||
cell: (info) => {
|
|
||||||
return renderComponent(TableActions, {
|
|
||||||
detailsLink: `./${info.row.original.id}`,
|
|
||||||
deleteAction: () => {
|
|
||||||
active_delete =
|
|
||||||
current_runners[
|
|
||||||
current_runners.findIndex((r) => r.id == info.row.original.id)
|
|
||||||
];
|
|
||||||
},
|
|
||||||
deleteEnabled:
|
|
||||||
store.state.jwtinfo.userdetails.permissions.includes(
|
|
||||||
"RUNNER:DELETE"
|
|
||||||
),
|
|
||||||
});
|
|
||||||
},
|
|
||||||
enableColumnFilter: false,
|
|
||||||
enableSorting: false,
|
|
||||||
},
|
|
||||||
];
|
|
||||||
const options = writable({
|
|
||||||
data: [],
|
|
||||||
columns: columns,
|
|
||||||
filterFns: {
|
|
||||||
group: groupFilter,
|
|
||||||
},
|
|
||||||
initialState: {
|
|
||||||
pagination: {
|
|
||||||
pageSize: 50,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
enableRowSelection: true,
|
|
||||||
getCoreRowModel: getCoreRowModel(),
|
|
||||||
getFilteredRowModel: getFilteredRowModel(),
|
|
||||||
getPaginationRowModel: getPaginationRowModel(),
|
|
||||||
getSortedRowModel: getSortedRowModel(),
|
|
||||||
});
|
|
||||||
const table = createSvelteTable(options);
|
|
||||||
|
|
||||||
async function deleteRunner(delete_runner_id) {
|
|
||||||
await RunnerService.runnerControllerRemove(delete_runner_id, true);
|
|
||||||
current_runners = current_runners.filter((r) => r.id !== delete_runner_id);
|
|
||||||
options.update((options) => ({
|
|
||||||
...options,
|
|
||||||
data: current_runners,
|
|
||||||
}));
|
|
||||||
toast($_("runner-deleted"));
|
|
||||||
}
|
|
||||||
|
|
||||||
onMount(async () => {
|
|
||||||
RunnerTeamService.runnerTeamControllerGetAll().then((val) => {
|
|
||||||
teams = val;
|
|
||||||
});
|
|
||||||
RunnerOrganizationService.runnerOrganizationControllerGetAll().then(
|
|
||||||
(val) => {
|
|
||||||
orgs = val;
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
let page = 0;
|
|
||||||
while (page >= 0) {
|
|
||||||
const runners = await RunnerService.runnerControllerGetAll(page, 500);
|
|
||||||
if (runners.length == 0) {
|
|
||||||
page = -2;
|
|
||||||
}
|
|
||||||
|
|
||||||
current_runners = current_runners.concat(...runners);
|
|
||||||
options.update((options) => ({
|
|
||||||
...options,
|
|
||||||
data: current_runners,
|
|
||||||
}));
|
|
||||||
|
|
||||||
dataLoaded = true;
|
|
||||||
page++;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<DeleteRunnerModal
|
|
||||||
delete_runner={active_delete}
|
|
||||||
modal_open={active_delete != undefined}
|
|
||||||
on:delete={(event) => {
|
|
||||||
deleteRunner(event.detail.id);
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
{#if store.state.jwtinfo.userdetails.permissions.includes("RUNNER:GET")}
|
|
||||||
{#if !dataLoaded}
|
|
||||||
<div
|
|
||||||
class="bg-teal-lightest border-t-4 border-teal rounded-b text-teal-darkest px-4 py-3 shadow-md my-2"
|
|
||||||
role="alert"
|
|
||||||
>
|
|
||||||
<p class="font-bold">{$_("runners-are-being-loaded")}</p>
|
|
||||||
<p class="text-sm">{$_("this-might-take-a-moment")}</p>
|
|
||||||
</div>
|
|
||||||
{:else}
|
|
||||||
<div class="h-12 mt-2">
|
|
||||||
<GenerateSponsoringContracts
|
|
||||||
bind:sponsoring_contracts_show
|
|
||||||
bind:generate_runners={selectedRunners}
|
|
||||||
/>
|
|
||||||
<GenerateRunnerCards
|
|
||||||
bind:cards_show
|
|
||||||
bind:generate_runners={selectedRunners}
|
|
||||||
/>
|
|
||||||
<GenerateRunnerCertificates
|
|
||||||
bind:certificates_show
|
|
||||||
bind:generate_runners={selectedRunners}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div class="overflow-x-auto">
|
|
||||||
<table class="w-full">
|
|
||||||
<thead class="border-b border-gray-400">
|
|
||||||
{#each $table.getHeaderGroups() as headerGroup}
|
|
||||||
<tr class="select-none">
|
|
||||||
<th class="inset-y-0 left-0 px-4 py-2 text-left w-px">
|
|
||||||
<InputElement
|
|
||||||
type="checkbox"
|
|
||||||
checked={$table.getIsAllRowsSelected()}
|
|
||||||
indeterminate={$table.getIsSomeRowsSelected()}
|
|
||||||
on:change={() => $table.toggleAllRowsSelected()}
|
|
||||||
/>
|
|
||||||
</th>
|
|
||||||
{#each headerGroup.headers as header}
|
|
||||||
<TableHeader {header} />
|
|
||||||
{/each}
|
|
||||||
</tr>
|
|
||||||
{/each}
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
{#each $table.getRowModel().rows as row}
|
|
||||||
<tr class="odd:bg-white even:bg-gray-100">
|
|
||||||
<td class="inset-y-0 left-0 px-4 py-2 text-center w-px">
|
|
||||||
<InputElement
|
|
||||||
type="checkbox"
|
|
||||||
checked={row.getIsSelected()}
|
|
||||||
on:change={() => row.toggleSelected()}
|
|
||||||
/>
|
|
||||||
</td>
|
|
||||||
{#each row.getVisibleCells() as cell}
|
|
||||||
<td>
|
|
||||||
<svelte:component
|
|
||||||
this={flexRender(
|
|
||||||
cell.column.columnDef.cell,
|
|
||||||
cell.getContext()
|
|
||||||
)}
|
|
||||||
/>
|
|
||||||
</td>
|
|
||||||
{/each}
|
|
||||||
</tr>
|
|
||||||
{/each}
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
<div class="h-2" />
|
|
||||||
{/if}
|
|
||||||
{/if}
|
|
||||||
<TableBottom {table} {selected} />
|
|
||||||
|
|
||||||
<style>
|
|
||||||
table tbody tr td:nth-child(2) {
|
|
||||||
font-family: monospace;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -169,7 +169,7 @@
|
|||||||
class:opacity-50={!save_enabled}
|
class:opacity-50={!save_enabled}
|
||||||
type="button"
|
type="button"
|
||||||
on:click={submit}
|
on:click={submit}
|
||||||
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:w-auto sm:text-sm"
|
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:w-auto sm:text-sm mb-1 lg:mb-0"
|
||||||
>{$_("save-changes")}</button
|
>{$_("save-changes")}</button
|
||||||
>
|
>
|
||||||
{/if}
|
{/if}
|
||||||
|
|||||||
@@ -125,7 +125,7 @@
|
|||||||
class:opacity-50={!save_enabled}
|
class:opacity-50={!save_enabled}
|
||||||
type="button"
|
type="button"
|
||||||
on:click={submit}
|
on:click={submit}
|
||||||
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:w-auto sm:text-sm"
|
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:w-auto sm:text-sm mb-1 lg:mb-0"
|
||||||
>{$_("save-changes")}</button
|
>{$_("save-changes")}</button
|
||||||
>
|
>
|
||||||
{/if}
|
{/if}
|
||||||
|
|||||||
@@ -161,7 +161,7 @@
|
|||||||
disabled={!save_enabled}
|
disabled={!save_enabled}
|
||||||
class:opacity-50={!save_enabled}
|
class:opacity-50={!save_enabled}
|
||||||
on:click={submit}
|
on:click={submit}
|
||||||
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:w-auto sm:text-sm"
|
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:w-auto sm:text-sm mb-1 lg:mb-0"
|
||||||
>
|
>
|
||||||
{$_("save-changes")}
|
{$_("save-changes")}
|
||||||
</button>
|
</button>
|
||||||
@@ -225,7 +225,7 @@
|
|||||||
disabled={!update_password_enabled}
|
disabled={!update_password_enabled}
|
||||||
class:opacity-50={!update_password_enabled}
|
class:opacity-50={!update_password_enabled}
|
||||||
on:click={changePassword}
|
on:click={changePassword}
|
||||||
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:w-auto sm:text-sm"
|
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:w-auto sm:text-sm mb-1 lg:mb-0"
|
||||||
>
|
>
|
||||||
{$_("update-password")}
|
{$_("update-password")}
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
@@ -139,7 +139,7 @@
|
|||||||
{group.label}{" > "}
|
{group.label}{" > "}
|
||||||
{/if}
|
{/if}
|
||||||
{original.name} [#{params.teamid}]
|
{original.name} [#{params.teamid}]
|
||||||
<span data-id="org_actions_${teamdata.id}">
|
<div data-id="org_actions_${teamdata.id}">
|
||||||
<GenerateSponsoringContracts
|
<GenerateSponsoringContracts
|
||||||
bind:sponsoring_contracts_show
|
bind:sponsoring_contracts_show
|
||||||
bind:generate_teams
|
bind:generate_teams
|
||||||
@@ -192,11 +192,11 @@
|
|||||||
disabled={!save_enabled}
|
disabled={!save_enabled}
|
||||||
class:opacity-50={!save_enabled}
|
class:opacity-50={!save_enabled}
|
||||||
type="button"
|
type="button"
|
||||||
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:w-auto sm:text-sm"
|
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:w-auto sm:text-sm mb-1 lg:mb-0"
|
||||||
>{$_("save-changes")}</button
|
>{$_("save-changes")}</button
|
||||||
>
|
>
|
||||||
{/if}
|
{/if}
|
||||||
</span>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="text-sm w-full mt-2">
|
<div class="text-sm w-full mt-2">
|
||||||
<label for="name" class="font-semibold text-gray-700">Name</label>
|
<label for="name" class="font-semibold text-gray-700">Name</label>
|
||||||
|
|||||||
@@ -1,30 +1,262 @@
|
|||||||
<script>
|
<script>
|
||||||
import { _ } from "svelte-i18n";
|
import AddTeamModal from "./AddTeamModal.svelte";
|
||||||
import store from "../../store";
|
let current_teams = [];
|
||||||
import AddTeamModal from "./AddTeamModal.svelte";
|
import { _ } from "svelte-i18n";
|
||||||
export let modal_open = false;
|
import { RunnerTeamService } from "@odit/lfk-client-js";
|
||||||
import TeamsOverview from "./TeamsOverview.svelte";
|
const teams_promise = RunnerTeamService.runnerTeamControllerGetAll();
|
||||||
let current_teams = [];
|
import store, { users as usersstore } from "../../store.js";
|
||||||
|
import TeamsEmptyState from "./TeamsEmptyState.svelte";
|
||||||
|
import ConfirmTeamDeletion from "./ConfirmTeamDeletion.svelte";
|
||||||
|
import GenerateSponsoringContracts from "../pdf_generation/GenerateSponsoringContracts.svelte";
|
||||||
|
import GenerateRunnerCards from "../pdf_generation/GenerateRunnerCards.svelte";
|
||||||
|
import GenerateRunnerCertificates from "../pdf_generation/GenerateRunnerCertificates.svelte";
|
||||||
|
import toast from "svelte-french-toast";
|
||||||
|
$: searchvalue = "";
|
||||||
|
$: active_deletes = [];
|
||||||
|
$: sponsoring_contracts_show = current_teams.some(
|
||||||
|
(r) => r.is_selected === true
|
||||||
|
);
|
||||||
|
$: cards_show = current_teams.some((r) => r.is_selected === true);
|
||||||
|
$: certificates_show = current_teams.some((r) => r.is_selected === true);
|
||||||
|
$: generate_teams = current_teams.filter((r) => r.is_selected === true);
|
||||||
|
let modal_open = false;
|
||||||
|
let delete_team = {};
|
||||||
|
usersstore.subscribe((val) => {
|
||||||
|
current_teams = val;
|
||||||
|
});
|
||||||
|
teams_promise.then((data) => {
|
||||||
|
usersstore.set(data);
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<section class="container p-5">
|
<section class="container p-5">
|
||||||
<h4 class="mb-1 text-3xl font-extrabold leading-tight">
|
<h4 class="mb-1 text-3xl font-extrabold leading-tight">
|
||||||
{$_("teams")}
|
{$_("teams")}
|
||||||
</h4>
|
</h4>
|
||||||
{#if store.state.jwtinfo.userdetails.permissions.includes("TEAM:CREATE")}
|
{#if store.state.jwtinfo.userdetails.permissions.includes("TEAM:CREATE")}
|
||||||
<button
|
<button
|
||||||
on:click={() => {
|
on:click={() => {
|
||||||
modal_open = true;
|
modal_open = true;
|
||||||
}}
|
}}
|
||||||
type="button"
|
type="button"
|
||||||
class="w-full inline-flex 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:w-auto sm:text-sm"
|
class="w-full inline-flex 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:w-auto sm:text-sm"
|
||||||
>
|
>
|
||||||
{$_("create-team")}
|
{$_("create-team")}
|
||||||
</button>
|
</button>
|
||||||
{/if}
|
{/if}
|
||||||
<TeamsOverview bind:current_teams />
|
<ConfirmTeamDeletion
|
||||||
|
on:cancelDelete={(event) => {
|
||||||
|
modal_open = false;
|
||||||
|
active_deletes[event.detail.id] = false;
|
||||||
|
}}
|
||||||
|
bind:modal_open
|
||||||
|
bind:delete_team
|
||||||
|
/>
|
||||||
|
{#if store.state.jwtinfo.userdetails.permissions.includes("TEAM:GET")}
|
||||||
|
{#await teams_promise}
|
||||||
|
<div
|
||||||
|
class="bg-teal-lightest border-t-4 border-teal rounded-b text-teal-darkest px-4 py-3 shadow-md my-2"
|
||||||
|
role="alert"
|
||||||
|
>
|
||||||
|
<p class="font-bold">{$_("teams-are-being-loaded")}</p>
|
||||||
|
<p class="text-sm">{$_("this-might-take-a-moment")}</p>
|
||||||
|
</div>
|
||||||
|
{:then}
|
||||||
|
{#if current_teams.length === 0}
|
||||||
|
<TeamsEmptyState />
|
||||||
|
{:else}
|
||||||
|
<input
|
||||||
|
type="search"
|
||||||
|
bind:value={searchvalue}
|
||||||
|
placeholder={$_("datatable.search")}
|
||||||
|
aria-label={$_("datatable.search")}
|
||||||
|
class="mb-2 w-full sm:w-auto mt-1 sm:mt-0 p-2 rounded-md border"
|
||||||
|
/>
|
||||||
|
<GenerateSponsoringContracts
|
||||||
|
bind:sponsoring_contracts_show
|
||||||
|
bind:generate_teams
|
||||||
|
/>
|
||||||
|
<GenerateRunnerCards bind:cards_show bind:generate_teams />
|
||||||
|
<GenerateRunnerCertificates
|
||||||
|
bind:certificates_show
|
||||||
|
bind:generate_teams
|
||||||
|
/>
|
||||||
|
<div
|
||||||
|
class="shadow border-b border-gray-200 sm:rounded-lg overflow-x-scroll"
|
||||||
|
>
|
||||||
|
<table class="divide-y divide-gray-200 w-full">
|
||||||
|
<thead class="bg-gray-50">
|
||||||
|
<tr class="odd:bg-white even:bg-gray-100">
|
||||||
|
<th
|
||||||
|
scope="col"
|
||||||
|
class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"
|
||||||
|
>
|
||||||
|
<button
|
||||||
|
on:click={() => {
|
||||||
|
const newstate = !current_teams.some(
|
||||||
|
(r) => r.is_selected === true
|
||||||
|
);
|
||||||
|
current_teams = current_teams.map((r) => {
|
||||||
|
r.is_selected = newstate;
|
||||||
|
return r;
|
||||||
|
});
|
||||||
|
}}
|
||||||
|
class="underline cursor-pointer select-none"
|
||||||
|
>{#if current_teams.some((r) => r.is_selected === true)}
|
||||||
|
{$_("deselect-all")}
|
||||||
|
{:else}{$_("select-all")}{/if}
|
||||||
|
</button>
|
||||||
|
</th>
|
||||||
|
<th
|
||||||
|
scope="col"
|
||||||
|
class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"
|
||||||
|
>
|
||||||
|
{$_("name")}
|
||||||
|
</th>
|
||||||
|
<th
|
||||||
|
scope="col"
|
||||||
|
class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"
|
||||||
|
>
|
||||||
|
{$_("organization")}
|
||||||
|
</th>
|
||||||
|
<th
|
||||||
|
scope="col"
|
||||||
|
class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"
|
||||||
|
>
|
||||||
|
{$_("contact")}
|
||||||
|
</th>
|
||||||
|
<th scope="col" class="relative px-6 py-3">
|
||||||
|
<span class="sr-only">{$_("action")}</span>
|
||||||
|
</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody class="divide-y divide-gray-200">
|
||||||
|
{#each current_teams as t}
|
||||||
|
{#if Object.values(t)
|
||||||
|
.toString()
|
||||||
|
.toLowerCase()
|
||||||
|
.includes(searchvalue)}
|
||||||
|
<tr
|
||||||
|
class="odd:bg-white even:bg-gray-100"
|
||||||
|
data-rowid="team_{t.id}"
|
||||||
|
>
|
||||||
|
<td class="px-6 py-4 whitespace-nowrap">
|
||||||
|
<input
|
||||||
|
bind:checked={t.is_selected}
|
||||||
|
type="checkbox"
|
||||||
|
class="focus:ring-indigo-500 h-4 w-4 text-indigo-600 border-gray-300 rounded"
|
||||||
|
/>
|
||||||
|
</td>
|
||||||
|
<td class="px-6 py-4 whitespace-nowrap">
|
||||||
|
<div class="flex items-center">
|
||||||
|
<div class="text-sm font-medium text-gray-900">
|
||||||
|
{t.name}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td class="px-6 py-4 whitespace-nowrap">
|
||||||
|
<div class="flex items-center">
|
||||||
|
<div class="text-sm font-medium text-gray-900">
|
||||||
|
{#if t.parentGroup}
|
||||||
|
<a
|
||||||
|
href="../orgs/{t.parentGroup.id}"
|
||||||
|
class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-gray-100 text-gray-800 border border-current"
|
||||||
|
>{t.parentGroup.name}</a
|
||||||
|
>
|
||||||
|
{:else}{$_("no-organization-specified")}{/if}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td class="px-6 py-4 whitespace-nowrap">
|
||||||
|
<div class="flex items-center">
|
||||||
|
<div class="text-sm font-medium text-gray-900">
|
||||||
|
{#if t.contact}
|
||||||
|
<a
|
||||||
|
href="../contacts/{t.contact.id}"
|
||||||
|
class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-gray-100 text-gray-800 border border-current"
|
||||||
|
>{t.contact.firstname}
|
||||||
|
{t.contact.middlename || ""}
|
||||||
|
{t.contact.lastname}</a
|
||||||
|
>
|
||||||
|
{:else}{$_("no-contact-specified")}{/if}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
{#if active_deletes[t.id] === true}
|
||||||
|
<td
|
||||||
|
class="px-6 py-4 whitespace-nowrap text-right text-sm font-medium"
|
||||||
|
>
|
||||||
|
<button
|
||||||
|
on:click={() => {
|
||||||
|
active_deletes[t.id] = false;
|
||||||
|
}}
|
||||||
|
tabindex="0"
|
||||||
|
class="ml-4 text-indigo-600 hover:text-indigo-900 cursor-pointer"
|
||||||
|
>{$_("cancel-delete")}</button
|
||||||
|
>
|
||||||
|
<button
|
||||||
|
on:click={() => {
|
||||||
|
RunnerTeamService.runnerTeamControllerRemove(
|
||||||
|
t.id,
|
||||||
|
false
|
||||||
|
)
|
||||||
|
.then((resp) => {
|
||||||
|
current_teams = current_teams.filter(
|
||||||
|
(obj) => obj.id !== t.id
|
||||||
|
);
|
||||||
|
toast($_("team-deleted"));
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
modal_open = true;
|
||||||
|
delete_team = t;
|
||||||
|
});
|
||||||
|
}}
|
||||||
|
tabindex="0"
|
||||||
|
class="ml-4 text-red-600 hover:text-red-900 cursor-pointer"
|
||||||
|
>{$_("confirm-delete")}</button
|
||||||
|
>
|
||||||
|
</td>
|
||||||
|
{:else}
|
||||||
|
<td
|
||||||
|
class="px-6 py-4 whitespace-nowrap text-right text-sm font-medium"
|
||||||
|
>
|
||||||
|
<a
|
||||||
|
href="./{t.id}"
|
||||||
|
class="text-indigo-600 hover:text-indigo-900"
|
||||||
|
>{$_("details")}</a
|
||||||
|
>
|
||||||
|
{#if store.state.jwtinfo.userdetails.permissions.includes("TEAM:DELETE")}
|
||||||
|
<button
|
||||||
|
on:click={() => {
|
||||||
|
active_deletes[t.id] = true;
|
||||||
|
}}
|
||||||
|
tabindex="0"
|
||||||
|
class="ml-4 text-red-600 hover:text-red-900 cursor-pointer"
|
||||||
|
>{$_("delete")}</button
|
||||||
|
>
|
||||||
|
{/if}
|
||||||
|
</td>
|
||||||
|
{/if}
|
||||||
|
</tr>
|
||||||
|
{/if}
|
||||||
|
{/each}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
|
{:catch error}
|
||||||
|
<div
|
||||||
|
class="text-white px-6 py-4 border-0 rounded relative mb-4 bg-red-500"
|
||||||
|
>
|
||||||
|
<span class="inline-block align-middle mr-8">
|
||||||
|
<b class="capitalize">{$_("general_promise_error")}</b>
|
||||||
|
{error}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
{/await}
|
||||||
|
{/if}
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
{#if store.state.jwtinfo.userdetails.permissions.includes("TEAM:CREATE")}
|
{#if store.state.jwtinfo.userdetails.permissions.includes("TEAM:CREATE")}
|
||||||
<AddTeamModal bind:current_teams bind:modal_open />
|
<AddTeamModal bind:current_teams bind:modal_open />
|
||||||
{/if}
|
{/if}
|
||||||
|
|||||||
@@ -1,241 +0,0 @@
|
|||||||
<script>
|
|
||||||
import { _ } from "svelte-i18n";
|
|
||||||
import { RunnerTeamService } from "@odit/lfk-client-js";
|
|
||||||
const teams_promise = RunnerTeamService.runnerTeamControllerGetAll();
|
|
||||||
import store, { users as usersstore } from "../../store.js";
|
|
||||||
import TeamsEmptyState from "./TeamsEmptyState.svelte";
|
|
||||||
import ConfirmTeamDeletion from "./ConfirmTeamDeletion.svelte";
|
|
||||||
import GenerateSponsoringContracts from "../pdf_generation/GenerateSponsoringContracts.svelte";
|
|
||||||
import GenerateRunnerCards from "../pdf_generation/GenerateRunnerCards.svelte";
|
|
||||||
import GenerateRunnerCertificates from "../pdf_generation/GenerateRunnerCertificates.svelte";
|
|
||||||
import toast from "svelte-french-toast";
|
|
||||||
$: searchvalue = "";
|
|
||||||
$: active_deletes = [];
|
|
||||||
$: sponsoring_contracts_show = current_teams.some(
|
|
||||||
(r) => r.is_selected === true
|
|
||||||
);
|
|
||||||
$: cards_show = current_teams.some((r) => r.is_selected === true);
|
|
||||||
$: certificates_show = current_teams.some((r) => r.is_selected === true);
|
|
||||||
$: generate_teams = current_teams.filter((r) => r.is_selected === true);
|
|
||||||
export let current_teams = [];
|
|
||||||
let modal_open = false;
|
|
||||||
let delete_team = {};
|
|
||||||
usersstore.subscribe((val) => {
|
|
||||||
current_teams = val;
|
|
||||||
});
|
|
||||||
teams_promise.then((data) => {
|
|
||||||
usersstore.set(data);
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<ConfirmTeamDeletion
|
|
||||||
on:cancelDelete={(event) => {
|
|
||||||
modal_open = false;
|
|
||||||
active_deletes[event.detail.id] = false;
|
|
||||||
}}
|
|
||||||
bind:modal_open
|
|
||||||
bind:delete_team
|
|
||||||
/>
|
|
||||||
{#if store.state.jwtinfo.userdetails.permissions.includes("TEAM:GET")}
|
|
||||||
{#await teams_promise}
|
|
||||||
<div
|
|
||||||
class="bg-teal-lightest border-t-4 border-teal rounded-b text-teal-darkest px-4 py-3 shadow-md my-2"
|
|
||||||
role="alert"
|
|
||||||
>
|
|
||||||
<p class="font-bold">{$_("teams-are-being-loaded")}</p>
|
|
||||||
<p class="text-sm">{$_("this-might-take-a-moment")}</p>
|
|
||||||
</div>
|
|
||||||
{:then}
|
|
||||||
{#if current_teams.length === 0}
|
|
||||||
<TeamsEmptyState />
|
|
||||||
{:else}
|
|
||||||
<input
|
|
||||||
type="search"
|
|
||||||
bind:value={searchvalue}
|
|
||||||
placeholder={$_("datatable.search")}
|
|
||||||
aria-label={$_("datatable.search")}
|
|
||||||
class="mb-2 w-full sm:w-auto mt-1 sm:mt-0 p-2 rounded-md border"
|
|
||||||
/>
|
|
||||||
<div class="h-12">
|
|
||||||
<GenerateSponsoringContracts
|
|
||||||
bind:sponsoring_contracts_show
|
|
||||||
bind:generate_teams
|
|
||||||
/>
|
|
||||||
<GenerateRunnerCards bind:cards_show bind:generate_teams />
|
|
||||||
<GenerateRunnerCertificates
|
|
||||||
bind:certificates_show
|
|
||||||
bind:generate_teams
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
class="shadow border-b border-gray-200 sm:rounded-lg overflow-x-scroll"
|
|
||||||
>
|
|
||||||
<table class="divide-y divide-gray-200 w-full">
|
|
||||||
<thead class="bg-gray-50">
|
|
||||||
<tr class="odd:bg-white even:bg-gray-100">
|
|
||||||
<th
|
|
||||||
scope="col"
|
|
||||||
class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"
|
|
||||||
>
|
|
||||||
<button
|
|
||||||
on:click={() => {
|
|
||||||
const newstate = !current_teams.some(
|
|
||||||
(r) => r.is_selected === true
|
|
||||||
);
|
|
||||||
current_teams = current_teams.map((r) => {
|
|
||||||
r.is_selected = newstate;
|
|
||||||
return r;
|
|
||||||
});
|
|
||||||
}}
|
|
||||||
class="underline cursor-pointer select-none"
|
|
||||||
>{#if current_teams.some((r) => r.is_selected === true)}
|
|
||||||
{$_("deselect-all")}
|
|
||||||
{:else}{$_("select-all")}{/if}
|
|
||||||
</button>
|
|
||||||
</th>
|
|
||||||
<th
|
|
||||||
scope="col"
|
|
||||||
class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"
|
|
||||||
>
|
|
||||||
{$_("name")}
|
|
||||||
</th>
|
|
||||||
<th
|
|
||||||
scope="col"
|
|
||||||
class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"
|
|
||||||
>
|
|
||||||
{$_("organization")}
|
|
||||||
</th>
|
|
||||||
<th
|
|
||||||
scope="col"
|
|
||||||
class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"
|
|
||||||
>
|
|
||||||
{$_("contact")}
|
|
||||||
</th>
|
|
||||||
<th scope="col" class="relative px-6 py-3">
|
|
||||||
<span class="sr-only">{$_("action")}</span>
|
|
||||||
</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody class="divide-y divide-gray-200">
|
|
||||||
{#each current_teams as t}
|
|
||||||
{#if Object.values(t)
|
|
||||||
.toString()
|
|
||||||
.toLowerCase()
|
|
||||||
.includes(searchvalue)}
|
|
||||||
<tr
|
|
||||||
class="odd:bg-white even:bg-gray-100"
|
|
||||||
data-rowid="team_{t.id}"
|
|
||||||
>
|
|
||||||
<td class="px-6 py-4 whitespace-nowrap">
|
|
||||||
<input
|
|
||||||
bind:checked={t.is_selected}
|
|
||||||
type="checkbox"
|
|
||||||
class="focus:ring-indigo-500 h-4 w-4 text-indigo-600 border-gray-300 rounded"
|
|
||||||
/>
|
|
||||||
</td>
|
|
||||||
<td class="px-6 py-4 whitespace-nowrap">
|
|
||||||
<div class="flex items-center">
|
|
||||||
<div class="text-sm font-medium text-gray-900">
|
|
||||||
{t.name}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</td>
|
|
||||||
<td class="px-6 py-4 whitespace-nowrap">
|
|
||||||
<div class="flex items-center">
|
|
||||||
<div class="text-sm font-medium text-gray-900">
|
|
||||||
{#if t.parentGroup}
|
|
||||||
<a
|
|
||||||
href="../orgs/{t.parentGroup.id}"
|
|
||||||
class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-gray-100 text-gray-800 border border-current"
|
|
||||||
>{t.parentGroup.name}</a
|
|
||||||
>
|
|
||||||
{:else}{$_("no-organization-specified")}{/if}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</td>
|
|
||||||
<td class="px-6 py-4 whitespace-nowrap">
|
|
||||||
<div class="flex items-center">
|
|
||||||
<div class="text-sm font-medium text-gray-900">
|
|
||||||
{#if t.contact}
|
|
||||||
<a
|
|
||||||
href="../contacts/{t.contact.id}"
|
|
||||||
class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-gray-100 text-gray-800 border border-current"
|
|
||||||
>{t.contact.firstname}
|
|
||||||
{t.contact.middlename || ""}
|
|
||||||
{t.contact.lastname}</a
|
|
||||||
>
|
|
||||||
{:else}{$_("no-contact-specified")}{/if}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</td>
|
|
||||||
{#if active_deletes[t.id] === true}
|
|
||||||
<td
|
|
||||||
class="px-6 py-4 whitespace-nowrap text-right text-sm font-medium"
|
|
||||||
>
|
|
||||||
<button
|
|
||||||
on:click={() => {
|
|
||||||
active_deletes[t.id] = false;
|
|
||||||
}}
|
|
||||||
tabindex="0"
|
|
||||||
class="ml-4 text-indigo-600 hover:text-indigo-900 cursor-pointer"
|
|
||||||
>{$_("cancel-delete")}</button
|
|
||||||
>
|
|
||||||
<button
|
|
||||||
on:click={() => {
|
|
||||||
RunnerTeamService.runnerTeamControllerRemove(
|
|
||||||
t.id,
|
|
||||||
false
|
|
||||||
)
|
|
||||||
.then((resp) => {
|
|
||||||
current_teams = current_teams.filter(
|
|
||||||
(obj) => obj.id !== t.id
|
|
||||||
);
|
|
||||||
toast($_("team-deleted"));
|
|
||||||
})
|
|
||||||
.catch((err) => {
|
|
||||||
modal_open = true;
|
|
||||||
delete_team = t;
|
|
||||||
});
|
|
||||||
}}
|
|
||||||
tabindex="0"
|
|
||||||
class="ml-4 text-red-600 hover:text-red-900 cursor-pointer"
|
|
||||||
>{$_("confirm-delete")}</button
|
|
||||||
>
|
|
||||||
</td>
|
|
||||||
{:else}
|
|
||||||
<td
|
|
||||||
class="px-6 py-4 whitespace-nowrap text-right text-sm font-medium"
|
|
||||||
>
|
|
||||||
<a
|
|
||||||
href="./{t.id}"
|
|
||||||
class="text-indigo-600 hover:text-indigo-900"
|
|
||||||
>{$_("details")}</a
|
|
||||||
>
|
|
||||||
{#if store.state.jwtinfo.userdetails.permissions.includes("TEAM:DELETE")}
|
|
||||||
<button
|
|
||||||
on:click={() => {
|
|
||||||
active_deletes[t.id] = true;
|
|
||||||
}}
|
|
||||||
tabindex="0"
|
|
||||||
class="ml-4 text-red-600 hover:text-red-900 cursor-pointer"
|
|
||||||
>{$_("delete")}</button
|
|
||||||
>
|
|
||||||
{/if}
|
|
||||||
</td>
|
|
||||||
{/if}
|
|
||||||
</tr>
|
|
||||||
{/if}
|
|
||||||
{/each}
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
{/if}
|
|
||||||
{:catch error}
|
|
||||||
<div class="text-white px-6 py-4 border-0 rounded relative mb-4 bg-red-500">
|
|
||||||
<span class="inline-block align-middle mr-8">
|
|
||||||
<b class="capitalize">{$_("general_promise_error")}</b>
|
|
||||||
{error}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
{/await}
|
|
||||||
{/if}
|
|
||||||
@@ -172,7 +172,7 @@
|
|||||||
class:opacity-50={!save_enabled}
|
class:opacity-50={!save_enabled}
|
||||||
type="button"
|
type="button"
|
||||||
on:click={submit}
|
on:click={submit}
|
||||||
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:w-auto sm:text-sm"
|
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:w-auto sm:text-sm mb-1 lg:mb-0"
|
||||||
>{$_("save-changes")}</button
|
>{$_("save-changes")}</button
|
||||||
>
|
>
|
||||||
{/if}
|
{/if}
|
||||||
|
|||||||
@@ -150,7 +150,7 @@
|
|||||||
class:opacity-50={save_enabled}
|
class:opacity-50={save_enabled}
|
||||||
type="button"
|
type="button"
|
||||||
on:click={submit}
|
on:click={submit}
|
||||||
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:w-auto sm:text-sm"
|
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:w-auto sm:text-sm mb-1 lg:mb-0"
|
||||||
>{$_("save-changes")}</button
|
>{$_("save-changes")}</button
|
||||||
>
|
>
|
||||||
{:else}
|
{:else}
|
||||||
|
|||||||
+5
-5
@@ -55,9 +55,9 @@
|
|||||||
"cancel-delete": "Löschen abbrechen",
|
"cancel-delete": "Löschen abbrechen",
|
||||||
"cancel-keep-donor": "Abbrechen, Sponsor behalten",
|
"cancel-keep-donor": "Abbrechen, Sponsor behalten",
|
||||||
"cancel-keep-my-profile": "Abbrechen, mein Profil behalten",
|
"cancel-keep-my-profile": "Abbrechen, mein Profil behalten",
|
||||||
"cancel-keep-organization": "Abbrechen und Organisation bearbeiten",
|
"cancel-keep-organization": "Abbrechen, Organisation behalten",
|
||||||
"cancel-keep-station": "Abbrechen und Station behalten",
|
"cancel-keep-station": "Abbrechen, Station behalten",
|
||||||
"cancel-keep-statsclient": "Abbrechen und Statsclient behalten",
|
"cancel-keep-statsclient": "Abbrechen, Statsclient behalten",
|
||||||
"cancel-keep-team": "Abbrechen, Team behalten",
|
"cancel-keep-team": "Abbrechen, Team behalten",
|
||||||
"cannot-reset-your-password-directly": "Schade. \nWir können das Passwort leider nicht direkt zurücksetzen.\nBitte sende uns eine Mail in der du deine Identität bestätigst.",
|
"cannot-reset-your-password-directly": "Schade. \nWir können das Passwort leider nicht direkt zurücksetzen.\nBitte sende uns eine Mail in der du deine Identität bestätigst.",
|
||||||
"card": "Läuferkarte",
|
"card": "Läuferkarte",
|
||||||
@@ -79,7 +79,7 @@
|
|||||||
"confirm-delete": "Löschung Bestätigen",
|
"confirm-delete": "Löschung Bestätigen",
|
||||||
"confirm-delete-donor-with-all-donations": "Bestätigen, Sponsor mit allen Sponsorings löschen",
|
"confirm-delete-donor-with-all-donations": "Bestätigen, Sponsor mit allen Sponsorings löschen",
|
||||||
"confirm-delete-my-user-profile": "Bestätigung, mein Benutzerprofil löschen",
|
"confirm-delete-my-user-profile": "Bestätigung, mein Benutzerprofil löschen",
|
||||||
"confirm-delete-organization-and-associated-teams-runners": "Bestätugung, lösche die Organisation und alle zugehörigen Teams und Läufer.",
|
"confirm-delete-organization-and-associated-teams-runners": "Organisation & alle zugehörigen Teams und Läufer löschen",
|
||||||
"confirm-delete-station-with-all-scans": "Löschen der Scannerstation mit allen Scans bestätigen",
|
"confirm-delete-station-with-all-scans": "Löschen der Scannerstation mit allen Scans bestätigen",
|
||||||
"confirm-delete-statsclient": "Bestätigung, Statsclient löschen",
|
"confirm-delete-statsclient": "Bestätigung, Statsclient löschen",
|
||||||
"confirm-delete-team-and-associated-runners": "Bestätigung, lösche das Team mitsamt seinen Läufern.",
|
"confirm-delete-team-and-associated-runners": "Bestätigung, lösche das Team mitsamt seinen Läufern.",
|
||||||
@@ -181,7 +181,7 @@
|
|||||||
"distance-in-km": "Distanz (in KM)",
|
"distance-in-km": "Distanz (in KM)",
|
||||||
"distance-track": "Distanz (+Track)",
|
"distance-track": "Distanz (+Track)",
|
||||||
"do-you-really-want-to-delete-your-profile": "Möchtest du dein Profil wirklich löschen?",
|
"do-you-really-want-to-delete-your-profile": "Möchtest du dein Profil wirklich löschen?",
|
||||||
"do-you-want-to-delete-the-organization-delete_org-name": "Möchtest du die Organisation {orgname} löschen?",
|
"do-you-want-to-delete-the-organization-delete_org-name": "Organisation \"{orgname}\" löschen?",
|
||||||
"do-you-want-to-delete-the-team-delete_team-name": "Möchtest du das Team {teamname} löschen?",
|
"do-you-want-to-delete-the-team-delete_team-name": "Möchtest du das Team {teamname} löschen?",
|
||||||
"do-you-want-to-delete-this-donor-with-all-related-donations": "Möchtest du diese Sponsor mit all ihren Sponsorings löschen?",
|
"do-you-want-to-delete-this-donor-with-all-related-donations": "Möchtest du diese Sponsor mit all ihren Sponsorings löschen?",
|
||||||
"documentation": "Dokumentation",
|
"documentation": "Dokumentation",
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
|
darkMode: 'selector',
|
||||||
mode: "jit",
|
mode: "jit",
|
||||||
content: ["./src/**/*.svelte"],
|
content: ["./src/**/*.svelte"],
|
||||||
theme: {
|
theme: {
|
||||||
|
|||||||
Reference in New Issue
Block a user