23 lines
610 B
HTML
23 lines
610 B
HTML
{{ define "main" }}
|
|
<h1>Now</h1>
|
|
{{ $data := dict }}
|
|
{{ $url := "http://localhost:8000/v1/now" }}
|
|
{{ with resources.GetRemote $url }}
|
|
{{ with .Err }}
|
|
{{ errorf "%s" . }}
|
|
{{ else }}
|
|
{{ $data = .Content | transform.Unmarshal }}
|
|
{{ $data.SummonerName }} -- {{ $data.SummonerLvl }}
|
|
{{ range $data.RankedMatchs }}
|
|
<p>
|
|
{{ .Champion }} - {{ if .Win }} Victory {{ else }} Defeat {{ end }} - {{ .Kills }}/{{ .Deaths }}/{{ .Assists }}
|
|
</p>
|
|
{{ end }}
|
|
{{ end }}
|
|
{{ else }}
|
|
{{ errorf "Unable to get remote resource %q" $url }}
|
|
{{ end }}
|
|
|
|
{{ .Content }}
|
|
{{ end }}
|