-
Notifications
You must be signed in to change notification settings - Fork 0
/
SectionStats.vue
131 lines (101 loc) · 4.36 KB
/
SectionStats.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
<i18n>
{
"de": {
"label-number-of-submissions": "Gesamte Anzahl<br>Antworten",
"label-number-of-users": "Anzahl<br>Benutzer",
"label-number-of-tasks": "Anzahl<br>Aufgaben",
"label-number-of-my-submissions": "Anzahl Ihrer<br>Antworten",
"label-my-progress": "Ihr<br>Fortschritt",
"label-my-rank": "Ihr<br>Rang"
},
"en": {
"label-number-of-submissions": "Total Number of<br>Submissions",
"label-number-of-users": "Number<br>of Users",
"label-number-of-tasks": "Number<br>of Tasks",
"label-number-of-my-submissions": "Number of my<br>Submissions",
"label-my-progress": "My<br>Progress",
"label-my-rank": "My<br>Rank"
}
}
</i18n>
<template>
<app-content-section :color=" color ? color : false" class="content-section-condensed stats-section">
<div class="content-wrapper">
<div class="row row-centered row-wrapping">
<div v-show="submissionCount !== undefined" class="col col-wrapping col-large-3 col-xlarge-2 scroll-effect centered">
<label v-html="$t('label-number-of-submissions')"></label>
<span class="value">{{submissionCount}}</span>
</div>
<div v-show="userCount !== undefined" class="col col-wrapping col-large-3 col-xlarge-2 scroll-effect scroll-effect-delayed-1 centered">
<label v-html="$t('label-number-of-users')"></label>
<span class="value">{{userCount}}</span>
</div>
<div v-show="taskCount !== undefined" class="col col-wrapping col-large-3 col-xlarge-2 scroll-effect scroll-effect-delayed-2 centered">
<label v-html="$t('label-number-of-tasks')"></label>
<span class="value">{{taskCount}}</span>
</div>
<div v-show="mySubmissionCount !== undefined" class="col col-wrapping col-large-3 col-xlarge-2 scroll-effect centered">
<label v-html="$t('label-number-of-my-submissions')"></label>
<span class="value">{{mySubmissionCount}}</span>
</div>
<div v-show="myProgress !== undefined" class="col col-wrapping col-large-3 col-xlarge-2 scroll-effect scroll-effect-delayed-1 centered">
<label v-html="$t('label-my-progress')"></label>
<span class="value">{{myProgress}}%</span>
</div>
<div v-show="myRank !== undefined" class="col col-wrapping col-large-3 col-xlarge-2 scroll-effect scroll-effect-delayed-2 centered">
<label v-html="$t('label-my-rank')"></label>
<span class="value">{{myRank}}.</span>
</div>
<div v-show="ranking !== undefined" class="col col-wrapping col-large-6 scroll-effect">
<h3 class="subheading centered">Top Contributors</h3>
<ranking-table :ranking="ranking" :limit="3"></ranking-table>
<div class="button-group centered">
<router-link tag="button" to="/ranking/current" class="button button-secondary">Show Full Ranking</router-link>
</div>
</div>
</div>
</div>
</app-content-section>
</template>
<script>
import ContentSection from '@/components/shared/ContentSection.vue';
import Ranking from "../Ranking";
import RankingTable from "./RankingTable";
export default {
name: "SectionStats",
components: {
RankingTable,
Ranking,
'app-content-section': ContentSection
},
props: {
color: {
type: String,
default: 'white'
},
submissionCount: Number,
userCount: Number,
taskCount: Number,
mySubmissionCount: Number,
myProgress: Number,
myRank: Number,
ranking: Array
}
}
</script>
<style lang="scss">
@import '@/styles/theme.scss';
@import '@/styles/shared/variables.scss';
.stats-section {
label {
margin-right: $spacing-2;
display: inline-block;
text-align: right;
line-height: 1.1;
}
.value {
font-size: $font-size-xlarge;
font-weight: 700;
}
}
</style>