oficina / calendar Public

Clone
git clone https://amadan.net/oficina/calendar

Plain git — no account needed to clone.

Download

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>{{.Data.Day.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?date={{.Data.Day.ISO}}">New event</a>
14 </div>
15</header>
16
17{{template "calendar-toolbar" (dict "View" "day" "Noun" "day" "Prev" (printf "/day/%s" .Data.PrevISO) "Today" (printf "/day/%s" .Data.TodayISO) "Next" (printf "/day/%s" .Data.NextISO) "Day" (printf "/day/%s" .Data.Day.ISO) "Week" (printf "/week/%s" .Data.Day.ISO) "Month" (printf "/month/%s?date=%s" (slice .Data.Day.ISO 0 7) .Data.Day.ISO) "Agenda" (printf "/agenda?from=%s" .Data.Day.ISO))}}
18
19{{/* The day's own sentence. Not a caption — it is the answer to the
20 question somebody opened this page to ask. Below the toolbar, so its
21 length (and whether it wraps) never moves the controls. */}}
22<p cal-sentence>{{.Data.Day.Summary.Sentence}}</p>
23
24{{if .Data.Day.AllDay}}
25<div cal-allday>
26 {{range .Data.Day.AllDay}}{{template "chip" .}}{{end}}
27</div>
28{{end}}
29
30<div cal-grid>
31 <div cal-hours>
32 {{range .Data.Day.Hours}}<div cal-hour{{if eq . "08:00"}} cal-working-hour{{end}}>{{.}}</div>{{end}}
33 </div>
34 <div cal-column>
35 <div cal-column-rules aria-hidden="true"></div>
36
37 {{/* Every empty half hour is an ordinary link to a prefilled form.
38 This is the whole of "click a time to create an event" with no
39 JavaScript: the visible target is a box, and the accessible
40 name is the sentence in Label. */}}
41 {{range .Data.Day.Slots}}
42 <a cal-slot href="{{.Href}}" style="top:{{.TopPct}}%;height:{{.HeightPct}}%">
43 <span class="rst-sr-only">{{.Label}}</span>
44 </a>
45 {{end}}
46
47 {{range .Data.Day.Placed}}
48 <div cal-placed="{{if .Short}}short{{end}}" style="top:{{.TopPct}}%;height:{{.HeightPct}}%;left:{{.LeftPct}}%;width:{{.WidthPct}}%">
49 {{template "chip" .Chip}}
50 </div>
51 {{end}}
52 </div>
53</div>
54
55{{if not .Data.Day.Placed}}{{if not .Data.Day.AllDay}}
56{{template "empty-state" dict
57 "Title" "Nothing on this day"
58 "Body" "Pick a time in the grid above, or use New event."}}
59{{end}}{{end}}
60</main>
61{{end}}
62{{define "content"}}{{end}}
63