From 3eaf98528ab712e171c1de83416baba6d2a2e8dc Mon Sep 17 00:00:00 2001 From: Denys Konovalov Date: Fri, 16 Aug 2024 20:51:08 +0200 Subject: [PATCH] add hidden switch to termine --- content/termine/_index.md | 1 + layouts/partials/data/termin-upcoming.html | 2 +- layouts/termine/list.html | 2 ++ static/admin/config/collections/index-pages.js | 8 ++++++++ 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/content/termine/_index.md b/content/termine/_index.md index 8b16ccd1..7d4c4bf9 100644 --- a/content/termine/_index.md +++ b/content/termine/_index.md @@ -307,6 +307,7 @@ events: enddate: "" title: Mannschaftswettbewerb Informatik der Klassenstufen 9-12 location: Jena + hidden: false - date: 2024-04-04 enddate: "" title: Abifiz diff --git a/layouts/partials/data/termin-upcoming.html b/layouts/partials/data/termin-upcoming.html index 3d093194..1c1cd37b 100644 --- a/layouts/partials/data/termin-upcoming.html +++ b/layouts/partials/data/termin-upcoming.html @@ -1 +1 @@ -{{ return or (ge (.date | time.AsTime) now) (and .enddate (ge (.enddate | time.AsTime) now)) }} \ No newline at end of file +{{ return and (not .hidden) (or (ge (.date | time.AsTime) now) (and .enddate (ge (.enddate | time.AsTime) now))) }} \ No newline at end of file diff --git a/layouts/termine/list.html b/layouts/termine/list.html index 493bcbe7..d007fd5f 100644 --- a/layouts/termine/list.html +++ b/layouts/termine/list.html @@ -9,10 +9,12 @@
{{ range sort .Params.events ".date" }} + {{ if not .hidden }}
{{ partial "termin" . }}
{{ end }} + {{ end }}
diff --git a/static/admin/config/collections/index-pages.js b/static/admin/config/collections/index-pages.js index d472f097..fcae597f 100644 --- a/static/admin/config/collections/index-pages.js +++ b/static/admin/config/collections/index-pages.js @@ -219,6 +219,14 @@ const IndexPagesCollection = { widget: "string", required: false, }, + { + name: "hidden", + label: "Versteckt", + hint: "Termin taucht nicht in der Liste auf", + widget: "boolean", + required: false, + default: false, + }, ], }, ],