diff --git a/src/components/cards/Cards.svelte b/src/components/cards/Cards.svelte index 8ea03d65..8d9b1695 100644 --- a/src/components/cards/Cards.svelte +++ b/src/components/cards/Cards.svelte @@ -20,7 +20,7 @@ modal_open = true; }} 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")} @@ -29,7 +29,7 @@ bulk_modal_open = true; }} 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")} diff --git a/src/components/contacts/ContactDetail.svelte b/src/components/contacts/ContactDetail.svelte index a47fe149..6194f270 100644 --- a/src/components/contacts/ContactDetail.svelte +++ b/src/components/contacts/ContactDetail.svelte @@ -162,7 +162,7 @@ class:opacity-50={!save_enabled} type="button" 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")} {/if} diff --git a/src/components/donations/DonationDetail.svelte b/src/components/donations/DonationDetail.svelte index 570635e9..e499fa45 100644 --- a/src/components/donations/DonationDetail.svelte +++ b/src/components/donations/DonationDetail.svelte @@ -193,7 +193,7 @@ class:opacity-50={!save_enabled} type="button" 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")} {/if} diff --git a/src/components/donors/DonorDetail.svelte b/src/components/donors/DonorDetail.svelte index b14a997b..671c2f5e 100644 --- a/src/components/donors/DonorDetail.svelte +++ b/src/components/donors/DonorDetail.svelte @@ -153,7 +153,7 @@ class:opacity-50={!save_enabled} type="button" 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")} {/if} diff --git a/src/components/donors/Donors.svelte b/src/components/donors/Donors.svelte index 9442c46e..d8d27fee 100644 --- a/src/components/donors/Donors.svelte +++ b/src/components/donors/Donors.svelte @@ -18,7 +18,7 @@ modal_open = true; }} 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")} @@ -59,7 +59,7 @@ hiddenElement.remove(); }} 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")} diff --git a/src/components/groups/GroupDetail.svelte b/src/components/groups/GroupDetail.svelte index 79cfe1d3..45322631 100644 --- a/src/components/groups/GroupDetail.svelte +++ b/src/components/groups/GroupDetail.svelte @@ -146,7 +146,7 @@ class:opacity-50={!save_enabled} type="button" 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")} {/if} diff --git a/src/components/groups/GroupPermissions.svelte b/src/components/groups/GroupPermissions.svelte index 429c5f3a..5ed14d88 100644 --- a/src/components/groups/GroupPermissions.svelte +++ b/src/components/groups/GroupPermissions.svelte @@ -141,7 +141,7 @@ class:opacity-50={save_enabled} type="button" 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")} {:else} diff --git a/src/components/orgs/OrgDetail.svelte b/src/components/orgs/OrgDetail.svelte index b6634d71..0501718d 100644 --- a/src/components/orgs/OrgDetail.svelte +++ b/src/components/orgs/OrgDetail.svelte @@ -173,7 +173,7 @@
{original_object.name} [#{params.orgid}] - +
{$_("save-changes")} {/if} - +
diff --git a/src/components/orgs/OrgOverview.svelte b/src/components/orgs/OrgOverview.svelte deleted file mode 100644 index 5faa16f2..00000000 --- a/src/components/orgs/OrgOverview.svelte +++ /dev/null @@ -1,244 +0,0 @@ - - - { - 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} - - {:then} - {#if current_organizations.length === 0} - - {:else} - -
- - - -
-
- - - - - - - - - - - - {#each current_organizations as o} - {#if Object.values(o) - .toString() - .toLowerCase() - .includes(searchvalue)} - - - - - - {#if active_deletes[o.id] === true} - - {:else} - - {/if} - - {/if} - {/each} - -
- - - {$_("name")} - - {$_("address")} - - {$_("contact")} - - {$_("action")} -
- - -
-
- {o.name} -
-
-
-
-
- {#if o.address.address1 !== null} - {o.address.address1}
- - {o.address.postalcode} - {o.address.city} - {o.address.country} - {/if} -
-
-
-
-
- {#if o.contact} - {o.contact.firstname} - {o.contact.middlename || ""} - {o.contact.lastname} - {:else}{$_("no-contact-specified")}{/if} -
-
-
- - - - {$_("details")} - {#if store.state.jwtinfo.userdetails.permissions.includes("ORGANIZATION:DELETE")} - - {/if} -
-
- {/if} - {:catch error} -
- - {$_("general_promise_error")} - {error} - -
- {/await} -{/if} diff --git a/src/components/orgs/Orgs.svelte b/src/components/orgs/Orgs.svelte index 374c7132..655c043d 100644 --- a/src/components/orgs/Orgs.svelte +++ b/src/components/orgs/Orgs.svelte @@ -1,53 +1,288 @@
-

- {$_("organizations")} -

- {#if store.state.jwtinfo.userdetails.permissions.includes("ORGANIZATION:CREATE")} - - {/if} - {#if store.state.jwtinfo.userdetails.permissions.includes("RUNNER:IMPORT")} - - {/if} - +

+ {$_("organizations")} +

+ {#if store.state.jwtinfo.userdetails.permissions.includes("ORGANIZATION:CREATE")} + + {/if} + {#if store.state.jwtinfo.userdetails.permissions.includes("RUNNER:IMPORT")} + + {/if} + { + 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} + + {:then} + {#if current_organizations.length === 0} + + {:else} + + + + +
+ + + + + + + + + + + + {#each current_organizations as o} + {#if Object.values(o) + .toString() + .toLowerCase() + .includes(searchvalue)} + + + + + + {#if active_deletes[o.id] === true} + + {:else} + + {/if} + + {/if} + {/each} + +
+ + + {$_("name")} + + {$_("address")} + + {$_("contact")} + + {$_("action")} +
+ + +
+
+ {o.name} +
+
+
+
+
+ {#if o.address.address1 !== null} + {o.address.address1}
+ + {o.address.postalcode} + {o.address.city} + {o.address.country} + {/if} +
+
+
+
+
+ {#if o.contact} + {o.contact.firstname} + {o.contact.middlename || ""} + {o.contact.lastname} + {:else}{$_("no-contact-specified")}{/if} +
+
+
+ + + + {$_("details")} + {#if store.state.jwtinfo.userdetails.permissions.includes("ORGANIZATION:DELETE")} + + {/if} +
+
+ {/if} + {:catch error} +
+ + {$_("general_promise_error")} + {error} + +
+ {/await} + {/if}
{#if store.state.jwtinfo.userdetails.permissions.includes("ORGANIZATION:CREATE")} - - { - import_modal_open = false; - }} - passed_team={{}} - passed_org={{}} - passed_orgs={current_organizations} - opened_from="OrgOverview" - bind:import_modal_open - /> + + { + import_modal_open = false; + }} + passed_team={{}} + passed_org={{}} + passed_orgs={current_organizations} + opened_from="OrgOverview" + bind:import_modal_open + /> {/if} diff --git a/src/components/pdf_generation/GenerateRunnerCards.svelte b/src/components/pdf_generation/GenerateRunnerCards.svelte index 8deb31a5..35ca4d0a 100644 --- a/src/components/pdf_generation/GenerateRunnerCards.svelte +++ b/src/components/pdf_generation/GenerateRunnerCards.svelte @@ -178,25 +178,20 @@ {#if cards_show} -
-

{$_("generate-runnercards")}

-
- - -
-
+ + {/if} diff --git a/src/components/pdf_generation/GenerateRunnerCertificates.svelte b/src/components/pdf_generation/GenerateRunnerCertificates.svelte index 78b1f6d0..551fcd96 100644 --- a/src/components/pdf_generation/GenerateRunnerCertificates.svelte +++ b/src/components/pdf_generation/GenerateRunnerCertificates.svelte @@ -156,25 +156,20 @@ {#if certificates_show} -
-

{$_("generate-runner-certificates")}

-
- - -
-
+ + {/if} diff --git a/src/components/pdf_generation/GenerateSponsoringContracts.svelte b/src/components/pdf_generation/GenerateSponsoringContracts.svelte index fa204a52..31569542 100644 --- a/src/components/pdf_generation/GenerateSponsoringContracts.svelte +++ b/src/components/pdf_generation/GenerateSponsoringContracts.svelte @@ -119,25 +119,20 @@ {#if sponsoring_contracts_show} -
-

{$_("generate-sponsoring-contracts")}

-
- - -
-
+ + {/if} diff --git a/src/components/runners/RunnerDetail.svelte b/src/components/runners/RunnerDetail.svelte index 5c73ac16..ef59795c 100644 --- a/src/components/runners/RunnerDetail.svelte +++ b/src/components/runners/RunnerDetail.svelte @@ -125,20 +125,8 @@ {original_data.firstname} {original_data.middlename || ""} {original_data.lastname} [#{params.runnerid}] - + {#if store.state.jwtinfo.userdetails.permissions.includes("RUNNER:DELETE")} - - -
{#if delete_triggered} {/if} + + +
{/if}
@@ -259,7 +256,9 @@ {/if}
- + - import { _ } from "svelte-i18n"; - import store from "../../store"; - import AddRunnerModal from "./AddRunnerModal.svelte"; - import ImportRunnerModal from "./ImportRunnerModal.svelte"; - import RunnersOverview from "./RunnersOverview.svelte"; - $: current_runners = []; - export let modal_open = false; - export let import_modal_open = false; - let addRunners; + 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 { 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;
-

- {$_("runners")} -

- {#if store.state.jwtinfo.userdetails.permissions.includes("RUNNER:CREATE")} - - - {/if} - +

+ {$_("runners")} +

+ {#if store.state.jwtinfo.userdetails.permissions.includes("RUNNER:CREATE")} + + + {/if} + { + deleteRunner(event.detail.id); + }} + /> + {#if store.state.jwtinfo.userdetails.permissions.includes("RUNNER:GET")} + {#if !dataLoaded} + + {:else} + + + +
+ + + {#each $table.getHeaderGroups() as headerGroup} + + + {#each headerGroup.headers as header} + + {/each} + + {/each} + + + {#each $table.getRowModel().rows as row} + + + {#each row.getVisibleCells() as cell} + + {/each} + + {/each} + +
+ $table.toggleAllRowsSelected()} + /> +
+ row.toggleSelected()} + /> + + +
+
+
+ {/if} + {/if} +
{#if store.state.jwtinfo.userdetails.permissions.includes("RUNNER:CREATE")} - { - addRunners(event.detail.runners); - }} - /> - { - import_modal_open = false; - }} - passed_team={{}} - passed_orgs={[]} - passed_org={{}} - opened_from="RunnerOverview" - bind:import_modal_open - on:created={(event) => { - addRunners(event.detail.runners); - }} - /> + { + addRunners(event.detail.runners); + }} + /> + { + import_modal_open = false; + }} + passed_team={{}} + passed_orgs={[]} + passed_org={{}} + opened_from="RunnerOverview" + bind:import_modal_open + on:created={(event) => { + addRunners(event.detail.runners); + }} + /> {/if} + + diff --git a/src/components/runners/RunnersOverview.svelte b/src/components/runners/RunnersOverview.svelte deleted file mode 100644 index 731cb2f5..00000000 --- a/src/components/runners/RunnersOverview.svelte +++ /dev/null @@ -1,267 +0,0 @@ - - - { - deleteRunner(event.detail.id); - }} -/> -{#if store.state.jwtinfo.userdetails.permissions.includes("RUNNER:GET")} - {#if !dataLoaded} - - {:else} -
- - - -
-
- - - {#each $table.getHeaderGroups() as headerGroup} - - - {#each headerGroup.headers as header} - - {/each} - - {/each} - - - {#each $table.getRowModel().rows as row} - - - {#each row.getVisibleCells() as cell} - - {/each} - - {/each} - -
- $table.toggleAllRowsSelected()} - /> -
- row.toggleSelected()} - /> - - -
-
-
- {/if} -{/if} - - - diff --git a/src/components/scans/ScanDetail.svelte b/src/components/scans/ScanDetail.svelte index 2e26adfc..dd9b97ac 100644 --- a/src/components/scans/ScanDetail.svelte +++ b/src/components/scans/ScanDetail.svelte @@ -169,7 +169,7 @@ class:opacity-50={!save_enabled} type="button" 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")} {/if} diff --git a/src/components/scanstations/ScanStationDetail.svelte b/src/components/scanstations/ScanStationDetail.svelte index 476a5181..5ec00b7a 100644 --- a/src/components/scanstations/ScanStationDetail.svelte +++ b/src/components/scanstations/ScanStationDetail.svelte @@ -125,7 +125,7 @@ class:opacity-50={!save_enabled} type="button" 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")} {/if} diff --git a/src/components/settings/Settings.svelte b/src/components/settings/Settings.svelte index bb5d0a6e..507e12c5 100644 --- a/src/components/settings/Settings.svelte +++ b/src/components/settings/Settings.svelte @@ -161,7 +161,7 @@ disabled={!save_enabled} class:opacity-50={!save_enabled} 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")} @@ -225,7 +225,7 @@ disabled={!update_password_enabled} class:opacity-50={!update_password_enabled} 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")} diff --git a/src/components/teams/TeamDetail.svelte b/src/components/teams/TeamDetail.svelte index 3b9a9b87..90201041 100644 --- a/src/components/teams/TeamDetail.svelte +++ b/src/components/teams/TeamDetail.svelte @@ -139,7 +139,7 @@ {group.label}{" > "} {/if} {original.name} [#{params.teamid}] - +
{$_("save-changes")} {/if} - +
diff --git a/src/components/teams/Teams.svelte b/src/components/teams/Teams.svelte index 2edeecf1..81d0a508 100644 --- a/src/components/teams/Teams.svelte +++ b/src/components/teams/Teams.svelte @@ -1,30 +1,262 @@
-

- {$_("teams")} -

- {#if store.state.jwtinfo.userdetails.permissions.includes("TEAM:CREATE")} - - {/if} - +

+ {$_("teams")} +

+ {#if store.state.jwtinfo.userdetails.permissions.includes("TEAM:CREATE")} + + {/if} + { + 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} + + {:then} + {#if current_teams.length === 0} + + {:else} + + + + +
+ + + + + + + + + + + + {#each current_teams as t} + {#if Object.values(t) + .toString() + .toLowerCase() + .includes(searchvalue)} + + + + + + {#if active_deletes[t.id] === true} + + {:else} + + {/if} + + {/if} + {/each} + +
+ + + {$_("name")} + + {$_("organization")} + + {$_("contact")} + + {$_("action")} +
+ + +
+
+ {t.name} +
+
+
+
+
+ {#if t.parentGroup} + {t.parentGroup.name} + {:else}{$_("no-organization-specified")}{/if} +
+
+
+
+
+ {#if t.contact} + {t.contact.firstname} + {t.contact.middlename || ""} + {t.contact.lastname} + {:else}{$_("no-contact-specified")}{/if} +
+
+
+ + + + {$_("details")} + {#if store.state.jwtinfo.userdetails.permissions.includes("TEAM:DELETE")} + + {/if} +
+
+ {/if} + {:catch error} +
+ + {$_("general_promise_error")} + {error} + +
+ {/await} + {/if}
{#if store.state.jwtinfo.userdetails.permissions.includes("TEAM:CREATE")} - + {/if} diff --git a/src/components/teams/TeamsOverview.svelte b/src/components/teams/TeamsOverview.svelte deleted file mode 100644 index 8b7368b7..00000000 --- a/src/components/teams/TeamsOverview.svelte +++ /dev/null @@ -1,241 +0,0 @@ - - - { - 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} - - {:then} - {#if current_teams.length === 0} - - {:else} - -
- - - -
-
- - - - - - - - - - - - {#each current_teams as t} - {#if Object.values(t) - .toString() - .toLowerCase() - .includes(searchvalue)} - - - - - - {#if active_deletes[t.id] === true} - - {:else} - - {/if} - - {/if} - {/each} - -
- - - {$_("name")} - - {$_("organization")} - - {$_("contact")} - - {$_("action")} -
- - -
-
- {t.name} -
-
-
-
-
- {#if t.parentGroup} - {t.parentGroup.name} - {:else}{$_("no-organization-specified")}{/if} -
-
-
-
-
- {#if t.contact} - {t.contact.firstname} - {t.contact.middlename || ""} - {t.contact.lastname} - {:else}{$_("no-contact-specified")}{/if} -
-
-
- - - - {$_("details")} - {#if store.state.jwtinfo.userdetails.permissions.includes("TEAM:DELETE")} - - {/if} -
-
- {/if} - {:catch error} -
- - {$_("general_promise_error")} - {error} - -
- {/await} -{/if} diff --git a/src/components/users/UserDetail.svelte b/src/components/users/UserDetail.svelte index e7e45ce3..0734206c 100644 --- a/src/components/users/UserDetail.svelte +++ b/src/components/users/UserDetail.svelte @@ -172,7 +172,7 @@ class:opacity-50={!save_enabled} type="button" 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")} {/if} diff --git a/src/components/users/UserPermissions.svelte b/src/components/users/UserPermissions.svelte index f029445b..b16d4144 100644 --- a/src/components/users/UserPermissions.svelte +++ b/src/components/users/UserPermissions.svelte @@ -150,7 +150,7 @@ class:opacity-50={save_enabled} type="button" 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")} {:else} diff --git a/tailwind.config.cjs b/tailwind.config.cjs index 3902210c..4849256e 100644 --- a/tailwind.config.cjs +++ b/tailwind.config.cjs @@ -1,4 +1,5 @@ module.exports = { + darkMode: 'selector', mode: "jit", content: ["./src/**/*.svelte"], theme: {