fix swiss stats

pull/6626/head
Thibault Duplessis 2020-05-12 22:31:39 -06:00
parent 35a9371b92
commit 6f646024fa
1 changed files with 6 additions and 6 deletions

View File

@ -137,17 +137,17 @@ function confetti(data: SwissData): VNode | undefined {
}
function stats(ctrl: SwissCtrl): VNode | undefined {
const s = ctrl.data.stats, noarg = ctrl.trans.noarg;
const s = ctrl.data.stats, noarg = ctrl.trans.noarg, slots = ctrl.data.round * ctrl.data.nbPlayers;
return s ? h('div.swiss__stats', [
h('h2', noarg('tournamentComplete')),
h('table', [
numberRow(noarg('averageElo'), s.averageRating, 'raw'),
numberRow(noarg('gamesPlayed'), s.games),
numberRow(noarg('whiteWins'), [s.whiteWins, s.games], 'percent'),
numberRow(noarg('blackWins'), [s.blackWins, s.games], 'percent'),
numberRow(noarg('draws'), [s.draws, s.games], 'percent'),
numberRow(noarg('byes'), [s.byes, s.games], 'percent'),
numberRow(noarg('absences'), [s.absences, s.games], 'percent'),
numberRow(noarg('whiteWins'), [s.whiteWins, slots], 'percent'),
numberRow(noarg('blackWins'), [s.blackWins, slots], 'percent'),
numberRow(noarg('draws'), [s.draws, slots], 'percent'),
numberRow(noarg('byes'), [s.byes, slots], 'percent'),
numberRow(noarg('absences'), [s.absences, slots], 'percent'),
])
]) : undefined;
}