From 81b078a04d0555de9658898d4da73e0ac83bd31c Mon Sep 17 00:00:00 2001 From: Mantas <11616378+mistermantas@users.noreply.github.com> Date: Tue, 7 May 2019 22:29:51 +0300 Subject: First working example of categories --- layouts/partials/index/components.html | 115 +++++++++++++++++++++------------ 1 file changed, 74 insertions(+), 41 deletions(-) (limited to 'layouts/partials/index') diff --git a/layouts/partials/index/components.html b/layouts/partials/index/components.html index 128b887..392acb7 100644 --- a/layouts/partials/index/components.html +++ b/layouts/partials/index/components.html @@ -5,49 +5,82 @@ {{ $isDisrupted := where $active "Params.severity" "=" "disrupted" }} {{ $isDown := where $active "Params.severity" "=" "down" }} -
- {{ $systems := .Site.Params.systems }} - {{ range $systems }} - {{ $activeComponentIssues := where $active "Params.affected" "intersect" (slice .name) }} - - {{ $thisIsNotice := where $activeComponentIssues "Params.severity" "=" "notice" }} - {{ $thisIsDisrupted := where $activeComponentIssues "Params.severity" "=" "disrupted" }} - {{ $thisIsDown := where $activeComponentIssues "Params.severity" "=" "down" }} - -
- - {{ .name }} - - - {{ with .description }} - -   (?) - - - {{ . }} - + +
+ {{ $systems := .Site.Params.systems }} + {{ $categories := .Site.Params.categories }} + + {{ range $categories }} +
+ {{ if not .untitled }} +
+ {{ if .closed }}⯈{{ else }}⯆{{ end }} + + {{ .name }} + + {{ with .description }} + +   (?) + + + {{ . }} - {{ end }} - - - {{ if $thisIsDown }} - {{ T "thisIsDown" }} - {{ else }} - {{ if $thisIsDisrupted }} - {{ T "thisIsDisrupted" }} - {{ else }} - {{ if $thisIsNotice }} - {{ T "thisIsNotice" }} - {{ else }} - {{ T "thisIsOk" }} - {{ end }}{{ end }}{{ end }} + {{ end }} + +
+ {{ else }} +
+ {{ end }} + + {{ $categorySystems := where $systems "category" "=" .name }} + +
+ {{ range $categorySystems }} + {{ $activeComponentIssues := where $active "Params.affected" "intersect" (slice .name) }} - {{ with .partial }} -
- {{ partial . . }} + {{ $thisIsNotice := where $activeComponentIssues "Params.severity" "=" "notice" }} + {{ $thisIsDisrupted := where $activeComponentIssues "Params.severity" "=" "disrupted" }} + {{ $thisIsDown := where $activeComponentIssues "Params.severity" "=" "down" }} + +
+ + {{ .name }} + + + {{ with .description }} + +   (?) + + + {{ . }} + + + {{ end }} + + + {{ if $thisIsDown }} + {{ T "thisIsDown" }} + {{ else }} + {{ if $thisIsDisrupted }} + {{ T "thisIsDisrupted" }} + {{ else }} + {{ if $thisIsNotice }} + {{ T "thisIsNotice" }} + {{ else }} + {{ T "thisIsOk" }} + {{ end }}{{ end }}{{ end }} + + + {{ with .partial }} +
+ {{ partial . . }} +
+ {{ end }}
- {{ end }} + {{ end }}
- {{ end }} -
\ No newline at end of file +
+ {{ end }} + +
\ No newline at end of file -- cgit v1.2.3-70-g09d2 From f8b0da97d84c043576418b9d28f5d75d94d611aa Mon Sep 17 00:00:00 2001 From: Mantas <11616378+mistermantas@users.noreply.github.com> Date: Wed, 8 May 2019 22:16:24 +0300 Subject: Categories working except for the arrow --- exampleSite/config.yml | 6 +++++- layouts/partials/index/components.html | 8 +++++--- layouts/partials/index/summary.html | 2 +- layouts/partials/meta.html | 26 +++++++++++++++++++------- 4 files changed, 30 insertions(+), 12 deletions(-) (limited to 'layouts/partials/index') diff --git a/exampleSite/config.yml b/exampleSite/config.yml index 8b45b9b..a45d06d 100644 --- a/exampleSite/config.yml +++ b/exampleSite/config.yml @@ -109,6 +109,8 @@ params: systems: - name: Gateway category: North Coast + - name: Backup Gateway + category: East Coast - name: API description: The guts of the application. category: Uncategorized @@ -119,10 +121,12 @@ params: categories: - name: North Coast description: The worst one. Or the best one. - closed: true + closed: true + - name: East Coast - name: Uncategorized untitled: true + # What date format to use? # diff --git a/layouts/partials/index/components.html b/layouts/partials/index/components.html index 392acb7..47da96c 100644 --- a/layouts/partials/index/components.html +++ b/layouts/partials/index/components.html @@ -13,8 +13,10 @@ {{ range $categories }}
{{ if not .untitled }} -
- {{ if .closed }}⯈{{ else }}⯆{{ end }} +
+ + {{ if .closed }}⯈{{ else }}⯆{{ end }} + {{ .name }} @@ -35,7 +37,7 @@ {{ $categorySystems := where $systems "category" "=" .name }} -
+
{{ range $categorySystems }} {{ $activeComponentIssues := where $active "Params.affected" "intersect" (slice .name) }} diff --git a/layouts/partials/index/summary.html b/layouts/partials/index/summary.html index d8e3108..de6bceb 100644 --- a/layouts/partials/index/summary.html +++ b/layouts/partials/index/summary.html @@ -20,5 +20,5 @@ {{ end }}{{ end }}{{ end }} - +
\ No newline at end of file diff --git a/layouts/partials/meta.html b/layouts/partials/meta.html index ad4655a..9acc554 100644 --- a/layouts/partials/meta.html +++ b/layouts/partials/meta.html @@ -20,6 +20,8 @@ var themeNoticeColor = '#{{ .Site.Params.notice }}'; var themeDisruptedColor = '#{{ .Site.Params.disrupted }}'; var themeDownColor = '#{{ .Site.Params.down }}'; + +