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.Calendar.Name}}</h1>
6 <p rst-page-header-sub>Subscription links</p>
7 </div>
8</header>
9
10{{if .Data.NewToken}}
11{{/* Shown once, and the page says so, because only the hash is
12 stored — coming back for it later is not possible and somebody
13 should learn that now rather than then. */}}
14{{template "callout" dict "Tone" "positive"
15 "Title" "Copy this now — it is not shown again"
16 "Body" (feedURL .Data.Origin .Data.NewToken)}}
17{{end}}
18
19{{/* Both costs, stated before the button rather than in a help page.
20 A subscription link is genuinely useful and genuinely has these
21 two consequences, and somebody deciding should see them. */}}
22{{template "callout" dict "Tone" "warning"
23 "Title" "What a subscription link does"
24 "Body" "Anyone with the link can read this calendar — there is no sign-in on it, because Google and Apple will not sign in. The events they read are then stored in that account, outside this instance. Subscribers also poll constantly (Apple, roughly every fifteen minutes, forever), and each poll wakes this instance."}}
25
26{{if .Data.Feeds}}
27<div rst-list>
28 {{range .Data.Feeds}}
29 <div rst-row>
30 <span rst-row-main>
31 Created {{.CreatedAt.Format "2 January 2006"}}
32 <small rst-row-sub>
33 Polled {{.PollCount}} times{{if .LastPolledAt}}, last {{.LastPolledAt.Format "2 Jan 15:04"}}{{else}} — never yet{{end}}
34 </small>
35 </span>
36 <form method="post" action="/calendars/{{$.Data.Calendar.ID}}/feeds/revoke">
37 <input type="hidden" name="feed_id" value="{{.ID}}">
38 <button rst-btn="ghost compact" class="rst-danger" type="submit">Revoke</button>
39 </form>
40 </div>
41 {{end}}
42</div>
43{{else}}
44{{template "empty-state" dict
45 "Title" "No subscription links"
46 "Body" "A link lets another calendar app read this one. Nothing is shared until you make one."}}
47{{end}}
48
49<form cal-feed-new method="post" action="/calendars/{{.Data.Calendar.ID}}/feeds">
50 <button rst-btn="primary" type="submit">Create a subscription link</button>
51</form>
52{{end}}
53