-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathproms.html.tmpl
73 lines (68 loc) · 2.38 KB
/
proms.html.tmpl
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
<!DOCTYPE html>
<title>Proms</title>
<script defer src="/script.js"
data-website-id="5d8e39be-801e-4f9e-b2da-87ad3dad00ba"
data-host-url="https://stats.h5s.org">
</script>
<meta name="viewport" content="width=device-width">
<link rel="stylesheet" href="static/style.css">
<main>
{{range .}}
<div class="day" id="{{.Date.Format "2006-01-02"}}"
style="grid-column-start: {{.Date.Weekday | printf "%d"}}">
<h2>{{.Date.Format "Mon 2 Jan"}}</h2>
{{range .Proms}}
<div class="prom">
<div class="add-links">
<a href="{{.Id}}.ics" data-umami-event="add-to-cal"
data-umami-event-prom-id="{{.Id}}"
data-umami-event-prom-name="{{.Name}}">📅</a>
<a class="gcal"
href="https://calendar.google.com/calendar/render?action=TEMPLATE{{"" -}}
&text={{.Name -}}
&dates={{.Start | icaltime}}/{{.End | icaltime -}}
&details={{template "ical.txt.tmpl" . -}}
&location={{.Location -}}
"
data-umami-event="add-to-gcal"
data-umami-event-prom-id="{{.Id}}"
data-umami-event-prom-name="{{.Name}}">G</a>
</div>
<h3><a href="{{.Url}}">
{{.Start.Format "15:04"}} - {{.Name}} ({{.Location}})
</a></h3>
<div class="details">
<ul class="programme">
{{range .Programme}}
<li>
{{if .Interval}}
<span class="interval">⁂</span>
{{else}}
<span class="composer">{{.Composer}}</span>
<span class="name">{{.Name}}</span>
{{if .Duration}}
<span class="duration">({{.Duration}} mins)</span>
{{end}}
{{end}}
</li>
{{end}}
</ul>
<p class="performers">
{{range $i, $p := .Performers}}
{{if lt $i 4}}
{{if $i}}/{{end}}
{{$p.Name}}{{if $p.Role}} ({{$p.Role}}){{end}}
{{end}}
{{end}}
</p>
</div>
</div>
{{end}}
</div>
{{end}}
</main>
<script>
const today = document.getElementById(new Date().toISOString().split("T")[0]);
today.classList.add("today");
today.scrollIntoView();
</script>