Merge pull request 'Implmented certificate generation feature/119-Certificate_generation' (#120) from feature/119-Certificate_generation into dev
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #120
This commit is contained in:
commit
f0738d451b
@ -12,6 +12,7 @@
|
|||||||
import Select from "svelte-select";
|
import Select from "svelte-select";
|
||||||
import GenerateSponsoringContracts from "../pdf_generation/GenerateSponsoringContracts.svelte";
|
import GenerateSponsoringContracts from "../pdf_generation/GenerateSponsoringContracts.svelte";
|
||||||
import GenerateRunnerCards from "../pdf_generation/GenerateRunnerCards.svelte";
|
import GenerateRunnerCards from "../pdf_generation/GenerateRunnerCards.svelte";
|
||||||
|
import GenerateRunnerCertificates from "../pdf_generation/GenerateRunnerCertificates.svelte";
|
||||||
import { tick } from "svelte";
|
import { tick } from "svelte";
|
||||||
$: delete_triggered = false;
|
$: delete_triggered = false;
|
||||||
$: address_valid_or_none =
|
$: address_valid_or_none =
|
||||||
@ -34,6 +35,7 @@
|
|||||||
$: iscityvalid = editable.address?.city?.trim().length !== 0;
|
$: iscityvalid = editable.address?.city?.trim().length !== 0;
|
||||||
$: sponsoring_contracts_show = true;
|
$: sponsoring_contracts_show = true;
|
||||||
$: cards_show = true;
|
$: cards_show = true;
|
||||||
|
$: certificates_show = true;
|
||||||
$: generate_orgs = [original_object];
|
$: generate_orgs = [original_object];
|
||||||
$: registrationLink = `${config.baseurl}/selfservice/register/${editable.registrationKey}`;
|
$: registrationLink = `${config.baseurl}/selfservice/register/${editable.registrationKey}`;
|
||||||
const getContactLabel = (option) =>
|
const getContactLabel = (option) =>
|
||||||
@ -176,6 +178,7 @@
|
|||||||
bind:sponsoring_contracts_show
|
bind:sponsoring_contracts_show
|
||||||
bind:generate_orgs />
|
bind:generate_orgs />
|
||||||
<GenerateRunnerCards bind:cards_show bind:generate_orgs />
|
<GenerateRunnerCards bind:cards_show bind:generate_orgs />
|
||||||
|
<GenerateRunnerCertificates bind:certificates_show bind:generate_orgs />
|
||||||
{#if store.state.jwtinfo.userdetails.permissions.includes('RUNNER:IMPORT')}
|
{#if store.state.jwtinfo.userdetails.permissions.includes('RUNNER:IMPORT')}
|
||||||
<button
|
<button
|
||||||
on:click={() => {
|
on:click={() => {
|
||||||
@ -186,7 +189,7 @@
|
|||||||
{$_('import-runners')}
|
{$_('import-runners')}
|
||||||
</button>
|
</button>
|
||||||
{/if}
|
{/if}
|
||||||
{#if store.state.jwtinfo.userdetails.permissions.includes('USER:DELETE')}
|
{#if store.state.jwtinfo.userdetails.permissions.includes('RUNNER:DELETE')}
|
||||||
{#if delete_triggered}
|
{#if delete_triggered}
|
||||||
<button
|
<button
|
||||||
on:click={deleteOrganization}
|
on:click={deleteOrganization}
|
||||||
|
@ -9,11 +9,15 @@
|
|||||||
import Toastify from "toastify-js";
|
import Toastify from "toastify-js";
|
||||||
import ConfirmOrgDeletion from "./ConfirmOrgDeletion.svelte";
|
import ConfirmOrgDeletion from "./ConfirmOrgDeletion.svelte";
|
||||||
import GenerateRunnerCards from "../pdf_generation/GenerateRunnerCards.svelte";
|
import GenerateRunnerCards from "../pdf_generation/GenerateRunnerCards.svelte";
|
||||||
|
import GenerateRunnerCertificates from "../pdf_generation/GenerateRunnerCertificates.svelte";
|
||||||
$: searchvalue = "";
|
$: searchvalue = "";
|
||||||
$: active_deletes = [];
|
$: active_deletes = [];
|
||||||
$: sponsoring_contracts_show = current_organizations.some((r) => r.is_selected === true);
|
$: sponsoring_contracts_show = current_organizations.some((r) => r.is_selected === true);
|
||||||
$: cards_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);
|
$: generate_orgs = current_organizations.some((r) => r.is_selected === true);
|
||||||
|
$: certificates_show = current_organizations.some(
|
||||||
|
(r) => r.is_selected === true
|
||||||
|
);
|
||||||
export let current_organizations = [];
|
export let current_organizations = [];
|
||||||
|
|
||||||
const promise = RunnerOrganizationService.runnerOrganizationControllerGetAll().then(
|
const promise = RunnerOrganizationService.runnerOrganizationControllerGetAll().then(
|
||||||
@ -55,6 +59,9 @@
|
|||||||
<GenerateRunnerCards
|
<GenerateRunnerCards
|
||||||
bind:cards_show
|
bind:cards_show
|
||||||
bind:generate_orgs />
|
bind:generate_orgs />
|
||||||
|
<GenerateRunnerCertificates
|
||||||
|
bind:certificates_show
|
||||||
|
bind:generate_orgs />
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
class="shadow border-b border-gray-200 sm:rounded-lg overflow-x-scroll">
|
class="shadow border-b border-gray-200 sm:rounded-lg overflow-x-scroll">
|
||||||
|
@ -67,7 +67,7 @@
|
|||||||
const url = window.URL.createObjectURL(blob);
|
const url = window.URL.createObjectURL(blob);
|
||||||
let a = document.createElement("a");
|
let a = document.createElement("a");
|
||||||
a.href = url;
|
a.href = url;
|
||||||
a.download = "Runnercards.pdf";
|
a.download = `${$_('runnercards')}-${locale}.pdf`;
|
||||||
document.body.appendChild(a);
|
document.body.appendChild(a);
|
||||||
a.click();
|
a.click();
|
||||||
a.remove();
|
a.remove();
|
||||||
@ -127,7 +127,12 @@
|
|||||||
const url = window.URL.createObjectURL(blob);
|
const url = window.URL.createObjectURL(blob);
|
||||||
let a = document.createElement("a");
|
let a = document.createElement("a");
|
||||||
a.href = url;
|
a.href = url;
|
||||||
a.download = "Runnercards.pdf";
|
if(generate_runners.length == 1){
|
||||||
|
a.download = `${$_('runnercards')}_${generate_runners[0].firstname}_${generate_runners[0].lastname}-${locale}.pdf`;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
a.download = `Runnercards-${locale}.pdf`;
|
||||||
|
}
|
||||||
document.body.appendChild(a);
|
document.body.appendChild(a);
|
||||||
a.click();
|
a.click();
|
||||||
a.remove();
|
a.remove();
|
||||||
@ -191,7 +196,7 @@
|
|||||||
const url = window.URL.createObjectURL(blob);
|
const url = window.URL.createObjectURL(blob);
|
||||||
let a = document.createElement("a");
|
let a = document.createElement("a");
|
||||||
a.href = url;
|
a.href = url;
|
||||||
a.download = "Sponsorings_" + t.name + ".pdf";
|
a.download = `${$_('runnercards')}_${t.name}-${locale}.pdf`;
|
||||||
document.body.appendChild(a);
|
document.body.appendChild(a);
|
||||||
a.click();
|
a.click();
|
||||||
a.remove();
|
a.remove();
|
||||||
@ -258,7 +263,7 @@
|
|||||||
const url = window.URL.createObjectURL(blob);
|
const url = window.URL.createObjectURL(blob);
|
||||||
let a = document.createElement("a");
|
let a = document.createElement("a");
|
||||||
a.href = url;
|
a.href = url;
|
||||||
a.download = "Sponsorings_" + o.name + ".pdf";
|
a.download = `${$_('runnercards')}_${o.name}-${locale}.pdf`;
|
||||||
document.body.appendChild(a);
|
document.body.appendChild(a);
|
||||||
a.click();
|
a.click();
|
||||||
a.remove();
|
a.remove();
|
||||||
|
277
src/components/pdf_generation/GenerateRunnerCertificates.svelte
Normal file
277
src/components/pdf_generation/GenerateRunnerCertificates.svelte
Normal file
@ -0,0 +1,277 @@
|
|||||||
|
<script>
|
||||||
|
import { _ } from "svelte-i18n";
|
||||||
|
import {
|
||||||
|
DonationService,
|
||||||
|
RunnerTeamService,
|
||||||
|
RunnerOrganizationService
|
||||||
|
} from "@odit/lfk-client-js";
|
||||||
|
import Toastify from "toastify-js";
|
||||||
|
export let certificates_show = false;
|
||||||
|
export let generate_runners = [];
|
||||||
|
export let generate_orgs = [];
|
||||||
|
export let generate_teams = [];
|
||||||
|
$: certificates_dropdown_open = false;
|
||||||
|
document.addEventListener("click", function (e) {
|
||||||
|
if (
|
||||||
|
e.target.parentNode?.parentNode?.id != "certificates:dropdown" &&
|
||||||
|
e.target.parentNode?.parentNode?.id != "certificates:dropdown:menu"
|
||||||
|
) {
|
||||||
|
certificates_dropdown_open = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
function generateCertificates(locale) {
|
||||||
|
certificates_dropdown_open = false;
|
||||||
|
|
||||||
|
if (generate_orgs.length > 0) {
|
||||||
|
generateOrgCertificates(locale);
|
||||||
|
} else if (generate_teams.length > 0) {
|
||||||
|
generateTeamCertificates(locale);
|
||||||
|
} else {
|
||||||
|
generateRunnerCertificates(locale);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async function generateRunnerCertificates(locale) {
|
||||||
|
const toast = Toastify({
|
||||||
|
text: $_("generating-pdf"),
|
||||||
|
duration: -1,
|
||||||
|
}).showToast();
|
||||||
|
const current_donations = await DonationService.donationControllerGetAll();
|
||||||
|
let certificateRunners = [];
|
||||||
|
for (let runner of generate_runners) {
|
||||||
|
runner.distanceDonations = current_donations.find((d) => d.runner?.id == runner.id) || [];
|
||||||
|
certificateRunners.push(runner);
|
||||||
|
}
|
||||||
|
fetch(
|
||||||
|
`${config.baseurl}/documents/certificates?locale=${locale}&download=true&key=${config.documentserver_key}`,
|
||||||
|
{
|
||||||
|
method: "POST",
|
||||||
|
headers: {
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
},
|
||||||
|
body: JSON.stringify(certificateRunners),
|
||||||
|
}
|
||||||
|
)
|
||||||
|
.then((response) => {
|
||||||
|
if (response.status != "200") {
|
||||||
|
toast.hideToast();
|
||||||
|
Toastify({
|
||||||
|
text: $_("pdf-generation-failed"),
|
||||||
|
duration: 3500,
|
||||||
|
backgroundColor:
|
||||||
|
"linear-gradient(90deg, hsla(281, 37%, 45%, 1) 0%, hsla(1, 62%, 48%, 1) 100%)",
|
||||||
|
}).showToast();
|
||||||
|
} else {
|
||||||
|
return response.blob();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.then((blob) => {
|
||||||
|
const url = window.URL.createObjectURL(blob);
|
||||||
|
let a = document.createElement("a");
|
||||||
|
a.href = url;
|
||||||
|
if(generate_runners.length == 1){
|
||||||
|
a.download = `${$_('certificates')}_${generate_runners[0].firstname}_${generate_runners[0].lastname}-${locale}.pdf`;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
a.download = `${$_('certificates')}-${locale}.pdf`;
|
||||||
|
}
|
||||||
|
document.body.appendChild(a);
|
||||||
|
a.click();
|
||||||
|
a.remove();
|
||||||
|
toast.hideToast();
|
||||||
|
Toastify({
|
||||||
|
text: $_("pdf-successfully-generated"),
|
||||||
|
duration: 3500,
|
||||||
|
backgroundColor:
|
||||||
|
"linear-gradient(to right, #00b09b, #96c93d)",
|
||||||
|
}).showToast();
|
||||||
|
})
|
||||||
|
.catch((err) => {});
|
||||||
|
}
|
||||||
|
|
||||||
|
async function generateTeamCertificates(locale) {
|
||||||
|
const toast = Toastify({
|
||||||
|
text: $_("generating-pdfs"),
|
||||||
|
duration: -1,
|
||||||
|
}).showToast();
|
||||||
|
let count = 0;
|
||||||
|
const current_donations = await DonationService.donationControllerGetAll();
|
||||||
|
for (const t of generate_teams) {
|
||||||
|
const runners = await RunnerTeamService.runnerTeamControllerGetRunners(
|
||||||
|
t.id
|
||||||
|
);
|
||||||
|
let certificateRunners = [];
|
||||||
|
for (let runner of runners) {
|
||||||
|
runner.distanceDonations = current_donations.find((d) => d.runner?.id == runner.id) || [];
|
||||||
|
certificateRunners.push(runner);
|
||||||
|
}
|
||||||
|
fetch(
|
||||||
|
`${config.baseurl}/documents/certificates?locale=${locale}&download=true&key=${config.documentserver_key}`,
|
||||||
|
{
|
||||||
|
method: "POST",
|
||||||
|
headers: {
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
},
|
||||||
|
body: JSON.stringify(certificateRunners),
|
||||||
|
}
|
||||||
|
)
|
||||||
|
.then((response) => {
|
||||||
|
if (response.status != "200") {
|
||||||
|
toast.hideToast();
|
||||||
|
Toastify({
|
||||||
|
text: $_("pdf-generation-failed"),
|
||||||
|
duration: 3500,
|
||||||
|
backgroundColor:
|
||||||
|
"linear-gradient(90deg, hsla(281, 37%, 45%, 1) 0%, hsla(1, 62%, 48%, 1) 100%)",
|
||||||
|
}).showToast();
|
||||||
|
} else {
|
||||||
|
return response.blob();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.then((blob) => {
|
||||||
|
count++;
|
||||||
|
const url = window.URL.createObjectURL(blob);
|
||||||
|
let a = document.createElement("a");
|
||||||
|
a.href = url;
|
||||||
|
a.download = `${$_('certificates')}_${t.name}-${locale}.pdf`;
|
||||||
|
document.body.appendChild(a);
|
||||||
|
a.click();
|
||||||
|
a.remove();
|
||||||
|
if (count === generate_teams.length) {
|
||||||
|
toast.hideToast();
|
||||||
|
Toastify({
|
||||||
|
text: $_("pdfs-successfully-generated"),
|
||||||
|
duration: 3500,
|
||||||
|
backgroundColor:
|
||||||
|
"linear-gradient(to right, #00b09b, #96c93d)",
|
||||||
|
}).showToast();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch((err) => {});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async function generateOrgCertificates(locale) {
|
||||||
|
const toast = Toastify({
|
||||||
|
text: $_("generating-pdf"),
|
||||||
|
duration: -1,
|
||||||
|
}).showToast();
|
||||||
|
let count = 0;
|
||||||
|
const current_donations = await DonationService.donationControllerGetAll();
|
||||||
|
for (const o of generate_orgs) {
|
||||||
|
const runners = await RunnerOrganizationService.runnerOrganizationControllerGetRunners(
|
||||||
|
o.id
|
||||||
|
);
|
||||||
|
let certificateRunners = [];
|
||||||
|
for (let runner of runners) {
|
||||||
|
runner.distanceDonations = current_donations.find((d) => d.runner?.id == runner.id) || [];
|
||||||
|
certificateRunners.push(runner);
|
||||||
|
}
|
||||||
|
fetch(
|
||||||
|
`${config.baseurl}/documents/certificates?locale=${locale}&download=true&key=${config.documentserver_key}`,
|
||||||
|
{
|
||||||
|
method: "POST",
|
||||||
|
headers: {
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
},
|
||||||
|
body: JSON.stringify(certificateRunners),
|
||||||
|
}
|
||||||
|
)
|
||||||
|
.then((response) => {
|
||||||
|
if (response.status != "200") {
|
||||||
|
toast.hideToast();
|
||||||
|
Toastify({
|
||||||
|
text: $_("pdf-generation-failed"),
|
||||||
|
duration: 3500,
|
||||||
|
backgroundColor:
|
||||||
|
"linear-gradient(90deg, hsla(281, 37%, 45%, 1) 0%, hsla(1, 62%, 48%, 1) 100%)",
|
||||||
|
}).showToast();
|
||||||
|
} else {
|
||||||
|
return response.blob();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.then((blob) => {
|
||||||
|
count++;
|
||||||
|
const url = window.URL.createObjectURL(blob);
|
||||||
|
let a = document.createElement("a");
|
||||||
|
a.href = url;
|
||||||
|
a.download = `${$_('certificates')}_${o.name}-${locale}.pdf`;
|
||||||
|
document.body.appendChild(a);
|
||||||
|
a.click();
|
||||||
|
a.remove();
|
||||||
|
if (count === generate_orgs.length) {
|
||||||
|
toast.hideToast();
|
||||||
|
Toastify({
|
||||||
|
text: $_("pdfs-successfully-generated"),
|
||||||
|
duration: 3500,
|
||||||
|
backgroundColor:
|
||||||
|
"linear-gradient(to right, #00b09b, #96c93d)",
|
||||||
|
}).showToast();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch((err) => {});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
{#if certificates_show}
|
||||||
|
<div id="certificates:dropdown" class="relative inline-block">
|
||||||
|
<div>
|
||||||
|
<button
|
||||||
|
on:click={() => {
|
||||||
|
certificates_dropdown_open = !certificates_dropdown_open;
|
||||||
|
}}
|
||||||
|
type="button"
|
||||||
|
class="w-full justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-gray-600 text-base font-medium text-white hover:bg-gray-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-gray-500 sm:ml-3 sm:w-auto sm:text-sm inline-flex"
|
||||||
|
id="options-menu"
|
||||||
|
aria-haspopup="true"
|
||||||
|
aria-expanded="true">
|
||||||
|
{$_('generate-runner-certificates')}
|
||||||
|
<svg
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
width="24"
|
||||||
|
height="24"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
class="-mr-1 ml-2 h-5 w-5"><path
|
||||||
|
fill="none"
|
||||||
|
d="M0 0h24v24H0z" />
|
||||||
|
<path
|
||||||
|
fill="currentColor"
|
||||||
|
d="M3 19h18v2H3v-2zm10-5.83l6.07-6.07 1.42 1.41L12 17 3.52 8.52l1.4-1.42L11 13.17V2h2v11.17z" /></svg>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
{#if certificates_dropdown_open}
|
||||||
|
<div
|
||||||
|
class="origin-top-right absolute right-0 mt-2 w-56 rounded-md shadow-lg bg-white ring-1 ring-black ring-opacity-5"
|
||||||
|
id="certificates:dropdown:menu">
|
||||||
|
<div
|
||||||
|
class="py-1"
|
||||||
|
role="menu"
|
||||||
|
aria-orientation="vertical"
|
||||||
|
aria-labelledby="options-menu">
|
||||||
|
<span
|
||||||
|
class="block w-full text-left px-4 py-2 text-sm text-gray-700">{$_('select-language')}</span>
|
||||||
|
<button
|
||||||
|
on:click={() => {
|
||||||
|
generateCertificates('de');
|
||||||
|
}}
|
||||||
|
type="submit"
|
||||||
|
class="block w-full text-left px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 hover:text-gray-900 focus:outline-none focus:bg-gray-100 focus:text-gray-900"
|
||||||
|
role="menuitem">
|
||||||
|
{$_('german')}
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
on:click={() => {
|
||||||
|
generateCertificates('en');
|
||||||
|
}}
|
||||||
|
type="submit"
|
||||||
|
class="block w-full text-left px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 hover:text-gray-900 focus:outline-none focus:bg-gray-100 focus:text-gray-900"
|
||||||
|
role="menuitem">
|
||||||
|
{$_('english')}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
|
</div>
|
||||||
|
{/if}
|
@ -69,7 +69,7 @@
|
|||||||
const url = window.URL.createObjectURL(blob);
|
const url = window.URL.createObjectURL(blob);
|
||||||
let a = document.createElement("a");
|
let a = document.createElement("a");
|
||||||
a.href = url;
|
a.href = url;
|
||||||
a.download = "Sponsorings_" + t.name + ".pdf";
|
a.download = `${$_('sponsorings')}_${t.name}-${locale}.pdf`;
|
||||||
document.body.appendChild(a);
|
document.body.appendChild(a);
|
||||||
a.click();
|
a.click();
|
||||||
a.remove();
|
a.remove();
|
||||||
@ -124,7 +124,7 @@
|
|||||||
const url = window.URL.createObjectURL(blob);
|
const url = window.URL.createObjectURL(blob);
|
||||||
let a = document.createElement("a");
|
let a = document.createElement("a");
|
||||||
a.href = url;
|
a.href = url;
|
||||||
a.download = "Sponsorings_" + o.name + ".pdf";
|
a.download = `${$_('sponsorings')}_${o.name}-${locale}.pdf`;
|
||||||
document.body.appendChild(a);
|
document.body.appendChild(a);
|
||||||
a.click();
|
a.click();
|
||||||
a.remove();
|
a.remove();
|
||||||
@ -174,7 +174,10 @@
|
|||||||
const url = window.URL.createObjectURL(blob);
|
const url = window.URL.createObjectURL(blob);
|
||||||
let a = document.createElement("a");
|
let a = document.createElement("a");
|
||||||
a.href = url;
|
a.href = url;
|
||||||
a.download = "Sponsoring.pdf";
|
if(generate_runners.length == 1){
|
||||||
|
a.download = `${$_('sponsorings')}_${generate_runners[0].firstname}_${generate_runners[0].lastname}-${locale}.pdf`;
|
||||||
|
}
|
||||||
|
a.download = `${$_('sponsorings')}-${locale}.pdf`;
|
||||||
document.body.appendChild(a);
|
document.body.appendChild(a);
|
||||||
a.click();
|
a.click();
|
||||||
a.remove();
|
a.remove();
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
import { getLocaleFromNavigator, _ } from "svelte-i18n";
|
import { getLocaleFromNavigator, _ } from "svelte-i18n";
|
||||||
import GenerateSponsoringContracts from "../pdf_generation/GenerateSponsoringContracts.svelte";
|
import GenerateSponsoringContracts from "../pdf_generation/GenerateSponsoringContracts.svelte";
|
||||||
import GenerateRunnerCards from "../pdf_generation/GenerateRunnerCards.svelte";
|
import GenerateRunnerCards from "../pdf_generation/GenerateRunnerCards.svelte";
|
||||||
|
import GenerateRunnerCertificates from "../pdf_generation/GenerateRunnerCertificates.svelte";
|
||||||
import store from "../../store";
|
import store from "../../store";
|
||||||
import {
|
import {
|
||||||
RunnerService,
|
RunnerService,
|
||||||
@ -36,6 +37,7 @@
|
|||||||
editable.group != null;
|
editable.group != null;
|
||||||
$: sponsoring_contracts_show = true;
|
$: sponsoring_contracts_show = true;
|
||||||
$: cards_show = true;
|
$: cards_show = true;
|
||||||
|
$: certificates_show = true;
|
||||||
$: generate_runners = [original_data_pdf];
|
$: generate_runners = [original_data_pdf];
|
||||||
runner_promise.then((data) => {
|
runner_promise.then((data) => {
|
||||||
data_loaded = true;
|
data_loaded = true;
|
||||||
@ -158,7 +160,10 @@
|
|||||||
bind:sponsoring_contracts_show
|
bind:sponsoring_contracts_show
|
||||||
bind:generate_runners />
|
bind:generate_runners />
|
||||||
<GenerateRunnerCards
|
<GenerateRunnerCards
|
||||||
bind:sponsoring_contracts_show
|
bind:cards_show
|
||||||
|
bind:generate_runners />
|
||||||
|
<GenerateRunnerCertificates
|
||||||
|
bind:certificates_show
|
||||||
bind:generate_runners />
|
bind:generate_runners />
|
||||||
{#if !delete_triggered}
|
{#if !delete_triggered}
|
||||||
<button
|
<button
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
import Select from "svelte-select";
|
import Select from "svelte-select";
|
||||||
import GenerateSponsoringContracts from "../pdf_generation/GenerateSponsoringContracts.svelte";
|
import GenerateSponsoringContracts from "../pdf_generation/GenerateSponsoringContracts.svelte";
|
||||||
import GenerateRunnerCards from "../pdf_generation/GenerateRunnerCards.svelte";
|
import GenerateRunnerCards from "../pdf_generation/GenerateRunnerCards.svelte";
|
||||||
|
import GenerateRunnerCertificates from "../pdf_generation/GenerateRunnerCertificates.svelte";
|
||||||
$: searchvalue = "";
|
$: searchvalue = "";
|
||||||
$: active_deletes = [];
|
$: active_deletes = [];
|
||||||
export let current_runners = [];
|
export let current_runners = [];
|
||||||
@ -27,6 +28,9 @@
|
|||||||
$: cards_show = current_runners.some(
|
$: cards_show = current_runners.some(
|
||||||
(r) => r.is_selected === true
|
(r) => r.is_selected === true
|
||||||
);
|
);
|
||||||
|
$: certificates_show = current_runners.some(
|
||||||
|
(r) => r.is_selected === true
|
||||||
|
);
|
||||||
$: generate_runners = current_runners.filter((r) => r.is_selected === true);
|
$: generate_runners = current_runners.filter((r) => r.is_selected === true);
|
||||||
$: teams = [];
|
$: teams = [];
|
||||||
$: orgs = [];
|
$: orgs = [];
|
||||||
@ -92,6 +96,9 @@
|
|||||||
<GenerateRunnerCards
|
<GenerateRunnerCards
|
||||||
bind:cards_show
|
bind:cards_show
|
||||||
bind:generate_runners />
|
bind:generate_runners />
|
||||||
|
<GenerateRunnerCertificates
|
||||||
|
bind:certificates_show
|
||||||
|
bind:generate_runners />
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
class="shadow border-b border-gray-200 sm:rounded-lg overflow-x-scroll">
|
class="shadow border-b border-gray-200 sm:rounded-lg overflow-x-scroll">
|
||||||
|
@ -14,6 +14,7 @@
|
|||||||
import Teams from "./Teams.svelte";
|
import Teams from "./Teams.svelte";
|
||||||
import GenerateSponsoringContracts from "../pdf_generation/GenerateSponsoringContracts.svelte";
|
import GenerateSponsoringContracts from "../pdf_generation/GenerateSponsoringContracts.svelte";
|
||||||
import GenerateRunnerCards from "../pdf_generation/GenerateRunnerCards.svelte";
|
import GenerateRunnerCards from "../pdf_generation/GenerateRunnerCards.svelte";
|
||||||
|
import GenerateRunnerCertificates from "../pdf_generation/GenerateRunnerCertificates.svelte";
|
||||||
let [teamdata, original, delete_team, orgs, contacts, modal_open] = [
|
let [teamdata, original, delete_team, orgs, contacts, modal_open] = [
|
||||||
{},
|
{},
|
||||||
{},
|
{},
|
||||||
@ -30,6 +31,7 @@
|
|||||||
$: data_changed = JSON.stringify(teamdata) === JSON.stringify(original);
|
$: data_changed = JSON.stringify(teamdata) === JSON.stringify(original);
|
||||||
$: sponsoring_contracts_show = true;
|
$: sponsoring_contracts_show = true;
|
||||||
$: cards_show = true;
|
$: cards_show = true;
|
||||||
|
$: certificates_show = true;
|
||||||
$: generate_teams = [original];
|
$: generate_teams = [original];
|
||||||
$: group = {};
|
$: group = {};
|
||||||
$: contact = {};
|
$: contact = {};
|
||||||
@ -122,6 +124,9 @@
|
|||||||
<GenerateRunnerCards
|
<GenerateRunnerCards
|
||||||
bind:cards_show
|
bind:cards_show
|
||||||
bind:generate_teams />
|
bind:generate_teams />
|
||||||
|
<GenerateRunnerCertificates
|
||||||
|
bind:certificates_show
|
||||||
|
bind:generate_teams />
|
||||||
{#if store.state.jwtinfo.userdetails.permissions.includes('RUNNER:IMPORT')}
|
{#if store.state.jwtinfo.userdetails.permissions.includes('RUNNER:IMPORT')}
|
||||||
<button
|
<button
|
||||||
on:click={() => {
|
on:click={() => {
|
||||||
|
@ -9,6 +9,7 @@
|
|||||||
import { clickOutside } from "../base/outsideclick";
|
import { clickOutside } from "../base/outsideclick";
|
||||||
import GenerateSponsoringContracts from "../pdf_generation/GenerateSponsoringContracts.svelte";
|
import GenerateSponsoringContracts from "../pdf_generation/GenerateSponsoringContracts.svelte";
|
||||||
import GenerateRunnerCards from "../pdf_generation/GenerateRunnerCards.svelte";
|
import GenerateRunnerCards from "../pdf_generation/GenerateRunnerCards.svelte";
|
||||||
|
import GenerateRunnerCertificates from "../pdf_generation/GenerateRunnerCertificates.svelte";
|
||||||
$: searchvalue = "";
|
$: searchvalue = "";
|
||||||
$: active_deletes = [];
|
$: active_deletes = [];
|
||||||
$: sponsoring_contracts_show = current_teams.some(
|
$: sponsoring_contracts_show = current_teams.some(
|
||||||
@ -17,6 +18,9 @@
|
|||||||
$: cards_show = current_teams.some(
|
$: cards_show = current_teams.some(
|
||||||
(r) => r.is_selected === true
|
(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);
|
$: generate_teams = current_teams.filter((r) => r.is_selected === true);
|
||||||
export let current_teams = [];
|
export let current_teams = [];
|
||||||
let modal_open = false;
|
let modal_open = false;
|
||||||
@ -61,6 +65,9 @@
|
|||||||
<GenerateRunnerCards
|
<GenerateRunnerCards
|
||||||
bind:cards_show
|
bind:cards_show
|
||||||
bind:generate_teams />
|
bind:generate_teams />
|
||||||
|
<GenerateRunnerCertificates
|
||||||
|
bind:certificates_show
|
||||||
|
bind:generate_teams />
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
class="shadow border-b border-gray-200 sm:rounded-lg overflow-x-scroll">
|
class="shadow border-b border-gray-200 sm:rounded-lg overflow-x-scroll">
|
||||||
|
@ -50,6 +50,7 @@
|
|||||||
"card-deleted": "Karte gelöscht",
|
"card-deleted": "Karte gelöscht",
|
||||||
"card-updated": "Karte aktualisiert",
|
"card-updated": "Karte aktualisiert",
|
||||||
"cards": "Läuferkarten",
|
"cards": "Läuferkarten",
|
||||||
|
"certificates": "Urkunden",
|
||||||
"change-your-password-here": "Hier kannst du dein Passwort ändern",
|
"change-your-password-here": "Hier kannst du dein Passwort ändern",
|
||||||
"changing-your-password": "Passwort wird geändert",
|
"changing-your-password": "Passwort wird geändert",
|
||||||
"city": "Stadt",
|
"city": "Stadt",
|
||||||
@ -191,10 +192,12 @@
|
|||||||
"geerbte": "geerbte",
|
"geerbte": "geerbte",
|
||||||
"general-stats": "Allgemeine Statistiken",
|
"general-stats": "Allgemeine Statistiken",
|
||||||
"general_promise_error": "😢 Ein unbekannter Fehler ist aufgetreten",
|
"general_promise_error": "😢 Ein unbekannter Fehler ist aufgetreten",
|
||||||
|
"generate-runner-certificate": "Urkunde generieren",
|
||||||
|
"generate-runner-certificates": "Urkunden generieren",
|
||||||
"generate-runnercards": "Läuferkarten generieren",
|
"generate-runnercards": "Läuferkarten generieren",
|
||||||
"generate-sponsoring-contract": "Sponsoringvertrag generieren",
|
"generate-sponsoring-contract": "Sponsoringvertrag generieren",
|
||||||
"generate-sponsoring-contracts": "Sponsoringverträge generieren",
|
"generate-sponsoring-contracts": "Sponsoringverträge generieren",
|
||||||
"generating-pdf": "Pdf wird generiert...",
|
"generating-pdf": "PDF wird generiert...",
|
||||||
"generating-pdfs": "PDFs werden generiert...",
|
"generating-pdfs": "PDFs werden generiert...",
|
||||||
"generic-ui-logic-error": "Etwas ist in der Benutzeroberfläche schiefgelaufen.",
|
"generic-ui-logic-error": "Etwas ist in der Benutzeroberfläche schiefgelaufen.",
|
||||||
"german": "Deutsch",
|
"german": "Deutsch",
|
||||||
@ -321,6 +324,7 @@
|
|||||||
"runner-import": "Läufer:innen Import",
|
"runner-import": "Läufer:innen Import",
|
||||||
"runner-is-being-added": "Läufer:in wird hinzugefügt...",
|
"runner-is-being-added": "Läufer:in wird hinzugefügt...",
|
||||||
"runner-updated": "Läufer:in aktualisiert!",
|
"runner-updated": "Läufer:in aktualisiert!",
|
||||||
|
"runnercards": "Laeuferkarten",
|
||||||
"runnerimport_verify_runners_org": "Bitte die Läufer:innen für den Import in die Organisation \"{org_name}\" bestätigen",
|
"runnerimport_verify_runners_org": "Bitte die Läufer:innen für den Import in die Organisation \"{org_name}\" bestätigen",
|
||||||
"runners": "Läufer",
|
"runners": "Läufer",
|
||||||
"runners-are-being-imported": "Läufer:innen werden importiert ...",
|
"runners-are-being-imported": "Läufer:innen werden importiert ...",
|
||||||
@ -350,6 +354,7 @@
|
|||||||
"settings": "Einstellungen",
|
"settings": "Einstellungen",
|
||||||
"settings-for-your-profile": "Die Einstellungen deines Accounts",
|
"settings-for-your-profile": "Die Einstellungen deines Accounts",
|
||||||
"something-about-the-group": "Infos zur Gruppe",
|
"something-about-the-group": "Infos zur Gruppe",
|
||||||
|
"sponsorings": "Sponsoringerklaerungen",
|
||||||
"stats-are-being-loaded": "Die Statistiken werden geladen...",
|
"stats-are-being-loaded": "Die Statistiken werden geladen...",
|
||||||
"status": "Status",
|
"status": "Status",
|
||||||
"stuff-that-could-harm-your-profile": "Einstellungen, die deinem Profil nachhaltig schaden können",
|
"stuff-that-could-harm-your-profile": "Einstellungen, die deinem Profil nachhaltig schaden können",
|
||||||
|
@ -50,6 +50,7 @@
|
|||||||
"card-deleted": "Card deleted",
|
"card-deleted": "Card deleted",
|
||||||
"card-updated": "Card updated",
|
"card-updated": "Card updated",
|
||||||
"cards": "Cards",
|
"cards": "Cards",
|
||||||
|
"certificates": "Certificates",
|
||||||
"change-your-password-here": "Change your password here",
|
"change-your-password-here": "Change your password here",
|
||||||
"changing-your-password": "Changing your password",
|
"changing-your-password": "Changing your password",
|
||||||
"city": "City",
|
"city": "City",
|
||||||
@ -191,6 +192,8 @@
|
|||||||
"geerbte": "inherited",
|
"geerbte": "inherited",
|
||||||
"general-stats": "General Stats",
|
"general-stats": "General Stats",
|
||||||
"general_promise_error": "😢 Error",
|
"general_promise_error": "😢 Error",
|
||||||
|
"generate-runner-certificate": "Generate runner certificate",
|
||||||
|
"generate-runner-certificates": "Generate runner certificates",
|
||||||
"generate-runnercards": "Generate Runnercards",
|
"generate-runnercards": "Generate Runnercards",
|
||||||
"generate-sponsoring-contract": "generate sponsoring contract",
|
"generate-sponsoring-contract": "generate sponsoring contract",
|
||||||
"generate-sponsoring-contracts": "generate sponsoring contracts",
|
"generate-sponsoring-contracts": "generate sponsoring contracts",
|
||||||
@ -321,6 +324,7 @@
|
|||||||
"runner-import": "Runner Import",
|
"runner-import": "Runner Import",
|
||||||
"runner-is-being-added": "Runner is being added...",
|
"runner-is-being-added": "Runner is being added...",
|
||||||
"runner-updated": "Runner updated!",
|
"runner-updated": "Runner updated!",
|
||||||
|
"runnercards": "Runnercards",
|
||||||
"runnerimport_verify_runners_org": "Please confirm these runners for import into the organization \"{org_name}\"",
|
"runnerimport_verify_runners_org": "Please confirm these runners for import into the organization \"{org_name}\"",
|
||||||
"runners": "Runners",
|
"runners": "Runners",
|
||||||
"runners-are-being-imported": "Runners are being imported...",
|
"runners-are-being-imported": "Runners are being imported...",
|
||||||
@ -350,6 +354,7 @@
|
|||||||
"settings": "Settings",
|
"settings": "Settings",
|
||||||
"settings-for-your-profile": "Settings for your profile",
|
"settings-for-your-profile": "Settings for your profile",
|
||||||
"something-about-the-group": "Something about the group...",
|
"something-about-the-group": "Something about the group...",
|
||||||
|
"sponsorings": "Sponsorings",
|
||||||
"stats-are-being-loaded": "stats are being loaded...",
|
"stats-are-being-loaded": "stats are being loaded...",
|
||||||
"status": "Status",
|
"status": "Status",
|
||||||
"stuff-that-could-harm-your-profile": "Stuff that could harm your profile",
|
"stuff-that-could-harm-your-profile": "Stuff that could harm your profile",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user