Merge pull request 'Gruppierung der Turnier-Meldungen nach Datum' (#40) from feat/grouped-list into develop

Reviewed-on: tsc-vfl/hugo-page#40
This commit is contained in:
Christian Wolf 2024-02-15 19:45:32 +00:00
commit 70f043377e
2 changed files with 18 additions and 25 deletions

View File

@ -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;
}
.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;
margin: 10px 0 0;
}
.participation {
margin: 0 0 0 2em;
}
}
}

View File

@ -3,15 +3,20 @@
<h1>{{ .Title }}</h1>
</a>
{{ $meldungen := where .Site.RegularPages "Section" "==" "turniermeldung" }}
<div class="turniermeldung-list">
{{ range (sort $meldungen ".Params.dateCompetition" "asc") }}
{{ $date := time.AsTime .Params.dateCompetition }}
{{ if ge $date (now.AddDate 0 0 -1) }}
<div class="turniermeldung">
<div class="date">{{ $date.Format "02.01.2006" }}</div>
<div class="ort"><a href="{{ .RelPermalink }}">{{ .Params.ort }} ({{ .Params.partner }} / {{ .Params.partnerin }})</a></div>
</div>
{{- $futureMeldungen := slice -}}
{{- range $meldungen -}}
{{- if ge (time.AsTime .Params.dateCompetition) (now.AddDate 0 0 -1) }}
{{- $futureMeldungen = $futureMeldungen | append . }}
{{- end }}
{{- end }}
<div class="turniermeldungen-group-list">
{{ range ( $futureMeldungen.GroupByParamDate "dateCompetition" "02.01.2006" "asc") }}
<div class="day">
<div class="date">{{ .Key }}</div>
{{ range .Pages }}
<div class="participation"><a href="{{ .RelPermalink }}">{{ .Params.ort }} ({{ .Params.partner }} / {{ .Params.partnerin }})</a></div>
{{ end }}
</div>
{{ end }}
</div>
{{ .Content }}