Allow for multiple categories in tables

This commit is contained in:
Christian Wolf 2025-01-17 15:36:01 +01:00
parent e4ad157a54
commit ca6250bbf6
3 changed files with 16 additions and 15 deletions

View File

@ -22,16 +22,9 @@ Darüber hinaus können unsere Tänzer zu fast jeder Zeit noch frei trainieren -
[unsere Turnierpaare]({{< relref "paare" >}})
## Trainingszeiten Turniertanz
| Turniertanz | Tag | Zeit | Ort |
|---------------------------------------------|---------|-----------------|---------|
| Turnieraufbau Latein | Di | 19:00 - 20:00 | VH Neu |
| Turnier Standard | Di | 20:00 - 22:00 | VH Neu |
| Turnieraufbau Standard | Mi | 20:30 - 22:00 | VH Vorn |
| Turnieraufbau Kinder Jugend inkl. Basic | Mi | 16:30 - 18:00 | VH Neu |
| Turnieraufbau Kinder Jugend inkl. Basic | Do | 18:00 - 19:30 | VH Neu |
| Turnieraufbau Kinder Jugend inkl. Basic | Fr | 16:00 - 17:00 | VH Neu |
 
{{< tsc/calendar/table category="Turnier" >}}
{{% tsc/link-offers %}}
## Sportverwaltung und weitere Links

View File

@ -56,6 +56,7 @@ calendars:
duration: 60
class: DSTeens
- title: Turnieraufbau Std
weight: -1
day: Wed
start: '20:30'
duration: 90
@ -189,11 +190,13 @@ calendars:
# class: DSKids
- title: Turnier Latein
weight: -1
day: Tue
start: '19:00'
duration: 60
class: Turnier
- title: Turnier Standard
weight: -1
day: Tue
start: '20:00'
duration: 120
@ -231,11 +234,12 @@ calendars:
duration: 90
class: Breitensport
- title: Kindertanz 8 (Turnieraufbau)
- title: Kindertanz 8
subtitle: Turnieraufbau
day: Thu
start: '18:00'
duration: 90
class: Kinder
class: [Kinder, Turnier]
- title: Kindertanz 0
day: Fri
@ -249,9 +253,10 @@ calendars:
age: '2016 - 18'
duration: 60
class: Kinder
- title: Kindertanz 2 (Turnieraufbau)
- title: Kindertanz 2
subtitle: Turnieraufbau
day: Fri
start: '16:30'
age: ''
duration: 150
class: Kinder
class: [Kinder, Turnier]

View File

@ -12,6 +12,7 @@
{{- end -}}
{{- end -}}
{{- $cat := .Get "category" -}}
{{/* warnf "%#v" $cat */}}
{{- $showAge := .Get "showAge" | default false -}}
{{- $list = sort $list "start" -}}
{{- $list = sort $list "title" -}}
@ -29,8 +30,10 @@
</thead>
<tbody>
{{ range $list -}}
{{- if ne .class $cat }}{{ continue }}{{ end -}}
{{/* warnf "%#v" . */}}
{{- $cats := slice .class -}}
{{- if eq (printf "%T" .class) "[]interface {}" }}{{ $cats = .class }}{{ end -}}
{{- if not (in $cats $cat) }}{{ continue }}{{ end -}}
{{/* warnf "%T %#v" .class . */}}
<tr>
<td>
{{ .title }}{{ with .subtitle }} - {{ . }}{{ end }}