{{define "matches"}}{{template "top" .}} {{- with .Data}}

A name finds the matches played under it then or by whoever has it now: a player reporting a cheater by the name the game showed finds the match, and the cheater's Steam ID.

{{if or .Query .Kind}}Matches found{{else}}Newest matches{{end}}

newest first
{{- if .Matches}} {{template "matchtable" (matchTable $ .Matches "")}} {{template "pager" (pagerMore "/matches" .Page .More "q" .Query "kind" .Kind)}} {{- else}}

{{if or .Query .Kind}}No match found.{{else}}No match recorded yet.{{end}}{{if gt .Page 1}} Back to the newest{{end}}

{{- end}}
{{- end}} {{template "bottom" .}}{{end}} {{/* A table of matches (the Matches page, a player's page: Self is that player). */}} {{define "matchtable"}}
{{- range .Rows}} {{- end}}
StartedPlayersKindLengthResult
{{template "ago" (at $.Now .Started)}} {{- range $i, $p := .Players}}{{if $i}}vs{{end}} {{- if eq (print $p.SteamID) $.Self}}{{$p.Name}}{{else}}{{$p.Name}}{{end}} {{- if gt $p.LocalPlayers 1}} x{{$p.LocalPlayers}}{{end}} {{- if eq $p.Won 1}} won{{else if eq $p.Won 0}} lost{{end}} {{- end}} {{if eq .Kind "ranked"}}Ranked{{else}}Player match{{end}} {{if .Open}}in play{{else}}{{.Took}}{{end}} {{.ResultText}}
{{end}}