From 56f6b868a508ed6ce37afbbe46449ea7b6044ad1 Mon Sep 17 00:00:00 2001 From: Mantas Vilčinskas Date: Sat, 2 Oct 2021 21:38:12 +0300 Subject: #205 - add pinned informational posts --- layouts/partials/index/announcements.html | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) (limited to 'layouts') diff --git a/layouts/partials/index/announcements.html b/layouts/partials/index/announcements.html index 25a1719..01b353d 100644 --- a/layouts/partials/index/announcements.html +++ b/layouts/partials/index/announcements.html @@ -1,7 +1,8 @@ {{ $incidents := where .Site.RegularPages "Params.section" "issue" }} {{ $active := where $incidents "Params.resolved" "=" false }} +{{ $pinned := where $incidents "Params.pin" "=" true }} -{{ if $active }} +{{ if or ($active) ($pinned) }}
{{ range $active }}
@@ -17,10 +18,30 @@ {{ end }}

- {{ .Content | safeHTML | truncate 500 "…" }} + {{ .Content | safeHTML | truncate 500 "…" }} +

+
+
+ {{ end }} + + {{ range $pinned }} +
+

+ {{ .Title }} → +

+ +

+ {{ range .Params.Affected }} + + {{ . }} + + {{ end }} +

+ + {{ .Content | safeHTML | truncate 500 "…" }}


{{ end }}
-{{ end }} \ No newline at end of file +{{ end }} -- cgit v1.2.3-70-g09d2 From e2c0c2aa64ec564b4db3e67371209e2fa8b4e0aa Mon Sep 17 00:00:00 2001 From: Mantas Vilčinskas Date: Sat, 2 Oct 2021 21:49:01 +0300 Subject: only allow informational posts to be pinned --- layouts/partials/index/announcements.html | 2 ++ 1 file changed, 2 insertions(+) (limited to 'layouts') diff --git a/layouts/partials/index/announcements.html b/layouts/partials/index/announcements.html index 01b353d..5f425fc 100644 --- a/layouts/partials/index/announcements.html +++ b/layouts/partials/index/announcements.html @@ -25,6 +25,7 @@ {{ end }} {{ range $pinned }} + {{ if .Params.informational }}

{{ .Title }} → @@ -42,6 +43,7 @@


+ {{ end }} {{ end }} {{ end }} -- cgit v1.2.3-70-g09d2 From 6b8f7c09adf6bfc19741c10f8b7bb1982c24419b Mon Sep 17 00:00:00 2001 From: Mantas Vilčinskas Date: Sun, 10 Oct 2021 16:48:20 +0300 Subject: fix bug so same post doesn't show up twice --- layouts/partials/index/announcements.html | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'layouts') diff --git a/layouts/partials/index/announcements.html b/layouts/partials/index/announcements.html index 5f425fc..e33c262 100644 --- a/layouts/partials/index/announcements.html +++ b/layouts/partials/index/announcements.html @@ -1,10 +1,11 @@ {{ $incidents := where .Site.RegularPages "Params.section" "issue" }} {{ $active := where $incidents "Params.resolved" "=" false }} +{{ $activeIncidents := where $incidents "Params.informational" "=" false }} {{ $pinned := where $incidents "Params.pin" "=" true }} -{{ if or ($active) ($pinned) }} +{{ if or ($activeIncidents) ($pinned) }}
- {{ range $active }} + {{ range $activeIncidents }}

{{ .Title }} → @@ -39,7 +40,7 @@ {{ end }}

- {{ .Content | safeHTML | truncate 500 "…" }} + {{ .Content | safeHTML | truncate 500 "…" }}


-- cgit v1.2.3-70-g09d2 From 9796b93c0347d38ed7507db3a37a8f20827df852 Mon Sep 17 00:00:00 2001 From: Mantas Vilčinskas Date: Sun, 10 Oct 2021 16:54:15 +0300 Subject: #202 - changed my mind, old close marker wasn't ok --- layouts/partials/index/components.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'layouts') diff --git a/layouts/partials/index/components.html b/layouts/partials/index/components.html index acb1aa7..d3d67bd 100644 --- a/layouts/partials/index/components.html +++ b/layouts/partials/index/components.html @@ -16,7 +16,7 @@
- + @@ -136,4 +136,4 @@
{{ end }} -
\ No newline at end of file + -- cgit v1.2.3-70-g09d2 From 06e17fe7fa96dd29babda710c83111225974d5d8 Mon Sep 17 00:00:00 2001 From: Mantas Vilčinskas Date: Sun, 10 Oct 2021 16:56:49 +0300 Subject: 5.2 update --- layouts/index.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'layouts') diff --git a/layouts/index.json b/layouts/index.json index 2a11077..bf2e62c 100644 --- a/layouts/index.json +++ b/layouts/index.json @@ -1,6 +1,6 @@ {{ $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" }}{ "is": "index", - "cStateVersion": "5.1", + "cStateVersion": "5.2", "apiVersion": "2.0", "title": "{{ .Site.Title }}", "languageCodeHTML": "{{ .Site.LanguageCode }}", -- cgit v1.2.3-70-g09d2 From 3358049096f1b1374b244d4d6466f63a00757441 Mon Sep 17 00:00:00 2001 From: Mantas Vilčinskas Date: Sun, 10 Oct 2021 16:57:04 +0300 Subject: 5.2 update --- layouts/partials/js.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'layouts') diff --git a/layouts/partials/js.html b/layouts/partials/js.html index e11de17..88948df 100644 --- a/layouts/partials/js.html +++ b/layouts/partials/js.html @@ -3,7 +3,7 @@ * Dev toolset */ - console.log('cState v5.1 - https://github.com/cstate/cstate'); + console.log('cState v5.2 - https://github.com/cstate/cstate'); document.getElementsByTagName('html')[0].className = 'js'; /** -- cgit v1.2.3-70-g09d2 From c3b80901b9a9d73e84ca00eb8d88216c7f6d24e2 Mon Sep 17 00:00:00 2001 From: Mantas Vilčinskas Date: Sun, 10 Oct 2021 16:57:21 +0300 Subject: 5.2 update --- layouts/partials/meta.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'layouts') diff --git a/layouts/partials/meta.html b/layouts/partials/meta.html index 4e7d06e..0e8725b 100644 --- a/layouts/partials/meta.html +++ b/layouts/partials/meta.html @@ -12,7 +12,7 @@ {{ range .AlternativeOutputFormats -}} {{ printf `` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }} {{ end -}} - +