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

Agenda

{{/* 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" "agenda" "Noun" "fortnight" "Prev" (printf "/agenda?from=%s" .Data.PrevISO) "Today" "/agenda" "Next" (printf "/agenda?from=%s" .Data.NextISO) "Day" (printf "/day/%s" .Data.Agenda.FromISO) "Week" (printf "/week/%s" .Data.Agenda.FromISO) "Month" (printf "/month/%s?date=%s" (slice .Data.Agenda.FromISO 0 7) .Data.Agenda.FromISO) "Agenda" (printf "/agenda?from=%s" .Data.Agenda.FromISO))}} {{/* The agenda's scope, below the toolbar like the day's sentence. */}}

The next fortnight, and only the days with something in them.

{{if .Data.Agenda.Days}} {{range .Data.Agenda.Days}}

{{.Title}}{{if .Today}} — today{{end}}

{{range .Chips}}{{template "chip" .}}{{end}}
{{end}} {{else}} {{/* An empty state that teaches. "No events found" earns nothing. */}} {{template "empty-state" dict "Title" "Nothing in the next fortnight" "Body" "Days with something on them appear here, in order. Days with nothing are left out." "ActionHref" "/events/new" "ActionLabel" "Add an event"}} {{end}}
{{end}} {{define "content"}}{{end}}