{{define "timeline-section"}}
{{template "view-project-chip" .}}

{{.P.TotalRows}} rows · {{.P.From.Format "2006-01-02"}} → {{.P.ToInclusive.Format "2006-01-02"}} {{if .P.Cached}}· cached{{else}}· fresh{{end}}

{{if .P.Days}}
    {{range .P.Days}}
  1. {{if .Sticky}}{{.Sticky}}{{end}}

    {{.Label}} ({{len .Rows}})

      {{range .Rows}} {{if eq .Kind "event"}}
    • {{if .StartLabel}}{{.StartLabel}}{{else}} {{end}} event {{.ItemPath}} {{.Event.Summary}} {{if .Event.Location}}· {{.Event.Location}}{{end}} {{if .DurationHint}}{{.DurationHint}}{{end}} {{if .Event.Recurring}}{{end}}
    • {{else if eq .Kind "todo"}} {{$todoCal := .CalendarURL}} {{$uid := .Todo.UID}} {{$done := or (eq .Todo.Status "COMPLETED") (eq .Todo.Status "CANCELLED")}}
    • {{if .Todo.Due}}{{if eq (.Todo.Due.Hour) 0}}{{else}}{{.Todo.Due.Format "15:04"}}{{end}}{{end}}
      todo {{.ItemPath}}
    • {{else if eq .Kind "doc"}}
    •   doc {{.PER}} {{.Link.RefType}} {{if .Link.Note}}{{deref .Link.Note}}{{end}} {{.Link.RefID}} {{.ItemPath}}
    • {{else if eq .Kind "creation"}}
    •   added added {{.ItemPath}} to projax
    • {{end}} {{end}}
  2. {{end}}
{{else}}

Nothing on this timeline yet.

{{end}}
{{end}}