| 1 | {{define "title"}}{{.Title}}{{end}} |
| 2 | {{define "main"}} |
| 3 | <main rst-page cal-view id="main"> |
| 4 | <header rst-page-header> |
| 5 | <div rst-page-header-titles> |
| 6 | <h1>{{.Data.Month.Title}}</h1> |
| 7 | </div> |
| 8 | {{/* Quick add sits BESIDE New event, not instead of it. The |
| 9 | sentence is the fast path; the form is the one that shows |
| 10 | every field, and neither is a lesser version of the other. */}} |
| 11 | <div cal-header-actions> |
| 12 | {{template "quickadd" .}} |
| 13 | <a rst-btn="primary" href="/events/new">New event</a> |
| 14 | </div> |
| 15 | </header> |
| 16 | |
| 17 | {{template "calendar-toolbar" (dict "View" "month" "Noun" "month" "Prev" (printf "/month/%s" .Data.Month.PrevISO) "Today" (printf "/month/%s" .Data.TodayMonth) "Next" (printf "/month/%s" .Data.Month.NextISO) "Day" (printf "/day/%s" .Data.SelectedISO) "Week" (printf "/week/%s" .Data.SelectedISO) "Month" (printf "/month/%s?date=%s" .Data.Month.ISO .Data.SelectedISO) "Agenda" (printf "/agenda?from=%s" .Data.SelectedISO))}} |
| 18 | |
| 19 | {{/* A real table. A month IS tabular data — seven weekday columns |
| 20 | against week rows — so the headers come free for a screen reader, |
| 21 | and a scriptless page keeps semantics a div grid would have to |
| 22 | rebuild with ARIA. */}} |
| 23 | <table cal-month> |
| 24 | <caption class="rst-sr-only">{{.Data.Month.Title}}, by week</caption> |
| 25 | <thead> |
| 26 | <tr>{{range .Data.Month.Weekdays}}<th scope="col">{{.}}</th>{{end}}</tr> |
| 27 | </thead> |
| 28 | <tbody> |
| 29 | {{range .Data.Month.Weeks}} |
| 30 | <tr> |
| 31 | {{range .Days}} |
| 32 | <td> |
| 33 | <div cal-day-cell="{{if not .InMonth}}outside{{end}}{{if .Weekend}} weekend{{end}}"> |
| 34 | <a cal-day-num="{{if .IsToday}}today{{end}}" href="{{.Href}}"> |
| 35 | {{.Day}}{{if .IsToday}}<span class="rst-sr-only"> (today)</span>{{end}} |
| 36 | </a> |
| 37 | {{range .Chips}}{{template "chip" .}}{{end}} |
| 38 | {{/* A month cell that grew to fit its fullest day would make |
| 39 | every row that tall. The overflow links to the day, which |
| 40 | is the only place that can show them all. */}} |
| 41 | {{if .More}}<a cal-more href="{{.Href}}">+{{.More}} more</a>{{end}} |
| 42 | </div> |
| 43 | </td> |
| 44 | {{end}} |
| 45 | </tr> |
| 46 | {{end}} |
| 47 | </tbody> |
| 48 | </table> |
| 49 | </main> |
| 50 | {{end}} |
| 51 | {{define "content"}}{{end}} |
| 52 | |