Gruppierung der Turnier-Meldungen nach Datum #40

Merged
christian merged 1 commits from feat/grouped-list into develop 2024-02-15 19:45:33 +00:00
2 changed files with 18 additions and 25 deletions

View File

@ -926,26 +926,14 @@ table.time {
} }
} }
.turniermeldung-list { .turniermeldungen-group-list {
.turniermeldung { .day {
display: flex;
align-items: center;
.date { .date {
font-weight: bold; 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;
} }
} }
} }

View File

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