{{ $incidents := where .Site.RegularPages "Params.section" "issue" }} {{ $active := where $incidents "Params.resolved" "=" false }} {{ $isNotice := where $active "Params.severity" "=" "notice" }} {{ $isDisrupted := where $active "Params.severity" "=" "disrupted" }} {{ $isDown := where $active "Params.severity" "=" "down" }} {{ if .Params.informational }} {{ if .Site.Params.dateFormat }} {{ dateFormat .Site.Params.dateFormat .Params.date }} {{ else }} {{ .Date.Format "January 2, 2006 at 3:04 PM" }} {{ end }}

{{ .Title }}  ℹ

{{ .Summary | truncate 200 }} {{ else if .Params.Resolved }} {{ if .Site.Params.dateFormat }} {{ dateFormat .Site.Params.dateFormat .Params.date }} {{ else }} {{ .Date.Format "January 2, 2006 at 3:04 PM" }} {{ end }}

{{ .Title }}

{{ $t := (time .Params.ResolvedWhen) }} {{ $timeDiff := (sub $t.Unix .Date.Unix) }} {{ $diffInMin := (div $timeDiff 60) }} {{ if lt $timeDiff 60 }}
{{ T "resolved" }} {{ T "inUnderAMinute" }}
{{ else }} {{ if gt $timeDiff 3600 }}
{{ T "resolvedAfter" }} {{ $minutesForCalc := (mod $diffInMin 60) }} {{ div (sub $diffInMin $minutesForCalc) 60 }}h {{ $minutesForCalc }}m {{ T "ofDowntime" }}
{{ else }}
{{ T "resolvedAfter" }} {{ $secsForCalc := (mod $timeDiff 60) }} {{ div (sub $timeDiff $secsForCalc) 60 }}m {{ T "ofDowntime" }}
{{ end }} {{ end }} {{ else }} {{ if .Date.Before now }} {{ if .Site.Params.dateFormat }} {{ .Date.Format .Site.Params.dateFormat }} {{ else }} {{ .Date.Format "January 2, 2006 at 3:04 PM" }} {{ end }} {{ else }} {{ end }}

{{ .Title }}

{{ if eq .Params.severity "notice" }} ◆ {{ if .Date.Before now }} {{ T "downtimeOngoing" }} {{ else }} {{ if .Site.Params.dateFormat }} {{ .Date.Format .Site.Params.dateFormat }} {{ else }} {{ .Date.Format "January 2, 2006 at 3:04 PM" }} {{ end }} {{ end }} {{ else }} {{ if eq .Params.severity "down" }} ■ {{ else if eq .Params.severity "disrupted" }} ▲ {{ else }} ◆ {{ end }} {{ T "downtimeOngoing" }} {{ end }} {{ end }}