blob: 014a33acb072b7729222999db4243ba390c1aba6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
{{ $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" }}
<div class="article">
{{ if .Params.Resolved }}
<span class="ok">
{{ $t := (time .Params.ResolvedWhen) }}
{{ $timeDiff := (sub $t.Unix .Date.Unix) }}
{{ $diffInMin := (div $timeDiff 60) }}
<!-- Marker -->
{{ if lt $timeDiff 60 }}
✓ Resolved
{{ else }}
✓ Resolved after
{{ 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 }}
{{ end }}
</span>
{{ else }}
<em>Ongoing, services {{ if eq .Params.severity "notice" }}on notice{{ else }}{{ .Params.severity }}{{ end }}</em>
{{ 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>
|