oficina / calendar Public

Clone
git clone https://amadan.net/oficina/calendar

Plain git — no account needed to clone.

Download

Download this file

1{{/* chip — one event, wherever it appears.
2
3 The variant tokens carry meaning that must survive greyscale and a
4 stylesheet that failed to load, so each is ALSO said in text: a
5 past event's time reads "ended 09:30", a cancelled one prints the
6 word, and a note prints "All day" rather than relying on its
7 outline. Colour is never the only channel.
8
9 --cal-hue is the owning calendar's colour intent. The stylesheet
10 mixes it against a theme token rather than using it raw, so a
11 calendar's colour cannot produce an unreadable chip. */}}
12{{define "chip"}}
13<a cal-chip="{{.Kind}}{{if .Past}} past{{end}}{{if eq .Event.Status "cancelled"}} cancelled{{end}}{{if eq .Event.Status "tentative"}} tentative{{end}}"
14 style="--cal-hue: {{.Hue}}"
15 href="{{.Href}}">
16 <span cal-chip-time>{{.TimeLabel}}</span>
17 <span cal-chip-title>{{if eq .Event.Status "cancelled"}}Cancelled: {{end}}{{.Event.Title}}</span>
18</a>
19{{end}}
20