{{define "title"}}{{.App.Manifest.Title}} - Tableau des scores - Arcad{{end}} {{define "body"}} {{template "header" .}}

{{.App.Manifest.Title}}

Tableau des scores

{{template "podium" .}}
{{template "highscores" .}}
{{end}} {{template "base" .}} {{define "podium"}}
{{ if gt (len .Highscores) 1 }} {{ $secondPlayerHighscore := index .Highscores 1 }} {{if $secondPlayerHighscore}}
{{ $secondPlayer := (index .Users $secondPlayerHighscore.UserID) }} {{with $secondPlayer}}{{ .Nickname }}{{else}}???{{end}} {{ $secondPlayerHighscore.Score }}
{{end}} {{end}}
2
{{ if gt (len .Highscores) 0 }} {{ $firstPlayerHighscore := index .Highscores 0 }} {{if $firstPlayerHighscore}}
{{ $firstPlayer := (index .Users $firstPlayerHighscore.UserID) }} {{with $firstPlayer}}{{ .Nickname }}{{else}}???{{end}} {{ $firstPlayerHighscore.Score }}
{{end}} {{end}}
1
{{ if gt (len .Highscores) 2 }} {{ $thirdPlayerHighscore := index .Highscores 2 }} {{if $thirdPlayerHighscore}}
{{ $thirdPlayer := (index .Users $thirdPlayerHighscore.UserID) }} {{with $thirdPlayer}}{{ .Nickname }}{{else}}???{{end}} {{ $thirdPlayerHighscore.Score }}
{{end}} {{end}}
3
{{end}} {{define "highscores"}} {{ $users := .Users }}
{{range $i, $h := .Highscores}} {{ $user := (index $users $h.UserID) }} {{ $position := addInt $i 1 }} {{else}} {{end}}
Position Pseudonyme Score Date
{{ $position }} {{with $user}}{{ .Nickname }}{{else}}???{{end}} {{ $h.Score }} {{ localeTimeFormat $h.CreationTime "02/01/2006 15:04" "fr_FR" }}
Aucun score pour l'instant.
{{end}}