{{define "title"}}{{.Title}}{{end}} {{define "main"}}

{{.Data.Day.Title}}

{{/* Quick add sits BESIDE New event, not instead of it. The sentence is the fast path; the form is the one that shows every field, and neither is a lesser version of the other. */}}
{{template "quickadd" .}} New event
{{template "calendar-toolbar" (dict "View" "day" "Noun" "day" "Prev" (printf "/day/%s" .Data.PrevISO) "Today" (printf "/day/%s" .Data.TodayISO) "Next" (printf "/day/%s" .Data.NextISO) "Day" (printf "/day/%s" .Data.Day.ISO) "Week" (printf "/week/%s" .Data.Day.ISO) "Month" (printf "/month/%s?date=%s" (slice .Data.Day.ISO 0 7) .Data.Day.ISO) "Agenda" (printf "/agenda?from=%s" .Data.Day.ISO))}} {{/* The day's own sentence. Not a caption — it is the answer to the question somebody opened this page to ask. Below the toolbar, so its length (and whether it wraps) never moves the controls. */}}

{{.Data.Day.Summary.Sentence}}

{{if .Data.Day.AllDay}}
{{range .Data.Day.AllDay}}{{template "chip" .}}{{end}}
{{end}}
{{range .Data.Day.Hours}}
{{.}}
{{end}}
{{/* Every empty half hour is an ordinary link to a prefilled form. This is the whole of "click a time to create an event" with no JavaScript: the visible target is a box, and the accessible name is the sentence in Label. */}} {{range .Data.Day.Slots}} {{.Label}} {{end}} {{range .Data.Day.Placed}}
{{template "chip" .Chip}}
{{end}}
{{if not .Data.Day.Placed}}{{if not .Data.Day.AllDay}} {{template "empty-state" dict "Title" "Nothing on this day" "Body" "Pick a time in the grid above, or use New event."}} {{end}}{{end}}
{{end}} {{define "content"}}{{end}}