{{define "title"}}{{.Title}}{{end}} {{define "main"}} {{/* cal-view: the one width every view shares (calendar.css). */}}

{{.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" "week" "Noun" "week" "Prev" (printf "/week/%s" .Data.PrevISO) "Today" (printf "/week/%s" .Data.TodayISO) "Next" (printf "/week/%s" .Data.NextISO) "Day" (printf "/day/%s" .Data.StartISO) "Week" (printf "/week/%s" .Data.StartISO) "Month" (printf "/month/%s?date=%s" (slice .Data.StartISO 0 7) .Data.StartISO) "Agenda" (printf "/agenda?from=%s" .Data.StartISO))}} {{/* The week keeps its two dimensions on a phone and scrolls sideways. Flattening it to a list would make it the agenda, which already exists and is better at being a list. */}}
{{/* Row by row, not column by column: the headers, then ONE all-day row across the whole week, then the timed grid. When each day carried its own all-day strip, a day with a birthday pushed its hour column down and its 10:00 meeting drew beside the 11:00 label. As rows of one grid, every timed column starts at the same height whatever sits above it. */}}
 
{{range .Data.Days}}
{{.Date.Format "Mon 2"}} {{if eq .ISO $.Data.TodayISO}}(today){{end}}
{{end}} {{if .Data.AnyAllDay}}
All day
{{range .Data.Days}}
{{range .AllDay}}{{template "chip" .}}{{end}}
{{end}} {{end}}
{{range (index .Data.Days 0).Hours}}
{{.}}
{{end}}
{{range .Data.Days}}
{{range .Slots}} {{.Label}} {{end}} {{range .Placed}}
{{template "chip" .Chip}}
{{end}}
{{end}}
{{end}} {{define "content"}}{{end}}