Merge branch 'dev' into feature/11-user-scans

# Conflicts:
#	src/components/Profile.vue
This commit is contained in:
Philipp Dormann 2021-03-09 17:45:19 +01:00
commit 45c0bdd5cf
2 changed files with 15 additions and 13 deletions

View File

@ -9,7 +9,7 @@
class="text-3xl font-bold whitespace-nowrap"
v-text="(state.firstname || '') + ' ' + (state.middlename || '') + ' ' + (state.lastname || '')"
></p>
<p class="text-md whitespace-nowrap">Musterfirma > PR</p>
<p class="text-md whitespace-nowrap">{{ state.group }}</p>
</div>
<div class="inline-flex md:ml-auto md:mr-0 mx-auto items-center space-x-4">
<button
@ -48,30 +48,30 @@
<div class="flex lg:flex-wrap flex-row lg:space-x-2">
<div class="flex-none">
<button
@click="() => { activetab = 'profile' }"
:class="{ 'tab-active border-b-2 font-medium border-blue-500': (activetab === 'profile') }"
@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"
>{{ $t('profile') }}</button>
</div>
<div class="flex-none">
<button
@click="() => { activetab = 'laptimes' }"
:class="{ 'tab-active border-b-2 font-medium border-blue-500': (activetab === 'laptimes') }"
@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"
>{{ $t('lap_times') }}</button>
</div>
<div class="flex-none">
<button
@click="() => { activetab = 'sponsorings' }"
:class="{ 'tab-active border-b-2 font-medium border-blue-500': (activetab === 'sponsorings') }"
@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"
>{{ $t('sponsoring') }}</button>
</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="flex flex-col">
<form class="form flex flex-wrap w-full">
@ -116,7 +116,7 @@
</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">
<section class="text-gray-400 dark:bg-gray-900 body-font">
<div class="container mx-auto">
@ -159,7 +159,7 @@
</section>
</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>
</div>
@ -182,9 +182,10 @@ const state = reactive({
firstname: "",
middlename: "",
lastname: "",
scans: []
scans: [],
group: "",
activetab: "profile",
})
let activetab = ref("profile");
const toast = useToast();
const token = location.hash.substr(1).split('&')[0].split('=')[1];
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.middlename = data.middlename;
state.lastname = data.lastname;
state.group = data.group;
}).catch((error) => {
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 Profile = () => import('./components/Profile.vue');
//
let routes = [ { path: '/', component: EnvError } ];
let routes = [ { path: '/:pathMatch(.*)*', component: EnvError } ];
if (typeof config !== 'undefined') {
if (config.baseurl && config.documentserver_key) {
routes = [