-
Notifications
You must be signed in to change notification settings - Fork 0
/
RankingTable.vue
53 lines (45 loc) · 1.25 KB
/
RankingTable.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<i18n>
{
"de": {
"label-username": "Benutzername",
"label-score": "Antworten",
"anonymous-username": "Anonymer Benutzer"
},
"en": {
"label-username": "Username",
"label-score": "Submissions",
"anonymous-username": "Anonymous User"
}
}
</i18n>
<template>
<table class="ranking">
<tr>
<th></th>
<th>{{ $t('label-username') }}</th>
<th>{{ $t('label-score') }}</th>
</tr>
<tr v-for="rankingEntry in ranking" v-if="limit === undefined || rankingEntry.rank <= limit" :key="rankingEntry.username">
<td>
<template v-if="!rankingEntry.sameAsPrevious">{{rankingEntry.rank}}.</template>
</td>
<td><b>
<template v-if="!rankingEntry.username.search('_anon')">{{ $t('anonymous-username') }}</template>
<template v-else>{{rankingEntry.username}}</template>
</b></td>
<td>{{rankingEntry.subs}}</td>
</tr>
</table>
</template>
<script>
export default {
name: "RankingTable",
props: {
ranking: Array,
limit: {
type: Number,
default: undefined
}
}
}
</script>