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/partials/index') 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/partials/index') 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/partials/index') 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/partials/index') 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