2021-04-03 16:53:32 +00:00
|
|
|
<template>
|
|
|
|
<div class="min-h-screen w-full p-4">
|
|
|
|
<section class="text-white body-font">
|
|
|
|
<div class="container mx-auto flex items-center md:flex-row flex-col">
|
2023-02-01 23:15:12 +00:00
|
|
|
<div
|
|
|
|
class="
|
2023-02-01 16:36:22 +00:00
|
|
|
flex flex-col
|
|
|
|
md:pr-10 md:mb-0
|
|
|
|
mb-6
|
|
|
|
pr-0
|
|
|
|
w-full
|
|
|
|
md:w-auto md:text-left
|
|
|
|
text-center text-black
|
|
|
|
dark:text-gray-200
|
2023-02-01 23:15:12 +00:00
|
|
|
"
|
|
|
|
>
|
|
|
|
<p
|
|
|
|
class="text-3xl font-bold whitespace-nowrap"
|
|
|
|
v-text="
|
|
|
|
(state.firstname || '') +
|
|
|
|
' ' +
|
|
|
|
(state.middlename || '') +
|
|
|
|
' ' +
|
|
|
|
(state.lastname || '')
|
|
|
|
"
|
|
|
|
></p>
|
2021-04-03 16:53:32 +00:00
|
|
|
<p class="text-md whitespace-nowrap">{{ state.group }}</p>
|
|
|
|
</div>
|
|
|
|
<div class="inline-flex md:ml-auto md:mr-0 mx-auto items-center">
|
2023-02-01 16:36:22 +00:00
|
|
|
<div v-if="state.delete_active === false">
|
2023-02-01 23:15:12 +00:00
|
|
|
<button
|
|
|
|
type="button"
|
|
|
|
class="
|
|
|
|
focus:border-black focus:ring-2 focus:ring-black
|
|
|
|
text-white text-sm
|
|
|
|
py-2.5
|
|
|
|
px-5
|
|
|
|
rounded-md
|
|
|
|
bg-blue-500
|
|
|
|
hover:bg-blue-600 hover:shadow-lg
|
|
|
|
w-full
|
|
|
|
md:w-auto
|
|
|
|
mb-1
|
|
|
|
md:mr-1
|
|
|
|
"
|
|
|
|
@click="get_registration"
|
|
|
|
>
|
|
|
|
<svg
|
|
|
|
xmlns="http://www.w3.org/2000/svg"
|
|
|
|
width="24"
|
|
|
|
height="24"
|
|
|
|
viewBox="0 0 24 24"
|
|
|
|
fill="none"
|
|
|
|
stroke="currentColor"
|
|
|
|
stroke-width="2"
|
|
|
|
stroke-linecap="round"
|
|
|
|
stroke-linejoin="round"
|
|
|
|
class="feather feather-download"
|
|
|
|
style="display: inline; height: 1rem; vertical-align: sub"
|
|
|
|
>
|
2023-02-01 16:42:51 +00:00
|
|
|
<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" />
|
|
|
|
<polyline points="7 10 12 15 17 10" />
|
|
|
|
<line x1="12" y1="15" x2="12" y2="3" />
|
|
|
|
</svg>
|
2023-02-01 23:10:36 +00:00
|
|
|
{{ $t("download_registrationcode") }}
|
2023-02-01 16:42:51 +00:00
|
|
|
</button>
|
2023-02-01 23:15:12 +00:00
|
|
|
<button
|
|
|
|
type="button"
|
|
|
|
class="
|
|
|
|
focus:border-black focus:ring-2 focus:ring-black
|
|
|
|
text-white text-sm
|
|
|
|
py-2.5
|
|
|
|
px-5
|
|
|
|
rounded-md
|
|
|
|
bg-blue-500
|
|
|
|
hover:bg-blue-600 hover:shadow-lg
|
|
|
|
w-full
|
|
|
|
md:w-auto
|
|
|
|
mb-1
|
|
|
|
md:mr-1
|
|
|
|
"
|
|
|
|
@click="get_certificate"
|
|
|
|
>
|
|
|
|
<svg
|
|
|
|
xmlns="http://www.w3.org/2000/svg"
|
|
|
|
width="24"
|
|
|
|
height="24"
|
|
|
|
viewBox="0 0 24 24"
|
|
|
|
fill="none"
|
|
|
|
stroke="currentColor"
|
|
|
|
stroke-width="2"
|
|
|
|
stroke-linecap="round"
|
|
|
|
stroke-linejoin="round"
|
|
|
|
class="feather feather-download"
|
|
|
|
style="display: inline; height: 1rem; vertical-align: sub"
|
|
|
|
>
|
2021-04-03 16:53:32 +00:00
|
|
|
<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" />
|
|
|
|
<polyline points="7 10 12 15 17 10" />
|
|
|
|
<line x1="12" y1="15" x2="12" y2="3" />
|
|
|
|
</svg>
|
2023-02-01 16:36:22 +00:00
|
|
|
{{ $t("download_certificate") }}
|
2021-04-03 16:53:32 +00:00
|
|
|
</button>
|
2023-02-01 23:15:12 +00:00
|
|
|
<button
|
|
|
|
type="button"
|
|
|
|
class="
|
2023-02-01 16:36:22 +00:00
|
|
|
focus:border-black focus:ring-2 focus:ring-black
|
|
|
|
text-white text-sm
|
|
|
|
py-2.5
|
|
|
|
px-5
|
|
|
|
rounded-md
|
|
|
|
bg-red-600
|
|
|
|
hover:bg-red-700 hover:shadow-lg
|
2023-02-01 23:15:12 +00:00
|
|
|
w-full
|
|
|
|
md:w-auto
|
|
|
|
"
|
|
|
|
@click="
|
2023-02-01 16:36:22 +00:00
|
|
|
() => {
|
|
|
|
state.delete_active = true;
|
|
|
|
}
|
2023-02-01 23:15:12 +00:00
|
|
|
"
|
|
|
|
>
|
|
|
|
<svg
|
|
|
|
xmlns="http://www.w3.org/2000/svg"
|
|
|
|
width="24"
|
|
|
|
height="24"
|
|
|
|
viewBox="0 0 24 24"
|
|
|
|
fill="none"
|
|
|
|
stroke="none"
|
|
|
|
stroke-width="2"
|
|
|
|
stroke-linecap="round"
|
|
|
|
stroke-linejoin="round"
|
|
|
|
class="feather feather-download"
|
|
|
|
style="display: inline; height: 1rem; vertical-align: sub"
|
|
|
|
>
|
2021-04-03 16:53:32 +00:00
|
|
|
<path d="M0 0h24v24H0z" />
|
2023-02-01 23:15:12 +00:00
|
|
|
<path
|
|
|
|
fill="currentColor"
|
|
|
|
d="M17 6h5v2h-2v13a1 1 0 01-1 1H5a1 1 0 01-1-1V8H2V6h5V3a1 1 0 011-1h8a1 1 0 011 1v3zm1 2H6v12h12V8zm-5 6l2 2-1 1-2-2-2 2-1-1 2-2-2-2 1-1 2 2 2-2 1 1-2 2zM9 4v2h6V4H9z"
|
|
|
|
/>
|
2021-04-03 16:53:32 +00:00
|
|
|
</svg>
|
2023-02-01 16:36:22 +00:00
|
|
|
{{ $t("delete_my_data") }}
|
2021-04-03 16:53:32 +00:00
|
|
|
</button>
|
|
|
|
</div>
|
2023-02-01 16:36:22 +00:00
|
|
|
<div v-if="state.delete_active === true">
|
2023-02-01 23:15:12 +00:00
|
|
|
<button
|
|
|
|
type="button"
|
|
|
|
class="
|
2023-02-01 16:36:22 +00:00
|
|
|
focus:border-black focus:ring-2 focus:ring-black
|
|
|
|
text-white text-sm
|
|
|
|
py-2.5
|
|
|
|
px-5
|
|
|
|
rounded-md
|
|
|
|
bg-blue-500
|
|
|
|
hover:bg-blue-600 hover:shadow-lg
|
2023-02-01 23:15:12 +00:00
|
|
|
"
|
|
|
|
@click="
|
2023-02-01 16:36:22 +00:00
|
|
|
() => {
|
|
|
|
state.delete_active = false;
|
|
|
|
}
|
2023-02-01 23:15:12 +00:00
|
|
|
"
|
|
|
|
>
|
|
|
|
<svg
|
|
|
|
xmlns="http://www.w3.org/2000/svg"
|
|
|
|
width="24"
|
|
|
|
height="24"
|
|
|
|
viewBox="0 0 24 24"
|
|
|
|
fill="none"
|
|
|
|
stroke="none"
|
|
|
|
stroke-width="2"
|
|
|
|
stroke-linecap="round"
|
|
|
|
stroke-linejoin="round"
|
|
|
|
class="feather feather-download"
|
|
|
|
style="display: inline; height: 1rem; vertical-align: sub"
|
|
|
|
>
|
2021-04-03 16:53:32 +00:00
|
|
|
<path fill="none" d="M0 0h24v24H0z" />
|
2023-02-01 23:15:12 +00:00
|
|
|
<path
|
|
|
|
fill="currentColor"
|
|
|
|
d="M12 11l5-5 1 1-5 5 5 5-1 1-5-5-5 5-1-1 5-5-5-5 1-1z"
|
|
|
|
/>
|
2021-04-03 16:53:32 +00:00
|
|
|
</svg>
|
2023-02-01 16:36:22 +00:00
|
|
|
{{ $t("cancel_keep_my_data") }}
|
2021-04-03 16:53:32 +00:00
|
|
|
</button>
|
2023-02-01 23:15:12 +00:00
|
|
|
<button
|
|
|
|
type="button"
|
|
|
|
class="
|
2023-02-01 16:36:22 +00:00
|
|
|
focus:border-black focus:ring-2 focus:ring-black
|
|
|
|
text-white text-sm
|
|
|
|
py-2.5
|
|
|
|
px-5
|
|
|
|
rounded-md
|
|
|
|
bg-red-600
|
|
|
|
hover:bg-red-700 hover:shadow-lg
|
|
|
|
ml-1
|
2023-02-01 23:15:12 +00:00
|
|
|
"
|
|
|
|
@click="delete_me"
|
|
|
|
>
|
|
|
|
<svg
|
|
|
|
xmlns="http://www.w3.org/2000/svg"
|
|
|
|
width="24"
|
|
|
|
height="24"
|
|
|
|
viewBox="0 0 24 24"
|
|
|
|
fill="none"
|
|
|
|
stroke="none"
|
|
|
|
stroke-width="2"
|
|
|
|
stroke-linecap="round"
|
|
|
|
stroke-linejoin="round"
|
|
|
|
class="feather feather-download"
|
|
|
|
style="display: inline; height: 1rem; vertical-align: sub"
|
|
|
|
>
|
2021-04-03 16:53:32 +00:00
|
|
|
<path d="M0 0h24v24H0z" />
|
2023-02-01 23:15:12 +00:00
|
|
|
<path
|
|
|
|
fill="currentColor"
|
|
|
|
d="M17 6h5v2h-2v13a1 1 0 01-1 1H5a1 1 0 01-1-1V8H2V6h5V3a1 1 0 011-1h8a1 1 0 011 1v3zm1 2H6v12h12V8zm-5 6l2 2-1 1-2-2-2 2-1-1 2-2-2-2 1-1 2 2 2-2 1 1-2 2zM9 4v2h6V4H9z"
|
|
|
|
/>
|
2021-04-03 16:53:32 +00:00
|
|
|
</svg>
|
2023-02-01 16:36:22 +00:00
|
|
|
{{ $t("confirm_delete_all_of_my_data") }}
|
2021-04-03 16:53:32 +00:00
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</section>
|
|
|
|
<div class="flex flex-wrap">
|
|
|
|
<div class="w-full p-4">
|
|
|
|
<div class="flex flex-wrap flex-col w-full tabs">
|
|
|
|
<div class="flex lg:flex-wrap flex-row lg:space-x-2">
|
|
|
|
<div class="flex-none">
|
2023-02-01 23:15:12 +00:00
|
|
|
<button
|
|
|
|
@click="
|
|
|
|
() => {
|
|
|
|
state.activetab = 'profile';
|
|
|
|
}
|
|
|
|
"
|
|
|
|
:class="{
|
|
|
|
'tab-active border-b-2 font-medium border-blue-500':
|
|
|
|
state.activetab === 'profile',
|
|
|
|
}"
|
|
|
|
class="tab tab-underline py-4 px-6 block"
|
|
|
|
type="button"
|
|
|
|
>
|
2023-02-01 16:36:22 +00:00
|
|
|
{{ $t("profile") }}
|
|
|
|
</button>
|
2021-04-03 16:53:32 +00:00
|
|
|
</div>
|
|
|
|
<div class="flex-none">
|
2023-02-01 23:15:12 +00:00
|
|
|
<button
|
|
|
|
@click="
|
|
|
|
() => {
|
|
|
|
state.activetab = 'laptimes';
|
|
|
|
}
|
|
|
|
"
|
|
|
|
:class="{
|
|
|
|
'tab-active border-b-2 font-medium border-blue-500':
|
|
|
|
state.activetab === 'laptimes',
|
|
|
|
}"
|
|
|
|
class="tab tab-underline py-4 px-6 block"
|
|
|
|
type="button"
|
|
|
|
>
|
2023-02-01 16:36:22 +00:00
|
|
|
{{ $t("lap_times") }}
|
|
|
|
</button>
|
2021-04-03 16:53:32 +00:00
|
|
|
</div>
|
|
|
|
<div class="flex-none">
|
2023-02-01 23:15:12 +00:00
|
|
|
<button
|
|
|
|
@click="
|
|
|
|
() => {
|
|
|
|
state.activetab = 'sponsorings';
|
|
|
|
}
|
|
|
|
"
|
|
|
|
:class="{
|
|
|
|
'tab-active border-b-2 font-medium border-blue-500':
|
|
|
|
state.activetab === 'sponsorings',
|
|
|
|
}"
|
|
|
|
class="tab tab-underline py-4 px-6 block"
|
|
|
|
type="button"
|
|
|
|
>
|
2023-02-01 16:36:22 +00:00
|
|
|
{{ $t("sponsoring") }}
|
|
|
|
</button>
|
2021-04-03 16:53:32 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
2023-02-01 16:36:22 +00:00
|
|
|
<div v-if="state.activetab === 'profile'" class="tab-content block">
|
2021-04-03 16:53:32 +00:00
|
|
|
<div class="py-4 w-full">
|
|
|
|
<div class="flex flex-col">
|
|
|
|
<form class="form flex flex-wrap w-full">
|
|
|
|
<div class="w-full">
|
|
|
|
<div class="form-element">
|
2023-02-01 16:36:22 +00:00
|
|
|
<div class="text-lg">{{ $t("registrierungscode") }}</div>
|
|
|
|
<img alt="Registrierungscode" :src="state.barcode" />
|
|
|
|
<div class="text-lg">{{ $t("vorname") }}</div>
|
2023-02-01 23:15:12 +00:00
|
|
|
<p
|
|
|
|
class="
|
2023-02-01 16:36:22 +00:00
|
|
|
h-10
|
|
|
|
w-full
|
|
|
|
dark:bg-gray-800
|
|
|
|
rounded
|
|
|
|
text-base
|
|
|
|
outline-none
|
|
|
|
dark:text-gray-100
|
|
|
|
text-gray-600
|
|
|
|
py-1
|
|
|
|
px-3
|
|
|
|
leading-8
|
|
|
|
transition-colors
|
|
|
|
duration-200
|
|
|
|
ease-in-out
|
2023-02-01 23:15:12 +00:00
|
|
|
"
|
|
|
|
v-text="state.firstname"
|
|
|
|
/>
|
2021-04-03 16:53:32 +00:00
|
|
|
</div>
|
|
|
|
<div class="form-element">
|
2023-02-01 16:36:22 +00:00
|
|
|
<div class="text-lg">{{ $t("mittelname") }}</div>
|
2023-02-01 23:15:12 +00:00
|
|
|
<p
|
|
|
|
class="
|
2023-02-01 16:36:22 +00:00
|
|
|
h-10
|
|
|
|
w-full
|
|
|
|
dark:bg-gray-800
|
|
|
|
rounded
|
|
|
|
text-base
|
|
|
|
outline-none
|
|
|
|
dark:text-gray-100
|
|
|
|
text-gray-600
|
|
|
|
py-1
|
|
|
|
px-3
|
|
|
|
leading-8
|
|
|
|
transition-colors
|
|
|
|
duration-200
|
|
|
|
ease-in-out
|
2023-02-01 23:15:12 +00:00
|
|
|
"
|
|
|
|
v-text="state.middlename"
|
|
|
|
/>
|
2021-04-03 16:53:32 +00:00
|
|
|
</div>
|
|
|
|
<div class="form-element">
|
2023-02-01 16:36:22 +00:00
|
|
|
<div class="text-lg">{{ $t("nachname") }}</div>
|
2023-02-01 23:15:12 +00:00
|
|
|
<p
|
|
|
|
class="
|
2023-02-01 16:36:22 +00:00
|
|
|
h-10
|
|
|
|
w-full
|
|
|
|
dark:bg-gray-800
|
|
|
|
rounded
|
|
|
|
text-base
|
|
|
|
outline-none
|
|
|
|
dark:text-gray-100
|
|
|
|
text-gray-600
|
|
|
|
py-1
|
|
|
|
px-3
|
|
|
|
leading-8
|
|
|
|
transition-colors
|
|
|
|
duration-200
|
|
|
|
ease-in-out
|
2023-02-01 23:15:12 +00:00
|
|
|
"
|
|
|
|
v-text="state.lastname"
|
|
|
|
/>
|
2021-04-03 16:53:32 +00:00
|
|
|
</div>
|
|
|
|
<div class="form-element">
|
2023-02-01 16:36:22 +00:00
|
|
|
<div class="text-lg">{{ $t("e_mail_adress") }}</div>
|
2023-02-01 23:15:12 +00:00
|
|
|
<p
|
|
|
|
class="
|
2023-02-01 16:36:22 +00:00
|
|
|
h-10
|
|
|
|
w-full
|
|
|
|
dark:bg-gray-800
|
|
|
|
rounded
|
|
|
|
text-base
|
|
|
|
outline-none
|
|
|
|
dark:text-gray-100
|
|
|
|
text-gray-600
|
|
|
|
py-1
|
|
|
|
px-3
|
|
|
|
leading-8
|
|
|
|
transition-colors
|
|
|
|
duration-200
|
|
|
|
ease-in-out
|
2023-02-01 23:15:12 +00:00
|
|
|
"
|
|
|
|
v-text="state.email"
|
|
|
|
/>
|
2021-04-03 16:53:32 +00:00
|
|
|
</div>
|
|
|
|
<div class="form-element">
|
2023-02-01 16:36:22 +00:00
|
|
|
<div class="text-lg">{{ $t("phone_number") }}</div>
|
2023-02-01 23:15:12 +00:00
|
|
|
<p
|
|
|
|
class="
|
2023-02-01 16:36:22 +00:00
|
|
|
h-10
|
|
|
|
w-full
|
|
|
|
dark:bg-gray-800
|
|
|
|
rounded
|
|
|
|
text-base
|
|
|
|
outline-none
|
|
|
|
dark:text-gray-100
|
|
|
|
text-gray-600
|
|
|
|
py-1
|
|
|
|
px-3
|
|
|
|
leading-8
|
|
|
|
transition-colors
|
|
|
|
duration-200
|
|
|
|
ease-in-out
|
2023-02-01 23:15:12 +00:00
|
|
|
"
|
|
|
|
v-text="state.phone"
|
|
|
|
/>
|
2021-04-03 16:53:32 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2023-02-01 16:36:22 +00:00
|
|
|
<div v-if="state.activetab === 'laptimes'" class="tab-content block">
|
2021-04-03 16:53:32 +00:00
|
|
|
<div class="py-4 w-full">
|
|
|
|
<section class="text-gray-400 dark:bg-gray-900 body-font">
|
|
|
|
<div class="container mx-auto">
|
|
|
|
<div class="lg:w-2/3 w-full mx-auto overflow-auto">
|
2023-02-01 23:15:12 +00:00
|
|
|
<table
|
|
|
|
v-if="state.scans.length > 0"
|
|
|
|
class="table-auto w-full text-left whitespace-no-wrap"
|
|
|
|
>
|
|
|
|
<thead
|
|
|
|
class="
|
2023-02-01 16:36:22 +00:00
|
|
|
text-black
|
|
|
|
bg-gray-300
|
|
|
|
dark:text-white
|
|
|
|
text-sm
|
|
|
|
dark:bg-gray-800
|
2023-02-01 23:15:12 +00:00
|
|
|
"
|
|
|
|
>
|
2021-04-03 16:53:32 +00:00
|
|
|
<tr>
|
2023-02-01 23:15:12 +00:00
|
|
|
<th
|
|
|
|
class="
|
2023-02-01 16:36:22 +00:00
|
|
|
px-4
|
|
|
|
py-3
|
|
|
|
title-font
|
|
|
|
tracking-wider
|
|
|
|
font-medium
|
2023-02-01 23:15:12 +00:00
|
|
|
"
|
|
|
|
>
|
2023-02-01 16:36:22 +00:00
|
|
|
{{ $t("distance") }}
|
|
|
|
</th>
|
2023-02-01 23:15:12 +00:00
|
|
|
<th
|
|
|
|
class="
|
2023-02-01 16:36:22 +00:00
|
|
|
px-4
|
|
|
|
py-3
|
|
|
|
title-font
|
|
|
|
tracking-wider
|
|
|
|
font-medium
|
2023-02-01 23:15:12 +00:00
|
|
|
"
|
|
|
|
>
|
2023-02-01 16:36:22 +00:00
|
|
|
{{ $t("lap_time") }}
|
|
|
|
</th>
|
2021-04-03 16:53:32 +00:00
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody class="text-gray-900 dark:text-gray-50">
|
|
|
|
<tr v-for="s in state.scans" :key="s.id">
|
|
|
|
<td class="px-4 py-3">
|
2021-04-06 19:23:24 +00:00
|
|
|
<span v-text="s.distance"></span>
|
2021-04-03 16:53:32 +00:00
|
|
|
</td>
|
|
|
|
<td class="px-4 py-3" v-text="s.lapTime"></td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
2023-02-01 23:15:12 +00:00
|
|
|
<div
|
|
|
|
v-else
|
|
|
|
class="
|
2023-02-01 16:36:22 +00:00
|
|
|
text-center
|
|
|
|
font-bold
|
|
|
|
text-black
|
|
|
|
dark:text-white
|
|
|
|
text-2xl
|
2023-02-01 23:15:12 +00:00
|
|
|
"
|
|
|
|
>
|
|
|
|
<img
|
|
|
|
src="../assets/empty_laps.svg"
|
|
|
|
style="height: 25rem; margin: 0 auto"
|
|
|
|
:alt="[[$t('no_laps_scans_were_recorded_yet')]]"
|
|
|
|
/>
|
2023-02-01 16:36:22 +00:00
|
|
|
{{ $t("no_laps_scans_were_recorded_yet") }}
|
2021-04-03 16:53:32 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</section>
|
|
|
|
</div>
|
|
|
|
</div>
|
2023-02-01 23:15:12 +00:00
|
|
|
<div
|
|
|
|
v-if="state.activetab === 'sponsorings'"
|
|
|
|
class="tab-content block"
|
|
|
|
>
|
2021-04-06 15:14:22 +00:00
|
|
|
<div class="py-4 w-full">
|
|
|
|
<section class="text-gray-400 dark:bg-gray-900 body-font">
|
|
|
|
<div class="container mx-auto">
|
|
|
|
<div class="lg:w-2/3 w-full mx-auto overflow-auto">
|
2023-02-01 23:15:12 +00:00
|
|
|
<table
|
|
|
|
v-if="state.sponsorings.length > 0"
|
|
|
|
class="table-auto w-full text-left whitespace-no-wrap"
|
|
|
|
>
|
|
|
|
<thead
|
|
|
|
class="
|
2023-02-01 16:36:22 +00:00
|
|
|
text-black
|
|
|
|
bg-gray-300
|
|
|
|
dark:text-white
|
|
|
|
text-sm
|
|
|
|
dark:bg-gray-800
|
2023-02-01 23:15:12 +00:00
|
|
|
"
|
|
|
|
>
|
2021-04-06 15:14:22 +00:00
|
|
|
<tr>
|
2023-02-01 23:15:12 +00:00
|
|
|
<th
|
|
|
|
class="
|
2023-02-01 16:36:22 +00:00
|
|
|
px-4
|
|
|
|
py-3
|
|
|
|
title-font
|
|
|
|
tracking-wider
|
|
|
|
font-medium
|
2023-02-01 23:15:12 +00:00
|
|
|
"
|
|
|
|
>
|
2023-02-01 16:36:22 +00:00
|
|
|
Name
|
|
|
|
</th>
|
2023-02-01 23:15:12 +00:00
|
|
|
<th
|
|
|
|
class="
|
2023-02-01 16:36:22 +00:00
|
|
|
px-4
|
|
|
|
py-3
|
|
|
|
title-font
|
|
|
|
tracking-wider
|
|
|
|
font-medium
|
2023-02-01 23:15:12 +00:00
|
|
|
"
|
|
|
|
>
|
2023-02-01 16:36:22 +00:00
|
|
|
{{ $t("amount_per_kilometer_in_eur") }}
|
|
|
|
</th>
|
2023-02-01 23:15:12 +00:00
|
|
|
<th
|
|
|
|
class="
|
2023-02-01 16:36:22 +00:00
|
|
|
px-4
|
|
|
|
py-3
|
|
|
|
title-font
|
|
|
|
tracking-wider
|
|
|
|
font-medium
|
2023-02-01 23:15:12 +00:00
|
|
|
"
|
|
|
|
>
|
2023-02-01 16:36:22 +00:00
|
|
|
{{ $t("current_total_amount_in_eur") }}
|
|
|
|
</th>
|
2021-04-06 15:14:22 +00:00
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody class="text-gray-900 dark:text-gray-50">
|
|
|
|
<tr v-for="s in state.sponsorings" :key="s.id">
|
|
|
|
<td class="px-4 py-3">
|
2021-04-06 15:20:41 +00:00
|
|
|
<span v-text="s.donor.firstname"></span>
|
2021-04-06 15:18:09 +00:00
|
|
|
<span v-if="s.donor.middlename">
|
2021-04-06 15:20:41 +00:00
|
|
|
<span v-text="s.donor.middlename"></span>
|
2021-04-06 15:18:09 +00:00
|
|
|
</span>
|
2021-04-06 15:14:22 +00:00
|
|
|
<span v-text="s.donor.lastname"></span>
|
|
|
|
</td>
|
|
|
|
<td class="px-4 py-3">
|
2023-02-01 23:15:12 +00:00
|
|
|
<span
|
|
|
|
v-text="
|
|
|
|
(s.amountPerDistance / 100)
|
|
|
|
.toFixed(2)
|
|
|
|
.toLocaleString('de-DE', { valute: 'EUR' })
|
|
|
|
"
|
|
|
|
></span
|
|
|
|
>€
|
2021-04-06 15:14:22 +00:00
|
|
|
</td>
|
|
|
|
<td class="px-4 py-3">
|
2023-02-01 23:15:12 +00:00
|
|
|
<span
|
|
|
|
v-text="
|
|
|
|
(s.amount / 100)
|
|
|
|
.toFixed(2)
|
|
|
|
.toLocaleString('de-DE', { valute: 'EUR' })
|
|
|
|
"
|
|
|
|
></span
|
|
|
|
>€
|
2021-04-06 15:14:22 +00:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
2021-04-06 19:25:10 +00:00
|
|
|
<tfoot class="text-gray-900 dark:text-gray-50">
|
|
|
|
<tr>
|
2023-02-01 16:36:22 +00:00
|
|
|
<td class="px-4 py-3">{{ $t("total") }}</td>
|
2021-04-06 19:25:10 +00:00
|
|
|
<td class="px-4 py-3">
|
2023-02-01 23:15:12 +00:00
|
|
|
<span
|
|
|
|
v-text="
|
|
|
|
(
|
|
|
|
state.sponsorings.reduce(function (
|
|
|
|
sum,
|
|
|
|
current
|
|
|
|
) {
|
|
|
|
return sum + current.amountPerDistance;
|
|
|
|
},
|
2023-02-01 16:36:22 +00:00
|
|
|
0) / 100
|
2023-02-01 23:15:12 +00:00
|
|
|
)
|
|
|
|
.toFixed(2)
|
|
|
|
.toLocaleString('de-DE', { valute: 'EUR' })
|
|
|
|
"
|
|
|
|
></span
|
|
|
|
>€
|
2021-04-06 19:25:10 +00:00
|
|
|
</td>
|
|
|
|
<td class="px-4 py-3">
|
2023-02-01 23:15:12 +00:00
|
|
|
<span
|
|
|
|
v-text="
|
|
|
|
(
|
|
|
|
state.sponsorings.reduce(function (
|
|
|
|
sum,
|
|
|
|
current
|
|
|
|
) {
|
|
|
|
return sum + current.amount;
|
|
|
|
},
|
2023-02-01 16:36:22 +00:00
|
|
|
0) / 100
|
2023-02-01 23:15:12 +00:00
|
|
|
)
|
|
|
|
.toFixed(2)
|
|
|
|
.toLocaleString('de-DE', { valute: 'EUR' })
|
|
|
|
"
|
|
|
|
></span
|
|
|
|
>€
|
2021-04-06 19:25:10 +00:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</tfoot>
|
2021-04-06 15:14:22 +00:00
|
|
|
</table>
|
2023-02-01 23:15:12 +00:00
|
|
|
<div
|
|
|
|
v-else
|
|
|
|
class="
|
2023-02-01 16:36:22 +00:00
|
|
|
text-center
|
|
|
|
font-bold
|
|
|
|
text-black
|
|
|
|
dark:text-white
|
|
|
|
text-2xl
|
2023-02-01 23:15:12 +00:00
|
|
|
"
|
|
|
|
>
|
|
|
|
<img
|
|
|
|
src="../assets/empty_laps.svg"
|
|
|
|
style="height: 25rem; margin: 0 auto"
|
|
|
|
:alt="[
|
|
|
|
[$t('no_sponsorings_for_you_were_recorded_yet')],
|
|
|
|
]"
|
|
|
|
/>
|
2023-02-01 16:36:22 +00:00
|
|
|
{{ $t("no_sponsorings_for_you_were_recorded_yet") }}
|
2021-04-06 15:14:22 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</section>
|
|
|
|
</div>
|
2021-04-03 16:53:32 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script setup>
|
|
|
|
import { reactive } from "vue";
|
2023-02-01 13:47:38 +00:00
|
|
|
import { TYPE, useToast } from "vue-toastification";
|
2021-04-03 16:53:32 +00:00
|
|
|
import axios from "redaxios";
|
2023-02-01 16:39:03 +00:00
|
|
|
import bwipjs from "bwip-js";
|
2023-02-01 13:48:06 +00:00
|
|
|
|
2023-02-01 16:36:22 +00:00
|
|
|
function textToBase64Barcode(text) {
|
2023-02-01 13:48:06 +00:00
|
|
|
var canvas = document.createElement("canvas");
|
2023-02-01 23:15:12 +00:00
|
|
|
bwipjs.toCanvas(canvas, {
|
|
|
|
bcid: config.codeformat || "code39",
|
|
|
|
text: text,
|
|
|
|
scale: 3,
|
|
|
|
height: 10,
|
|
|
|
// width: 10,
|
|
|
|
includetext: true,
|
|
|
|
textxalign: "center",
|
|
|
|
backgroundcolor: "ffffff",
|
|
|
|
});
|
2023-02-01 13:48:06 +00:00
|
|
|
return canvas.toDataURL("image/png");
|
|
|
|
}
|
2021-04-03 16:53:32 +00:00
|
|
|
|
|
|
|
const state = reactive({
|
2023-02-01 13:48:06 +00:00
|
|
|
barcode: "",
|
2021-04-03 16:53:32 +00:00
|
|
|
phone: "",
|
|
|
|
email: "",
|
|
|
|
firstname: "",
|
|
|
|
middlename: "",
|
|
|
|
lastname: "",
|
|
|
|
scans: [],
|
2021-04-06 15:14:22 +00:00
|
|
|
sponsorings: [],
|
2021-04-03 16:53:32 +00:00
|
|
|
group: "",
|
|
|
|
activetab: "profile",
|
|
|
|
delete_active: false,
|
2023-02-01 23:15:12 +00:00
|
|
|
fullobject: {},
|
|
|
|
});
|
2021-04-03 16:53:32 +00:00
|
|
|
const toast = useToast();
|
|
|
|
const props = defineProps({
|
2023-02-01 16:36:22 +00:00
|
|
|
token: String,
|
|
|
|
});
|
2021-04-03 16:53:32 +00:00
|
|
|
const accesstoken = atob(props.token);
|
2023-02-01 16:36:22 +00:00
|
|
|
axios
|
|
|
|
.get(`${config.baseurl}api/runners/me/${accesstoken}`)
|
2021-04-03 16:53:32 +00:00
|
|
|
.then(({ data }) => {
|
|
|
|
state.phone = data.phone;
|
|
|
|
state.email = data.email;
|
|
|
|
state.firstname = data.firstname;
|
|
|
|
state.middlename = data.middlename;
|
|
|
|
state.lastname = data.lastname;
|
|
|
|
state.group = data.group;
|
2021-04-06 15:14:22 +00:00
|
|
|
state.sponsorings = data.distanceDonations;
|
2021-04-03 16:53:32 +00:00
|
|
|
state.fullobject = data;
|
2023-02-01 23:15:12 +00:00
|
|
|
state.barcode = textToBase64Barcode(data.id ?? "???");
|
2021-04-03 16:53:32 +00:00
|
|
|
})
|
2023-02-01 16:36:22 +00:00
|
|
|
.catch((error) => {
|
2023-02-01 23:15:12 +00:00
|
|
|
toast.clear();
|
2023-02-01 16:36:22 +00:00
|
|
|
toast.error("Profil konnte nicht geladen werden...");
|
|
|
|
});
|
|
|
|
axios
|
|
|
|
.get(`${config.baseurl}api/runners/me/${accesstoken}/scans`)
|
2021-04-03 16:53:32 +00:00
|
|
|
.then(({ data }) => {
|
2023-02-01 16:36:22 +00:00
|
|
|
data.map(function (s) {
|
|
|
|
s.lapTime =
|
|
|
|
Math.floor(s.lapTime / 60) +
|
|
|
|
"min " +
|
|
|
|
(Math.floor(s.lapTime % 60) + "").padStart(2, "0") +
|
|
|
|
"s";
|
|
|
|
s.distance =
|
|
|
|
Math.floor(s.distance / 1000) +
|
|
|
|
"km " +
|
|
|
|
(Math.floor(s.distance % 1000) + "").padStart(3, "0") +
|
|
|
|
"m";
|
2021-04-03 16:53:32 +00:00
|
|
|
return s;
|
2023-02-01 16:36:22 +00:00
|
|
|
});
|
|
|
|
data.filter((s) => s.valid === true);
|
2021-04-03 16:53:32 +00:00
|
|
|
state.scans = data;
|
|
|
|
})
|
2023-02-01 16:36:22 +00:00
|
|
|
.catch((error) => {
|
|
|
|
toast.error("Profil konnte nicht geladen werden...");
|
|
|
|
});
|
2021-04-03 16:53:32 +00:00
|
|
|
function delete_me() {
|
2023-02-01 23:15:12 +00:00
|
|
|
toast.clear();
|
2023-01-31 12:45:28 +00:00
|
|
|
toast("Profil wird gelöscht...");
|
2023-02-01 16:36:22 +00:00
|
|
|
let url = `${config.baseurl}api/runners/me/${accesstoken}?force=true`;
|
|
|
|
axios
|
|
|
|
.delete(url)
|
2021-04-03 16:53:32 +00:00
|
|
|
.then(() => {
|
2023-02-01 23:15:12 +00:00
|
|
|
toast.clear();
|
2023-01-31 12:45:28 +00:00
|
|
|
toast("Alle Daten gelöscht!");
|
2021-04-03 16:53:32 +00:00
|
|
|
location.replace(`${config.baseurl_selfservice}`);
|
|
|
|
})
|
|
|
|
.catch((error) => {
|
2023-02-01 23:15:12 +00:00
|
|
|
toast.clear();
|
2023-01-31 12:45:28 +00:00
|
|
|
toast.error("Profil konnte nicht gelöscht werden...");
|
2021-04-03 16:53:32 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
function get_certificate() {
|
2023-01-31 12:45:28 +00:00
|
|
|
toast("Urkunde wird generiert...");
|
2023-02-01 16:36:22 +00:00
|
|
|
const browserlocale = (
|
|
|
|
(navigator.languages && navigator.languages[0]) ||
|
|
|
|
""
|
|
|
|
).substr(0, 2);
|
2021-04-14 10:18:02 +00:00
|
|
|
let url = `${config.baseurl_documentserver}certificates?locale=${browserlocale}&download=true&key=${config.documentserver_key}`;
|
2021-04-03 16:53:32 +00:00
|
|
|
let postdata = Object.assign({}, state.fullobject);
|
|
|
|
postdata.group = {
|
2023-02-01 16:36:22 +00:00
|
|
|
name: postdata.group,
|
|
|
|
};
|
|
|
|
postdata = [postdata];
|
|
|
|
axios
|
|
|
|
.post(url, postdata, {
|
|
|
|
responseType: "blob",
|
|
|
|
})
|
2021-04-03 16:53:32 +00:00
|
|
|
.then((response) => {
|
2023-02-01 16:36:22 +00:00
|
|
|
console.log(response);
|
2021-04-03 16:53:32 +00:00
|
|
|
if (response.status != "200") {
|
2023-01-31 12:45:28 +00:00
|
|
|
toast.error("Urkunde konnte nicht generiert werden...");
|
2021-04-03 16:53:32 +00:00
|
|
|
} else {
|
2023-02-01 16:36:22 +00:00
|
|
|
var fileURL = window.URL.createObjectURL(
|
|
|
|
new Blob([response.data], { type: "application/pdf" })
|
2023-02-01 23:15:12 +00:00
|
|
|
);
|
2023-02-01 16:36:22 +00:00
|
|
|
var fileLink = document.createElement("a");
|
2021-04-03 16:53:32 +00:00
|
|
|
|
|
|
|
fileLink.href = fileURL;
|
2023-02-01 16:36:22 +00:00
|
|
|
fileLink.setAttribute("download", "Certificate.pdf");
|
2021-04-03 16:53:32 +00:00
|
|
|
document.body.appendChild(fileLink);
|
2023-02-01 23:15:12 +00:00
|
|
|
|
2021-04-03 16:53:32 +00:00
|
|
|
fileLink.click();
|
|
|
|
fileLink.remove();
|
2023-02-01 23:15:12 +00:00
|
|
|
toast.clear();
|
2023-02-01 16:36:22 +00:00
|
|
|
toast("Urkunde generiert!", { type: TYPE.SUCCESS });
|
2021-04-03 16:53:32 +00:00
|
|
|
}
|
|
|
|
})
|
|
|
|
.catch((err) => {
|
|
|
|
console.error(err);
|
2023-02-01 23:15:12 +00:00
|
|
|
toast.clear();
|
|
|
|
toast.error("Urkunde konnte nicht generiert werden...");
|
2021-04-03 16:53:32 +00:00
|
|
|
});
|
|
|
|
}
|
2023-02-01 16:48:52 +00:00
|
|
|
function get_registration() {
|
2023-02-01 23:15:12 +00:00
|
|
|
toast.clear();
|
2023-02-01 16:48:52 +00:00
|
|
|
toast("Registrierungscode wird generiert...");
|
|
|
|
var a = document.createElement("a");
|
|
|
|
a.href = state.barcode;
|
|
|
|
a.download = "LfK23_Registrierungscode.png";
|
|
|
|
a.click();
|
2023-02-01 23:15:12 +00:00
|
|
|
toast.clear();
|
2023-02-01 16:48:52 +00:00
|
|
|
toast("Registrierungscode generiert!", { type: TYPE.SUCCESS });
|
|
|
|
}
|
2021-02-24 20:00:27 +00:00
|
|
|
</script>
|