From dccc5e9864bb8e5923d633848860d39e4d92e46c Mon Sep 17 00:00:00 2001 From: Mantas <11616378+mistermantas@users.noreply.github.com> Date: Thu, 5 Jul 2018 14:45:24 +0300 Subject: v2 Dev Preview 1 --- layouts/index.html | 98 ++++++++++++++++++++++++--------------- layouts/issues/issue.html | 34 ++++++++++---- layouts/partials/footer.html | 4 +- layouts/partials/header-mini.html | 7 --- layouts/partials/header.html | 25 ++++++++++ layouts/partials/js.html | 3 ++ layouts/partials/meta.html | 93 ++++++++++++++++++++++++++----------- layouts/shortcodes/track.html | 2 +- layouts/uptime/single.html | 65 ++++++++++++++++++++++++++ 9 files changed, 248 insertions(+), 83 deletions(-) delete mode 100644 layouts/partials/header-mini.html create mode 100644 layouts/partials/header.html create mode 100644 layouts/uptime/single.html (limited to 'layouts') diff --git a/layouts/index.html b/layouts/index.html index a09d429..eedb08d 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -1,4 +1,5 @@ {{ partial "meta" . }} + {{ $incidents := where .Site.RegularPages "Params.section" "issue" }} {{ $active := where $incidents "Params.resolved" "=" false }} @@ -6,18 +7,8 @@ {{ $isDisrupted := where $active "Params.severity" "=" "disrupted" }} {{ $isDown := where $active "Params.severity" "=" "down" }} - -
-
- -
-
+ + {{ partial "header" . }}
@@ -32,7 +23,7 @@ {{ if $isDown }} Experiencing major issues {{ else }} - {{ if $isDisrupted}} + {{ if $isDisrupted }} Experiencing disruptions {{ else }} {{ if $isNotice }} @@ -42,47 +33,80 @@ {{ end }}{{ end }}{{ end }} - + +
+ + {{ if $active }} +
+ {{ range $active }} +
+

{{ .Title }}

+ {{ .Content }} +
+ {{ else }}{{ end }}
+ {{ end }} - {{ range $active }} -
- {{ .Date.Format "January 02, 2006 at 3:04 PM" }}
- {{ .Title }} - {{ .Content }} -
- {{ else }}{{ end }} - {{ if not $active }}
{{ $systems := .Site.Params.systems }} {{ range $index, $systems }} -
+ {{ $activeComponentIssues := where $active "Params.affected" "intersect" (slice .) }} + + {{ $thisIsNotice := where $activeComponentIssues "Params.severity" "=" "notice" }} + {{ $thisIsDisrupted := where $activeComponentIssues "Params.severity" "=" "disrupted" }} + {{ $thisIsDown := where $activeComponentIssues "Params.severity" "=" "down" }} + +
+ {{ $this := . }} {{ . }} - Operational + + {{ if $thisIsDown }} + Down + {{ else }} + {{ if $thisIsDisrupted }} + Disrupted + {{ else }} + {{ if $thisIsNotice }} + Maintenance + {{ else }} + Operational + {{ end }}{{ end }}{{ end }} +
{{ end }}
- {{ end }} -

+ -
-

Incident history

- {{ if not .Data.Pages }} -

Looks like we do not have any incidents logged.

- {{ else }} - {{ range first 10 .Data.Pages }} - {{ .Render "issue" }} - {{ end }} - {{ end }} +
+ +
+ + +
+
+ {{ if not .Data.Pages }} +

Looks like we do not have any incidents logged.

+ {{ else }} + {{ range .Data.Pages }} + {{ .Render "issue" }} + {{ end }} + {{ end }} +
- {{ partial "js" . }} - {{ partial "footer" . }} + {{ partial "js" . }} + {{ partial "footer" . }} 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" }}
- - {{ .Params.severity }} - -   - - {{ .Date.Format "January 02, 2006 at 3:04 PM" }} - -   {{ if .Params.Resolved }} - - {{ end }} + ✓ 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 + of downtime + {{ end }} + + {{ else }} + Ongoing, services {{ .Params.severity }} + {{ end }}

{{ .Title }}

+ + {{ .Date.Format "January 02, 2006 at 3:04 PM" }} + +
{{ .Content }}
+
diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index e1314ce..085b814 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -1,6 +1,8 @@