From bc7b2d5e390ed760c35a7f9d36ce9e4a56cab67e Mon Sep 17 00:00:00 2001 From: Christian Wolf Date: Tue, 13 Feb 2024 19:07:27 +0100 Subject: [PATCH] Make a group by date list --- themes/tsc_vfl/assets/css/main.scss | 22 +++++-------------- .../layouts/_default/turniermeldungen.html | 21 +++++++++++------- 2 files changed, 18 insertions(+), 25 deletions(-) diff --git a/themes/tsc_vfl/assets/css/main.scss b/themes/tsc_vfl/assets/css/main.scss index e4f67828..4a3288ff 100644 --- a/themes/tsc_vfl/assets/css/main.scss +++ b/themes/tsc_vfl/assets/css/main.scss @@ -926,26 +926,14 @@ table.time { } } -.turniermeldung-list { - .turniermeldung { - display: flex; - align-items: center; +.turniermeldungen-group-list { + .day { .date { font-weight: bold; - flex: auto 0 0; + margin: 10px 0 0; } - .ort { - margin: 0 0 0 10px; - padding: 2px 0; - flex: auto 1 0; - - a { - display: block; - width: 100%; - height: 100%; - padding: 3px 0; - box-sizing: border-box; - } + .participation { + margin: 0 0 0 2em; } } } diff --git a/themes/tsc_vfl/layouts/_default/turniermeldungen.html b/themes/tsc_vfl/layouts/_default/turniermeldungen.html index 01108a06..59504694 100644 --- a/themes/tsc_vfl/layouts/_default/turniermeldungen.html +++ b/themes/tsc_vfl/layouts/_default/turniermeldungen.html @@ -3,15 +3,20 @@

{{ .Title }}

{{ $meldungen := where .Site.RegularPages "Section" "==" "turniermeldung" }} -
- {{ range (sort $meldungen ".Params.dateCompetition" "asc") }} - {{ $date := time.AsTime .Params.dateCompetition }} - {{ if ge $date (now.AddDate 0 0 -1) }} - + {{- $futureMeldungen := slice -}} + {{- range $meldungen -}} + {{- if ge (time.AsTime .Params.dateCompetition) (now.AddDate 0 0 -1) }} + {{- $futureMeldungen = $futureMeldungen | append . }} + {{- end }} + {{- end }} +
+ {{ range ( $futureMeldungen.GroupByParamDate "dateCompetition" "02.01.2006" "asc") }} +
+
{{ .Key }}
+ {{ range .Pages }} + {{ end }} +
{{ end }}
{{ .Content }}