diff options
author | Mantas <11616378+mistermantas@users.noreply.github.com> | 2018-07-05 14:45:24 +0300 |
---|---|---|
committer | Mantas <11616378+mistermantas@users.noreply.github.com> | 2018-07-05 14:45:24 +0300 |
commit | dccc5e9864bb8e5923d633848860d39e4d92e46c (patch) | |
tree | b083eb048be02d10d0497d1f4b750f504f990366 /layouts/issues/issue.html | |
parent | 2c05edfd800690b04d8b1d5529a17276cf6eccd3 (diff) |
v2 Dev Preview 1
Diffstat (limited to 'layouts/issues/issue.html')
-rw-r--r-- | layouts/issues/issue.html | 34 |
1 files changed, 24 insertions, 10 deletions
diff --git a/layouts/issues/issue.html b/layouts/issues/issue.html index 9b63b78..c4d5ab6 100644 --- a/layouts/issues/issue.html +++ b/layouts/issues/issue.html @@ -6,24 +6,38 @@ {{ $isDown := where $active "Params.severity" "=" "down" }} <div class="article"> - <span class="marker"> - {{ .Params.severity }} - </span> - - <small class="date"> - {{ .Date.Format "January 02, 2006 at 3:04 PM" }} - </small> - {{ if .Params.Resolved }} - <span class="ok">✓</span> - {{ end }} + <span class="ok">✓ Resolved after + + {{ $t := (time .Params.ResolvedWhen) }} + {{ $timeDiff := (sub $t.Unix .Date.Unix) }} + {{ $diffInMin := (div $timeDiff 60) }} + + {{ if gt $timeDiff 3600 }} + {{ $minutesForCalc := (mod $diffInMin 60) }} + {{ div (sub $diffInMin $minutesForCalc) 60 }}h + {{ $minutesForCalc }}m of downtime + {{ else }} + {{ $secsForCalc := (mod $timeDiff 60) }} + {{ div (sub $timeDiff $secsForCalc) 60 }}m + <!-- {{ $secsForCalc }}s --> of downtime + {{ end }} + </span> + {{ else }} + <span class="error">Ongoing, services {{ .Params.severity }}</span> + {{ end }} <h3> <a href="{{ .Permalink }}">{{ .Title }}</a> </h3> + <small class="date"> + {{ .Date.Format "January 02, 2006 at 3:04 PM" }} + </small> + <hr> {{ .Content }} </div> +<div class="padding"></div> |