52 lines
2.1 KiB
HTML
Raw Normal View History

2025-01-19 10:33:57 +01:00
{{- $start := .Get 0 -}}
{{- $end := .Get 1 -}}
{{- $days := after 2 .Params -}}
{{- $numDays := len $days -}}
{{- $calendar := $.Site.Data.calendar.calendar -}}
{{- $listSchedule := partialCached "tsc/calendar/list" . }}
<div class="calendar-schedule calendar-grid-{{ $numDays }}-days">
<div class="header">
<div class="times-left"></div>
2025-01-19 10:33:57 +01:00
{{ range $days }}
<div class="main-column">{{ . }}</div>
2025-01-19 10:33:57 +01:00
{{ end }}
<div class="times-right"></div>
<div class="times-left"></div>
2025-01-19 10:33:57 +01:00
{{ range $days }}
<div class="rooms main-column">
2025-01-19 10:33:57 +01:00
<div>Vorne</div>
<div>Mitte</div>
<div>Hinten</div>
</div>
{{ end }}
<div class="times-right"></div>
2025-01-19 10:33:57 +01:00
</div>
{{ range (seq $start $end) }}
{{- $currentHour := string . -}}
{{- $addClass := "" -}}
{{- $firstRow := eq . $start -}}
{{- if eq . $start }}{{ $addClass = "first-main-row"}}{{ end -}}
<div class="table-row times-left">{{ printf "%2d:00" . }}</div>
{{- range $id, $day := $days }}
<div class="table-row main-entry">
{{- range $listSchedule }}
{{- if ne .day $day }}{{ continue }}{{ end -}}
{{- $sTime := time.AsTime (printf "2025-01-02T%s:00" .start) -}}
{{- $evHour := $sTime.Format "15" -}}
{{- if ne $currentHour $evHour }}{{ continue }}{{ end -}}
{{- $hours := int ($sTime.Format "15") -}}
{{- $minutes := int ($sTime.Format "4") -}}
{{- $style := printf "--duration: %d; --minutes: %d;" .duration $minutes -}}
{{/* warnf "%s" $style */}}
<div class="event room-{{ .roomId }}" style="{{ $style | safeCSS }}">
<div>
{{ .title }}
</div>
</div>
{{ end -}}
</div>
{{ end -}}
<div class="table-row times-right">{{ printf "%2d:00" . }}</div>
{{ end }}
2025-01-19 10:33:57 +01:00
</div>