{{template "shellTop" "morning"}}
<h1>Today</h1>
{{with .Plan}}
<div class=hint>{{.Date.Format "02.01.2006"}}</div>
{{if not .Items}}
<div class=hint>nothing planned</div>
{{else}}
<div class=scroll><table class=mono>
<tr><th>at<th>kind<th>what</tr>
{{range .Items}}<tr>
<td>{{.At.Format "15:04"}}</td>
<td class=gray>{{.Kind}}</td>
<td>{{if .Uncertain}}<span class=hint title="relayed notification, not a calendar read">похоже,</span> {{end}}{{.Text}}</td>
</tr>{{end}}
</table></div>
{{end}}
{{end}}
{{if .PlanErr}}<div class=hint>plan unavailable: {{.PlanErr}}</div>{{end}}

<h1>Morning Routines</h1>
{{if not .Routines}}
<div class=hint>no morning routines configured</div>
{{else}}
{{range .Routines}}
<div class="mb-4">
  <div><strong>{{.Name}}</strong>
    <span class={{if .Active}}green{{else}}gray{{end}}>{{if .Active}}active now{{else}}outside window{{end}}</span>
    <span class=hint>{{.WindowStart}}–{{.WindowEnd}}</span>
  </div>
  <div class=scroll><table class=mono>
  <tr><th>item<th>status</tr>
  {{range .Items}}<tr>
  <td>{{.Label}}</td>
  <td class={{if .Done}}green{{else}}red{{end}}>{{if .Done}}done{{else}}missing{{end}}</td>
  </tr>{{end}}
  </table></div>
</div>
{{end}}
{{end}}
{{template "shellBottom"}}
</html>
