feature/11-user-scans #13

Merged
philipp merged 8 commits from feature/11-user-scans into dev 2021-03-09 16:51:55 +00:00
2 changed files with 15 additions and 13 deletions
Showing only changes of commit 45c0bdd5cf - Show all commits

View File

@ -9,7 +9,7 @@
class="text-3xl font-bold whitespace-nowrap" class="text-3xl font-bold whitespace-nowrap"
v-text="(state.firstname || '') + ' ' + (state.middlename || '') + ' ' + (state.lastname || '')" v-text="(state.firstname || '') + ' ' + (state.middlename || '') + ' ' + (state.lastname || '')"
></p> ></p>
<p class="text-md whitespace-nowrap">Musterfirma > PR</p> <p class="text-md whitespace-nowrap">{{ state.group }}</p>
</div> </div>
<div class="inline-flex md:ml-auto md:mr-0 mx-auto items-center space-x-4"> <div class="inline-flex md:ml-auto md:mr-0 mx-auto items-center space-x-4">
<button <button
@ -48,30 +48,30 @@
<div class="flex lg:flex-wrap flex-row lg:space-x-2"> <div class="flex lg:flex-wrap flex-row lg:space-x-2">
<div class="flex-none"> <div class="flex-none">
<button <button
@click="() => { activetab = 'profile' }" @click="() => { state.activetab = 'profile' }"
:class="{ 'tab-active border-b-2 font-medium border-blue-500': (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" class="tab tab-underline py-4 px-6 block"
type="button" type="button"
>{{ $t('profile') }}</button> >{{ $t('profile') }}</button>
</div> </div>
<div class="flex-none"> <div class="flex-none">
<button <button
@click="() => { activetab = 'laptimes' }" @click="() => { state.activetab = 'laptimes' }"
:class="{ 'tab-active border-b-2 font-medium border-blue-500': (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" class="tab tab-underline py-4 px-6 block"
type="button" type="button"
>{{ $t('lap_times') }}</button> >{{ $t('lap_times') }}</button>
</div> </div>
<div class="flex-none"> <div class="flex-none">
<button <button
@click="() => { activetab = 'sponsorings' }" @click="() => { state.activetab = 'sponsorings' }"
:class="{ 'tab-active border-b-2 font-medium border-blue-500': (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" class="tab tab-underline py-4 px-6 block"
type="button" type="button"
>{{ $t('sponsoring') }}</button> >{{ $t('sponsoring') }}</button>
</div> </div>
</div> </div>
<div v-if="(activetab === 'profile')" class="tab-content block"> <div v-if="(state.activetab === 'profile')" class="tab-content block">
<div class="py-4 w-full"> <div class="py-4 w-full">
<div class="flex flex-col"> <div class="flex flex-col">
<form class="form flex flex-wrap w-full"> <form class="form flex flex-wrap w-full">
@ -116,7 +116,7 @@
</div> </div>
</div> </div>
</div> </div>
<div v-if="(activetab === 'laptimes')" class="tab-content block"> <div v-if="(state.activetab === 'laptimes')" class="tab-content block">
<div class="py-4 w-full"> <div class="py-4 w-full">
<section class="text-gray-400 dark:bg-gray-900 body-font"> <section class="text-gray-400 dark:bg-gray-900 body-font">
<div class="container mx-auto"> <div class="container mx-auto">
@ -159,7 +159,7 @@
</section> </section>
</div> </div>
</div> </div>
<div v-if="(activetab === 'sponsorings')" class="tab-content block"> <div v-if="(state.activetab === 'sponsorings')" class="tab-content block">
<div class="py-4 w-full">coming soon...</div> <div class="py-4 w-full">coming soon...</div>
</div> </div>
</div> </div>
@ -182,9 +182,10 @@ const state = reactive({
firstname: "", firstname: "",
middlename: "", middlename: "",
lastname: "", lastname: "",
scans: [] scans: [],
group: "",
activetab: "profile",
}) })
let activetab = ref("profile");
const toast = useToast(); const toast = useToast();
const token = location.hash.substr(1).split('&')[0].split('=')[1]; const token = location.hash.substr(1).split('&')[0].split('=')[1];
axios.get(`${config.baseurl}api/runners/me/${token}`) axios.get(`${config.baseurl}api/runners/me/${token}`)
@ -194,6 +195,7 @@ axios.get(`${config.baseurl}api/runners/me/${token}`)
state.firstname = data.firstname; state.firstname = data.firstname;
state.middlename = data.middlename; state.middlename = data.middlename;
state.lastname = data.lastname; state.lastname = data.lastname;
state.group = data.group;
}).catch((error) => { }).catch((error) => {
toast.error("An error occured while loading your profile data"); toast.error("An error occured while loading your profile data");
}) })

View File

@ -28,7 +28,7 @@ const Privacy = import('./components/Privacy.vue');
const Register = import('./components/Register.vue'); const Register = import('./components/Register.vue');
const Profile = () => import('./components/Profile.vue'); const Profile = () => import('./components/Profile.vue');
// //
let routes = [ { path: '/', component: EnvError } ]; let routes = [ { path: '/:pathMatch(.*)*', component: EnvError } ];
if (typeof config !== 'undefined') { if (typeof config !== 'undefined') {
if (config.baseurl && config.documentserver_key) { if (config.baseurl && config.documentserver_key) {
routes = [ routes = [