86 lines
3.6 KiB
HTML
86 lines
3.6 KiB
HTML
{{- $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="first-row"></div>
|
|
{{ range $days }}
|
|
<div class="first-row">{{ . }}</div>
|
|
{{ end }}
|
|
<div class="first-row"></div>
|
|
<div class="second-row"></div>
|
|
{{ range $days }}
|
|
<div class="rooms second-row">
|
|
<div>Vorne</div>
|
|
<div>Mitte</div>
|
|
<div>Hinten</div>
|
|
</div>
|
|
{{ end }}
|
|
<div class="second-row"></div>
|
|
</div>
|
|
{{ range (seq $start $end) }}
|
|
{{- $currentHour := string . -}}
|
|
{{- $addClass := "" -}}
|
|
{{- $firstRow := eq . $start -}}
|
|
{{- if eq . $start }}{{ $addClass = "first-main-row"}}{{ end -}}
|
|
{{ warnf "Current hour: %s (%T)" $currentHour $currentHour }}
|
|
<div class="table-row">{{ 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") -}}
|
|
{{/* warnf "%T" $hours */}}
|
|
{{/* $hours = add $hours (sub 0 $start) (div $minutes 60.0) */}}
|
|
{{/* print $hours */}}
|
|
{{/* $hours = $hours - 0 + ($minutes / 60.0) */}}
|
|
{{- $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">{{ printf "%2d:00" . }}</div>
|
|
{{ end }}
|
|
<!--<div class="times">
|
|
{{ range (seq $start $end) }}
|
|
<div>{{ printf "%2d:00" . }}</div>
|
|
<div>{{ printf "%2d:00" . }}</div>
|
|
{{ end }}
|
|
</div>
|
|
{{ range $id, $day := $days }}
|
|
<div class="cal-main-content day-{{$id}}">
|
|
{{ range $listSchedule }}
|
|
{{- if ne .day $day }}{{ continue }}{{ end }}
|
|
{{- $sTime := time.AsTime (printf "2025-01-02T%s:00" .start) -}}
|
|
{{- $hours := int ($sTime.Format "15") -}}
|
|
{{- $minutes := int ($sTime.Format "4") -}}
|
|
{{/* warnf "%T" $hours */}}
|
|
{{ $hours = add $hours (sub 0 $start) (div $minutes 60.0) }}
|
|
{{/* print $hours */}}
|
|
{{/* $hours = $hours - 0 + ($minutes / 60.0) */}}
|
|
{{- $top := mul $hours 60 -}}
|
|
{{- $height := mul (div .duration 60.0) 60 -}}
|
|
{{- $style := printf "top: %1.0fpx; height: %1.0fpx;" $top $height -}}
|
|
{{/* warnf "%s" $style */}}
|
|
<div class="event room-{{ .roomId }}" style="{{ $style | safeCSS }}">
|
|
<div>
|
|
{{ .title }}
|
|
</div>
|
|
</div>
|
|
{{ end }}
|
|
</div>
|
|
{{ end }}-->
|
|
</div>
|