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 53 additions and 51 deletions
Showing only changes of commit 14369480ea - Show all commits

View File

@ -121,7 +121,10 @@
<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">
<div class="lg:w-2/3 w-full mx-auto overflow-auto"> <div class="lg:w-2/3 w-full mx-auto overflow-auto">
<table class="table-auto w-full text-left whitespace-no-wrap"> <table
v-if="state.scans.length > 0"
class="table-auto w-full text-left whitespace-no-wrap"
>
<thead <thead
class="text-black bg-gray-300 dark:text-white text-sm dark:bg-gray-800" class="text-black bg-gray-300 dark:text-white text-sm dark:bg-gray-800"
> >
@ -135,24 +138,15 @@
</tr> </tr>
</thead> </thead>
<tbody class="text-gray-900 dark:text-gray-50"> <tbody class="text-gray-900 dark:text-gray-50">
<tr class="border-t-2 border-gray-800"> <tr v-for="s in state.scans" :key="s.id">
<td class="px-4 py-3">400m</td> <td class="px-4 py-3">s.distance</td>
<td class="px-4 py-3">0min 57s</td> <td class="px-4 py-3">s.time</td>
</tr>
<tr class="border-t-2 border-gray-800">
<td class="px-4 py-3">400m</td>
<td class="px-4 py-3">1min 15s</td>
</tr>
<tr class="border-t-2 border-gray-800">
<td class="px-4 py-3">1km</td>
<td class="px-4 py-3">2min 50s</td>
</tr>
<tr class="border-t-2 border-gray-800">
<td class="px-4 py-3">1km</td>
<td class="px-4 py-3">3min 00s</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
<div v-else class="text-center font-bold text-black dark:text-white text-2xl">
{{ $t('no_laps_scans_were_recorded_yet') }}
</div>
</div> </div>
</div> </div>
</section> </section>
@ -181,6 +175,7 @@ const state = reactive({
firstname: "", firstname: "",
middlename: "", middlename: "",
lastname: "", lastname: "",
scans: []
}) })
let activetab = ref("profile"); let activetab = ref("profile");
const toast = useToast(); const toast = useToast();
@ -195,4 +190,10 @@ axios.get(`${config.baseurl}api/runners/me/${token}`)
}).catch((error) => { }).catch((error) => {
toast.error("An error occured while loading your profile data"); toast.error("An error occured while loading your profile data");
}) })
axios.get(`${config.baseurl}api/runners/me/${token}/scans`)
.then(({ data }) => {
state.scans = data;
}).catch((error) => {
toast.error("An error occured while loading your profile data");
})
</script> </script>

View File

@ -32,5 +32,6 @@
"the_system_is_not_properly_configured_please_contact_the_system_administrator_for_help": "The system is not properly configured. Please contact the system administrator for help.", "the_system_is_not_properly_configured_please_contact_the_system_administrator_for_help": "The system is not properly configured. Please contact the system administrator for help.",
"this_is_not_a_valid_international_phone_number": "This is not a valid international phone number", "this_is_not_a_valid_international_phone_number": "This is not a valid international phone number",
"view_my_data": "View my data", "view_my_data": "View my data",
"vorname": "Firstname" "vorname": "Firstname",
"no_laps_scans_were_recorded_yet": "No laps/ scans were recorded yet..."
} }