aboutsummaryrefslogtreecommitdiff
path: root/layouts/issues
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
parent8a1aaf4737e90406119bdf5770937eea924729aa (diff)
cState is now stable on v3.0 - 2019-01-24 (info: #41)
Diffstat (limited to 'layouts/issues')
-rw-r--r--layouts/issues/issue.html96
-rw-r--r--layouts/issues/single.html6
-rw-r--r--layouts/issues/small.html76
3 files changed, 145 insertions, 33 deletions
diff --git a/layouts/issues/issue.html b/layouts/issues/issue.html
index 014a33a..c344f57 100644
--- a/layouts/issues/issue.html
+++ b/layouts/issues/issue.html
@@ -6,43 +6,81 @@
{{ $isDown := where $active "Params.severity" "=" "down" }}
<div class="article">
+ <h1 class="clean">
+ {{ .Title }}
+ </h1>
+
+ <small class="date">
+ {{ if .Site.Params.dateFormat }}
+ {{ .Date.Format .Site.Params.dateFormat }}
+ {{ else }}
+ {{ .Date.Format "January 2, 2006 at 3:04 PM" }}
+ {{ end }}
+ </small>
+
+ <p><small>
+ {{ range .Params.Affected }}
+ <a href="/affected/{{ . | urlize }}" class="tag no-underline">{{ . }}</a>
+ {{ end }}
+ </small></p>
+
{{ 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
+ {{ $t := (time .Params.ResolvedWhen) }}
+ {{ $timeDiff := (sub $t.Unix .Date.Unix) }}
+ {{ $diffInMin := (div $timeDiff 60) }}
+
+
+ <!-- Marker -->
+ {{ if lt $timeDiff 60 }}
+ <div class="faded">
+ <strong>
+ {{ T "resolved" }} {{ T "inUnderAMinute" }}.
+ </strong>
+ </div>
+ {{ else }}
+ {{ if gt $timeDiff 3600 }}
+ <div class="warning tooltip">
+ <strong>
+ {{ T "resolvedAfter" }}
+
+ {{ $minutesForCalc := (mod $diffInMin 60) }}
+
+ {{ div (sub $diffInMin $minutesForCalc) 60 }}h
+ {{ $minutesForCalc }}m {{ T "ofDowntime" }}.
+ </strong>
+
+ <span class="tooltip__text">
+ {{ if .Site.Params.dateFormat }}
+ {{ dateFormat .Site.Params.dateFormat .Params.resolvedWhen }}
+ {{ else }}
+ {{ dateFormat "January 2, 2006 at 3:04 PM" .Params.resolvedWhen }}
+ {{ end }}
+ </span>
+ </div>
{{ else }}
+ <div class="ok tooltip">
+ <strong>
+ {{ T "resolvedAfter" }}
- ✓ Resolved after
- {{ if gt $timeDiff 3600 }}
- {{ $minutesForCalc := (mod $diffInMin 60) }}
+ {{ $secsForCalc := (mod $timeDiff 60) }}
- {{ div (sub $diffInMin $minutesForCalc) 60 }}h
- {{ $minutesForCalc }}m of downtime
- {{ else }}
- {{ $secsForCalc := (mod $timeDiff 60) }}
+ {{ div (sub $timeDiff $secsForCalc) 60 }}m
+ {{ T "ofDowntime" }}.
+ </strong>
- {{ div (sub $timeDiff $secsForCalc) 60 }}m
- <!-- {{ $secsForCalc }}s --> of downtime
- {{ end }}
-
+ <span class="tooltip__text">
+ {{ if .Site.Params.dateFormat }}
+ {{ dateFormat .Site.Params.dateFormat .Params.resolvedWhen }}
+ {{ else }}
+ {{ dateFormat "January 2, 2006 at 3:04 PM" .Params.resolvedWhen }}
+ {{ end }}
+ </span>
+ </div>
{{ end }}
- </span>
+ {{ end }}
{{ else }}
- <em>Ongoing, services {{ if eq .Params.severity "notice" }}on notice{{ else }}{{ .Params.severity }}{{ end }}</em>
+ <strong class="error">{{ T "downtimeOngoing" }}</strong>
{{ end }}
- <h3>
- <a href="{{ .Permalink }}">{{ .Title }}</a>
- </h3>
-
- <small class="date">
- {{ .Date.Format "January 02, 2006 at 3:04 PM" }}
- </small>
<hr>
{{ .Content }}
diff --git a/layouts/issues/single.html b/layouts/issues/single.html
index 5076148..5761477 100644
--- a/layouts/issues/single.html
+++ b/layouts/issues/single.html
@@ -7,11 +7,9 @@
{{ $isDisrupted := where $active "Params.severity" "=" "disrupted" }}
{{ $isDown := where $active "Params.severity" "=" "down" }}
- <body class="status-{{ if $isDown }}down{{ else }}{{ if $isDisrupted}}disrupted{{ else }}{{ if $isNotice }}notice{{ else }}ok{{ end }}{{ end }}{{ end }}">
- {{ partial "header" . }}
-
+ <body class="issues single">
<div class="contain">
- <a href="{{ .Site.BaseURL }}">← Go back</a>
+ <a href="{{ .Site.BaseURL }}">← {{ T "goBack" }} <em>{{ .Site.Title }}</em></a>
</div>
<div class="contain">
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>