diff --git a/templates/error.txt b/templates/error.txt index db5c63c..a7817c3 100644 --- a/templates/error.txt +++ b/templates/error.txt @@ -1,2 +1,2 @@ {{.Status}} {{.Status | statusText | thisIsSafe}} -{{.Error | thisIsSafe}} +{{.Error.Error | thisIsSafe}} diff --git a/templates/index.txt b/templates/index.txt index 1333ed7..afbd989 100644 --- a/templates/index.txt +++ b/templates/index.txt @@ -1 +1,19 @@ -TODO +{{- $app := .App -}} +{{- $t := .Req.Time -}} +{{- range .Req.Zones -}} +{{- $zoneName := . -}} +{{with resolveZone $app .}} + {{- if .Error}} +Unable to load zone "{{$zoneName | thisIsSafe}}". The zone could be invalid +{{/* */}} + {{- else -}} + {{- $zt := $t.In .Location}} +{{.Name | thisIsSafe}} + {{- if not .IsOffset }} {{.TimeOffset $t | formatOffset | thisIsSafe}} + {{- end}} +{{$zt.Format "2006-01-02"}} +{{$zt.Format "15:04"}} +{{/* */}} + {{- end -}} + {{- end -}} +{{- end -}}