File tree Expand file tree Collapse file tree
frontend/components/Table Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -18,6 +18,10 @@ const sortedResults = computed(() =>
1818 .sort (byProperty (ascending .value , activeColumn .value )),
1919)
2020
21+ const isPointsOnly = computed (() =>
22+ props .results .every ((result ) => result .time === 0 ),
23+ )
24+
2125const changeSortPreference = (property : Column ) => {
2226 if (property !== activeColumn .value ) ascending .value = false
2327 else ascending .value = ! ascending .value
@@ -101,7 +105,8 @@ const ariaSorted = computed(
101105 class =" ring-main-200 rounded-sm px-1 font-medium focus:outline-hidden focus-visible:ring-3"
102106 @click =" changeSortPreference('time')"
103107 >
104- Time
108+ <template v-if =" isPointsOnly " > Points </template >
109+ <template v-else > Time </template >
105110 <TableArrows
106111 :active =" activeColumn == ' time' "
107112 :ascending =" ascending "
@@ -115,6 +120,7 @@ const ariaSorted = computed(
115120 v-for =" result of sortedResults "
116121 :key =" result .id "
117122 :result =" result "
123+ :points-not-time =" isPointsOnly "
118124 />
119125 </tbody >
120126 </table >
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import { elapsedTime } from '~/utils/time'
55
66defineProps ({
77 result: { type: Object as PropType <EventResult >, required: true },
8+ pointsNotTime: { type: Boolean , default: false },
89})
910 </script >
1011<template >
@@ -42,6 +43,13 @@ defineProps({
4243 >
4344 {{ result.club || ' ' }}
4445 </td >
45- <td class =" text-center" >{{ elapsedTime(result.time) }}</td >
46+ <td class =" text-center" >
47+ <template v-if =" pointsNotTime " >
48+ {{ result.file_points }}
49+ </template >
50+ <template v-else >
51+ {{ elapsedTime(result.time) }}
52+ </template >
53+ </td >
4654 </tr >
4755</template >
You can’t perform that action at this time.
0 commit comments