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 "content"}}
3<header rst-page-header>
4 <div rst-page-header-titles>
5 <h1>{{.Data.Event.Title}}</h1>
6 <p rst-page-header-sub>{{.Data.Event.CalendarName}}</p>
7 </div>
8 {{if .Data.Event.Writable}}
9 {{/* The occurrence rides through to the form, so "edit this one"
10 knows which one it is editing. */}}
11 <a rst-btn="primary"
12 href="/events/{{.Data.Event.ID}}/edit{{if .Data.Occurrence}}?occurrence={{.Data.Occurrence}}{{end}}">Edit</a>
13 {{end}}
14</header>
15
16{{if .Data.Booked}}
17{{/* Booked through a booking page. The sentence says how to move it,
18 because the form will refuse to (booking spec B18, §10). */}}
19{{template "callout" dict "Tone" "info"
20 "Title" (printf "Booked by %s" (or .Data.BookedBy "a visitor"))
21 "Body" (printf "To move this meeting, cancel it and let %s rebook." (or .Data.BookedBy "them"))}}
22{{end}}
23
24{{if eq .Data.Event.Status "cancelled"}}
25{{template "callout" dict "Tone" "warning" "Body" "This event is cancelled. It stays on the calendar, struck through, so nobody wonders whether it was ever there."}}
26{{end}}
27
28{{$items := list
29 (dict "Label" "When" "Value" .Data.When)}}
30{{template "detail-list" dict "Items" $items}}
31
32{{/* The authored zone is a whisper, never the headline: the time above
33 is always the reader's own. */}}
34{{if .Data.Chip.AuthoredZone}}
35<p cal-elsewhere>Written as {{.Data.Chip.AuthoredTime}} in {{.Data.Chip.AuthoredZone}}.</p>
36{{end}}
37
38{{with .Data.Event.Location}}<p><strong>Where:</strong> {{.}}</p>{{end}}
39{{with .Data.Event.Notes}}<p>{{.}}</p>{{end}}
40
41{{/* Attendees are RECORDED, never invited, and the heading says so
42 rather than leaving it to a footnote. Somebody who reads "Who's
43 coming" and assumes an invitation went out has been misled by this
44 page, not by their own carelessness. */}}
45{{with .Data.Attendees}}
46<p><strong>Who&rsquo;s coming:</strong>
47 {{range $i, $a := .}}{{if $i}}, {{end}}{{$a}}{{end}}
48</p>
49<p cal-quick-caveat>Nobody here was emailed. This is a note on the event; the
50 ICS export carries it so a calendar that does send invitations can.</p>
51{{end}}
52
53{{with .Data.RuleText}}
54<section rst-box>
55 <header rst-box-head><h2>Repeats</h2></header>
56 <div cal-box-body>
57 <p>{{.}}</p>
58 {{if $.Data.Event.RRuleForeign}}
59 {{template "callout" dict "Tone" "info" "Body" "This rule came from another calendar and is outside the set this app can edit. It is kept exactly as it arrived, and exported unchanged."}}
60 {{end}}
61 </div>
62</section>
63{{end}}
64
65<section rst-box>
66 <header rst-box-head><h2>Your reminders</h2></header>
67 <div cal-box-body>
68 {{/* Yours only. Whether a colleague wants a warning is a fact
69 about them, and not something this page should carry. */}}
70 {{if .Data.Reminders}}
71 {{range .Data.Reminders}}
72 <form cal-reminder method="post" action="/events/{{$.Data.Event.ID}}/reminders/remove">
73 <input type="hidden" name="reminder_id" value="{{.ID}}">
74 {{/* class, not an attribute: rst-grow is one of the seven
75 rastrillo utilities that keep the class spelling and have no
76 attribute twin. Written bare it silently does nothing. */}}
77 <span class="rst-grow">Email {{minutesLabel .OffsetMin}}</span>
78 <button rst-btn="ghost compact" type="submit">Remove</button>
79 </form>
80 {{end}}
81 {{else}}
82 <p>No reminder for this one.</p>
83 {{end}}
84
85 <form cal-reminder-add method="post" action="/events/{{.Data.Event.ID}}/reminders">
86 {{template "field-select" dict
87 "ID" "offset_min" "Name" "offset_min" "Label" "Remind me" "Short" true
88 "Options" (list
89 (dict "Value" "0" "Label" "At the time it starts")
90 (dict "Value" "5" "Label" "5 minutes before")
91 (dict "Value" "10" "Label" "10 minutes before" "Selected" true)
92 (dict "Value" "30" "Label" "30 minutes before")
93 (dict "Value" "60" "Label" "1 hour before")
94 (dict "Value" "1440" "Label" "1 day before"))}}
95 <button rst-btn type="submit">Add</button>
96 </form>
97 </div>
98</section>
99
100<div cal-bar>
101 <a rst-btn="ghost" href="/events/{{.Data.Event.ID}}.ics">Download as .ics</a>
102 {{if .Data.Event.Writable}}
103 {{/* The destructive action is a link to its own page, never a
104 modal: it works with no script, it can be linked to, and the
105 browser's back button is a working cancel. */}}
106 <a rst-btn="ghost" class="rst-danger"
107 href="/events/{{.Data.Event.ID}}/delete{{if .Data.Occurrence}}?occurrence={{.Data.Occurrence}}{{end}}">Delete</a>
108 {{end}}
109</div>
110{{end}}
111