blob: c3cc047187e4f07908e40f447e4b13bb49115ac1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
|
{{ define "main" }}
{{ .Content }}
{{ $lang := $.Page.Language.Lang }}
<nav class="day-tabs">
{{ range $day := $.Site.Data.schedule }}
<a href="#day_{{$day.day}}">{{- partial "date-long.html" (dict "time" .day "lang" $lang) }}</a>
{{ end }}
</nav>
{{ $.Scratch.Set "maxEnd" 0 }}
{{ range $.Site.Data.slots }}
{{ if gt .row.end ($.Scratch.Get "maxEnd") }}
{{ $.Scratch.Set "maxEnd" .row.end }}
{{ end}}
{{ end }}
{{ $maxEnd := $.Scratch.Get "maxEnd" }}
<section class="schedule{{ if $.Params.horizontal}} horizontal{{ end }}">
{{ range $day := $.Site.Data.schedule }}
{{ $time := split $day.start ":" }}
{{ $dayStartH := index $time 0 }}
{{ $dayStartM := index $time 1 }}
{{ $time := split $day.end ":" }}
{{ $dayEndH := index $time 0 }}
{{ $dayEndM := index $time 1 }}
<article id="day_{{$day.day}}" class="day"
style="--rooms: {{ len .rooms }}; --end: {{ $maxEnd }};">
<h2>{{- partial "date-long.html" (dict "time" .day "lang" $lang) }}</h2>
{{ with (index .rooms 0) }}
{{ range .slots }}
{{ $slot := index (where $.Site.Data.slots "key" .slot) 0 }}
{{ $time := split $slot.start ":" }}
{{ $hh := index $time 0 }}
{{ $mm := index $time 1 }}
<div class="slot" style="--duration: {{ $slot.duration }}; --row-start: {{ $slot.row.start }}; --row-end: {{ $slot.row.end }};">
<span class="hh">{{ $hh }}</span>
<span class="mm">{{ $mm }}</span>
</div>
{{ end }}
{{ end }}
{{ range $index, $room := .rooms }}
{{ range where (where $.Site.Data.rooms "key" $room.room) "skip" "!=" true }}
<!-- Room {{ $room.room }} -->
<div class="room {{ if (modBool $index 2)}}even{{end}}" style="--room: {{ $index }};">
<h3>
{{ .label }}
{{ if .description }}
<small>{{ .description }}</small>
{{ end }}
</h3>
</div>
{{ range $room.slots }}
{{ $sessionPage := index (where $.Site.AllPages "Params.key" .talk ) 0}}
{{ $slot := index (where $.Site.Data.slots "key" .slot) 0 }}
{{ $time := split $slot.start ":" }}
{{ $hh := index $time 0 }}
{{ $mm := index $time 1 }}
<div class="session format-{{$sessionPage.Params.format}} tag-{{ anchorize (delimit ($sessionPage.Params.tags | default (slice)) " " ) }}"
style="--room: {{ $index }}; --row-start: {{ $slot.row.start }}; --row-end: {{ $slot.row.end }};">
<span class="start">
<span class="hh">{{ $hh }}</span>
<span class="mm">{{ $mm }}</span>
</span>
{{ partial "schedule-session" $sessionPage }}
</div>
{{ end }}
<!-- End room {{ $room.room }} -->
{{ end }}
{{ end }}
</article>
{{ end }}
</section>
<!--<a href="#" class="goto-top" aria-label="Top">⬆︎</a>-->
{{ end }}
{{ define "scripts" }}
<script>
function checkLinks() {
const currentDay = document.location.hash;
if (!currentDay) {
let firstDay = document.querySelector('nav.day-tabs a');
if (firstDay) {
firstDay.click();
}
}
document.querySelectorAll('nav.day-tabs a')
.forEach(function(lnk) {
lnk.classList.toggle('active', lnk.getAttribute('href') === currentDay);
});
}
window.addEventListener("load", checkLinks, false);
window.addEventListener("hashchange", checkLinks, false);
</script>
{{ end }}
|