{{define "dashboard-section"}}

{{if .P.Cached}}updated {{.UpdatedRel}} · cached {{else}}updated {{.UpdatedRel}} · fresh{{end}} ↻ refresh

{{$collapse := not .FilterActive}} {{if or .P.Tasks (not $collapse)}}

Open tasks ({{.P.TaskTotal}})

{{if or .P.TaskGroups.Overdue .P.TaskGroups.Today .P.TaskGroups.Tomorrow .P.TaskGroups.Week .P.TaskGroups.NoDue}}

{{if .P.TaskGroups.Overdue}}Overdue ({{.P.TaskGroups.Overdue}}){{end}} {{if .P.TaskGroups.Today}}Today ({{.P.TaskGroups.Today}}){{end}} {{if .P.TaskGroups.Tomorrow}}Tomorrow ({{.P.TaskGroups.Tomorrow}}){{end}} {{if .P.TaskGroups.Week}}This week ({{.P.TaskGroups.Week}}){{end}} {{if .P.TaskGroups.NoDue}}No due ({{.P.TaskGroups.NoDue}}){{end}}

{{end}}
{{if .P.Tasks}}
    {{range .P.Tasks}}
  • {{.Item.PrimaryPath}} {{.Todo.Summary}} {{if .DueRel}}{{.DueRel}}{{end}}
  • {{end}}
{{else}}

Nothing open. Nice.

{{end}}
{{else}}

No open tasks.

{{end}} {{if or .P.Issues (not $collapse)}}

Open issues ({{.P.IssueTotal}})

{{if .P.Issues}} {{else}}

No open issues across linked repos.

{{end}}
{{else}}

No open issues.

{{end}} {{if or .P.RecentDocs (not $collapse)}}

Recent documents ({{.P.RecentDocsTotal}}, last 30d)

{{if .P.RecentDocs}} {{else}}

Nothing dated in the last 30 days.

{{end}}
{{else}}

No recent documents.

{{end}} {{if .P.Stale}}

Stale projects ({{.P.StaleTotal}}) · consider archiving?

{{end}}
{{end}}