Download this file
| 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>Agenda</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" "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))}} |
| 18 | |
| 19 | {{/* The agenda's scope, below the toolbar like the day's sentence. */}} |
| 20 | <p cal-sentence cal-sentence-muted>The next fortnight, and only the days with something in them.</p> |
| 21 | |
| 22 | {{if .Data.Agenda.Days}} |
| 23 | {{range .Data.Agenda.Days}} |
| 24 | <section rst-box> |
| 25 | <header rst-box-head> |
| 26 | <h2><a href="{{.Href}}">{{.Title}}</a>{{if .Today}} — today{{end}}</h2> |
| 27 | </header> |
| 28 | <div cal-day-chips> |
| 29 | {{range .Chips}}{{template "chip" .}}{{end}} |
| 30 | </div> |
| 31 | </section> |
| 32 | {{end}} |
| 33 | {{else}} |
| 34 | {{/* An empty state that teaches. "No events found" earns nothing. */}} |
| 35 | {{template "empty-state" dict |
| 36 | "Title" "Nothing in the next fortnight" |
| 37 | "Body" "Days with something on them appear here, in order. Days with nothing are left out." |
| 38 | "ActionHref" "/events/new" |
| 39 | "ActionLabel" "Add an event"}} |
| 40 | {{end}} |
| 41 | </main> |
| 42 | {{end}} |
| 43 | {{define "content"}}{{end}} |
| 44 | |