aboutsummaryrefslogtreecommitdiff
path: root/layouts/issues/small.html
diff options
context:
space:
mode:
authorMantas <11616378+mistermantas@users.noreply.github.com>2019-01-24 19:23:35 +0200
committerGitHub <noreply@github.com>2019-01-24 19:23:35 +0200
commit4a968698e45ece04b25f41783298b9b397a191a1 (patch)
tree57ae06a3d7344f234ba71a12b7962144b8eb5472 /layouts/issues/small.html
parent8a1aaf4737e90406119bdf5770937eea924729aa (diff)
cState is now stable on v3.0 - 2019-01-24 (info: #41)
Diffstat (limited to 'layouts/issues/small.html')
-rw-r--r--layouts/issues/small.html76
1 files changed, 76 insertions, 0 deletions
diff --git a/layouts/issues/small.html b/layouts/issues/small.html
new file mode 100644
index 0000000..6833b68
--- /dev/null
+++ b/layouts/issues/small.html
@@ -0,0 +1,76 @@
+{{ $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" }}
+
+<a href="{{ .Permalink }}" class="issue no-underline">
+ {{ if .Params.Resolved }}
+ <small class="date float-right">
+ {{ if .Site.Params.dateFormat }}
+ {{ .Date.Format .Site.Params.dateFormat }}
+ {{ else }}
+ {{ .Date.Format "January 2, 2006 at 3:04 PM" }}
+ {{ end }}
+ </small>
+
+ <h3>
+ {{ .Title }}
+ </h3>
+
+ {{ $t := (time .Params.ResolvedWhen) }}
+ {{ $timeDiff := (sub $t.Unix .Date.Unix) }}
+ {{ $diffInMin := (div $timeDiff 60) }}
+
+ <!-- Marker -->
+ {{ if lt $timeDiff 60 }}
+ <div class="faded">
+ {{ T "resolved" }} {{ T "inUnderAMinute" }}
+ </div>
+ {{ else }}
+ {{ if gt $timeDiff 3600 }}
+ <div class="warning">
+ {{ T "resolvedAfter" }}
+
+ {{ $minutesForCalc := (mod $diffInMin 60) }}
+
+ {{ div (sub $diffInMin $minutesForCalc) 60 }}h
+ {{ $minutesForCalc }}m {{ T "ofDowntime" }}
+ </div>
+ {{ else }}
+ <div class="ok">
+ {{ T "resolvedAfter" }}
+
+ {{ $secsForCalc := (mod $timeDiff 60) }}
+
+ {{ div (sub $timeDiff $secsForCalc) 60 }}m
+ <!-- {{ $secsForCalc }}s --> {{ T "ofDowntime" }}
+ </div>
+ {{ end }}
+ {{ end }}
+
+
+ {{ else }}
+
+ <small class="date float-right">
+ {{ if .Site.Params.dateFormat }}
+ {{ .Date.Format .Site.Params.dateFormat }}
+ {{ else }}
+ {{ .Date.Format "January 2, 2006 at 3:04 PM" }}
+ {{ end }}
+ </small>
+
+ <h3>
+ {{ .Title }}
+ </h3>
+
+ {{ $t := (time .Params.ResolvedWhen) }}
+ {{ $timeDiff := (sub $t.Unix .Date.Unix) }}
+ {{ $diffInMin := (div $timeDiff 60) }}
+
+ <!-- Marker -->
+ <div class="error">{{ T "downtimeOngoing" }}</div>
+
+ {{ end }}
+</a>