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>Booking pages</h1>
6 <p rst-page-header-sub>A link you hand to somebody outside the team, so they can book a slot when you are free.</p>
7 </div>
8 <a rst-btn="primary" href="/settings/booking/new">New page</a>
9</header>
10
11{{if .Data.Saved}}
12{{template "callout" dict "Tone" "positive" "Body" "Saved."}}
13{{end}}
14
15{{if not .Data.Handle}}
16{{/* Said before the list, because every link below starts with it. */}}
17{{template "callout" dict "Tone" "warning"
18 "Title" "Choose a handle first"
19 "Body" "Choose a handle in Settings before publishing — it is the first part of every booking link."}}
20{{end}}
21
22{{if not .Data.Pages}}
23{{template "empty-state" dict "Title" "No booking pages yet"
24 "Body" "Make one, describe when you are free in plain words, and publish it when you are ready to share the link."}}
25{{end}}
26
27{{range .Data.Pages}}
28<section rst-box cal-book-page>
29 <header rst-box-head>
30 <h2>{{.Title}}</h2>
31 {{if .Published}}{{template "badge" dict "Tone" "positive" "Label" "Published"}}{{else}}{{template "badge" dict "Label" "Not published"}}{{end}}
32 </header>
33 <div cal-book-page-body>
34 {{with .Description}}<p>{{.}}</p>{{end}}
35 <p><strong>{{duration .DurationMin}}</strong> a slot.
36 {{if .BufferMin}}{{duration .BufferMin}} between slots.{{end}}
37 {{if .NoticeMin}}At least {{duration .NoticeMin}} ahead.{{end}}
38 Up to {{.HorizonDays}} days out.</p>
39 {{if .Lines}}
40 <ul cal-book-lines>{{range .Lines}}<li>{{.}}</li>{{end}}</ul>
41 {{else}}
42 <p cal-book-caveat>No windows yet, so this page offers nothing.</p>
43 {{end}}
44 {{with .PublicURL}}
45 <p cal-book-url><a href="{{.}}">{{.}}</a></p>
46 {{end}}
47 <div cal-book-page-actions>
48 <a rst-btn href="/settings/booking/{{.ID}}">Edit</a>
49 <form method="post" action="/settings/booking/{{.ID}}/publish">
50 {{if .Published}}
51 <input type="hidden" name="publish" value="0">
52 <button rst-btn type="submit">Unpublish</button>
53 {{else}}
54 <input type="hidden" name="publish" value="1">
55 {{/* The sentence is above the button, in full, every time. A
56 published page is a new disclosure — anyone can ask when
57 this person is free — and the button must not be pressed
58 without having read that (booking spec §7.4). */}}
59 <p cal-book-caveat>Anyone with this link can see when you are free — not what you are doing, but when — including time blocked by team calendars you can see.</p>
60 <button rst-btn="primary" type="submit"{{if not $.Data.Handle}} disabled{{end}}>Publish</button>
61 {{end}}
62 </form>
63 </div>
64 </div>
65</section>
66{{end}}
67{{end}}
68