yequari.com/layouts/page/now.html

23 lines
610 B
HTML
Raw Normal View History

2024-04-20 00:28:27 +00:00
{{ 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 }}