parent
8a32569a3b
commit
f46ccb610e
@ -5,9 +5,8 @@
|
|||||||
import {
|
import {
|
||||||
RunnerCardService
|
RunnerCardService
|
||||||
} from "@odit/lfk-client-js";
|
} from "@odit/lfk-client-js";
|
||||||
import Select from "svelte-select";
|
|
||||||
import Toastify from "toastify-js";
|
import Toastify from "toastify-js";
|
||||||
export let modal_open;
|
export let bulk_modal_open;
|
||||||
export let current_cards;
|
export let current_cards;
|
||||||
function focus(el) {
|
function focus(el) {
|
||||||
el.focus();
|
el.focus();
|
||||||
@ -15,17 +14,12 @@
|
|||||||
$: card_count = 0;
|
$: card_count = 0;
|
||||||
$: is_card_count_valid= card_count>0;
|
$: is_card_count_valid= card_count>0;
|
||||||
$: processed_last_submit = true;
|
$: processed_last_submit = true;
|
||||||
RunnerService.runnerControllerGetAll().then((val) => {
|
|
||||||
runners = val.map((r) => {
|
|
||||||
return { label: getRunnerLabel(r), value: r };
|
|
||||||
});
|
|
||||||
});
|
|
||||||
$: createbtnenabled = is_card_count_valid;
|
$: createbtnenabled = is_card_count_valid;
|
||||||
(() => {
|
(() => {
|
||||||
document.onkeydown = (e) => {
|
document.onkeydown = (e) => {
|
||||||
e = e || window.event;
|
e = e || window.event;
|
||||||
if (e.key === "Escape") {
|
if (e.key === "Escape") {
|
||||||
modal_open = false;
|
bulk_modal_open = false;
|
||||||
}
|
}
|
||||||
if (e.keyCode === 13) {
|
if (e.keyCode === 13) {
|
||||||
if (createbtnenabled === true) {
|
if (createbtnenabled === true) {
|
||||||
@ -50,7 +44,7 @@
|
|||||||
RunnerCardService.runnerCardControllerPost(postdata)
|
RunnerCardService.runnerCardControllerPost(postdata)
|
||||||
.then((result) => {
|
.then((result) => {
|
||||||
runner = 0;
|
runner = 0;
|
||||||
modal_open = false;
|
bulk_modal_open = false;
|
||||||
//
|
//
|
||||||
Toastify({
|
Toastify({
|
||||||
text: $_("card-added"),
|
text: $_("card-added"),
|
||||||
@ -72,13 +66,13 @@
|
|||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#if modal_open}
|
{#if bulk_modal_open}
|
||||||
<div
|
<div
|
||||||
class="fixed z-10 inset-0 overflow-y-auto"
|
class="fixed z-10 inset-0 overflow-y-auto"
|
||||||
use:focusTrap
|
use:focusTrap
|
||||||
use:clickOutside
|
use:clickOutside
|
||||||
on:click_outside={() => {
|
on:click_outside={() => {
|
||||||
modal_open = false;
|
bulk_modal_open = false;
|
||||||
}}>
|
}}>
|
||||||
<div
|
<div
|
||||||
class="flex items-end justify-center min-h-screen pt-4 px-4 pb-20 text-center sm:block sm:p-0">
|
class="flex items-end justify-center min-h-screen pt-4 px-4 pb-20 text-center sm:block sm:p-0">
|
||||||
@ -161,7 +155,7 @@
|
|||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
on:click={() => {
|
on:click={() => {
|
||||||
modal_open = false;
|
bulk_modal_open = false;
|
||||||
}}
|
}}
|
||||||
type="button"
|
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">
|
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">
|
||||||
|
@ -1,10 +1,12 @@
|
|||||||
<script>
|
<script>
|
||||||
import { _ } from "svelte-i18n";
|
import { _ } from "svelte-i18n";
|
||||||
import store from "../../store";
|
import store from "../../store";
|
||||||
|
import AddCardBulkModal from "./AddCardBulkModal.svelte";
|
||||||
import AddCardModal from "./AddCardModal.svelte";
|
import AddCardModal from "./AddCardModal.svelte";
|
||||||
import CardsOverview from "./CardsOverview.svelte";
|
import CardsOverview from "./CardsOverview.svelte";
|
||||||
$: current_cards = [];
|
$: current_cards = [];
|
||||||
export let modal_open = false;
|
export let modal_open = false;
|
||||||
|
export let bulk_modal_open = false;
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<section class="container p-5">
|
<section class="container p-5">
|
||||||
@ -19,6 +21,14 @@
|
|||||||
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:ml-3 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:ml-3 sm:w-auto sm:text-sm">
|
||||||
{$_('add-card')}
|
{$_('add-card')}
|
||||||
</button>
|
</button>
|
||||||
|
<button
|
||||||
|
on:click={() => {
|
||||||
|
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:ml-3 sm:w-auto sm:text-sm">
|
||||||
|
{$_('create-bulk-cards')}
|
||||||
|
</button>
|
||||||
{/if}
|
{/if}
|
||||||
</span>
|
</span>
|
||||||
<CardsOverview bind:current_cards />
|
<CardsOverview bind:current_cards />
|
||||||
@ -26,4 +36,5 @@
|
|||||||
|
|
||||||
{#if store.state.jwtinfo.userdetails.permissions.includes('CARD:CREATE')}
|
{#if store.state.jwtinfo.userdetails.permissions.includes('CARD:CREATE')}
|
||||||
<AddCardModal bind:current_cards bind:modal_open />
|
<AddCardModal bind:current_cards bind:modal_open />
|
||||||
|
<AddCardBulkModal bind:current_cards bind:bulk_modal_open />
|
||||||
{/if}
|
{/if}
|
||||||
|
@ -395,5 +395,6 @@
|
|||||||
"create-bulk-blanco-cards": "Blankokarten erstellen",
|
"create-bulk-blanco-cards": "Blankokarten erstellen",
|
||||||
"just-enter-how-many-you-want-and-the-system-will-create-them": "Geb einfach ein, wie viele Blankokarten das System erstellen soll.",
|
"just-enter-how-many-you-want-and-the-system-will-create-them": "Geb einfach ein, wie viele Blankokarten das System erstellen soll.",
|
||||||
"amount": "Anzahl",
|
"amount": "Anzahl",
|
||||||
"you-must-create-at-least-one-card-or-cancel": "Du musst mindestens eine Blankokarte erstellen (oder abbrechen)."
|
"you-must-create-at-least-one-card-or-cancel": "Du musst mindestens eine Blankokarte erstellen (oder abbrechen).",
|
||||||
|
"create-bulk-cards": "Blankokarten erstellen"
|
||||||
}
|
}
|
||||||
|
@ -391,9 +391,10 @@
|
|||||||
"card-added": "Card added",
|
"card-added": "Card added",
|
||||||
"create-a-new-card": "Create a new card",
|
"create-a-new-card": "Create a new card",
|
||||||
"you-can-provide-a-runner-but-you-dont-have-to": "You can provide a runner, but you don't have to.",
|
"you-can-provide-a-runner-but-you-dont-have-to": "You can provide a runner, but you don't have to.",
|
||||||
"if-you-want-to-create-multiple-blanco-cards-try-the-add-bulk-button": "If you want to create multiple blanco cards: Try the 'Add bulk' button.",
|
"if-you-want-to-create-multiple-blanco-cards-try-the-add-bulk-button": "If you want to create multiple blanco cards: Try the 'Add blanco cards' button.",
|
||||||
"create-bulk-blanco-cards": "Create bulk blanco cards",
|
"create-bulk-blanco-cards": "Create bulk blanco cards",
|
||||||
"just-enter-how-many-you-want-and-the-system-will-create-them": "Just enter how many you want and the system will create them",
|
"just-enter-how-many-you-want-and-the-system-will-create-them": "Just enter how many you want and the system will create them",
|
||||||
"amount": "Amount",
|
"amount": "Amount",
|
||||||
"you-must-create-at-least-one-card-or-cancel": "You must create at least one card (or cancel)."
|
"you-must-create-at-least-one-card-or-cancel": "You must create at least one card (or cancel).",
|
||||||
|
"create-bulk-cards": "Add blanco cards"
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user