oficina / home Public

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

Plain git — no account needed to clone.

Download

Download this file

1{{define "title"}}Team · {{.Data.Name}} · Oficina{{end}}
2{{define "content"}}{{with .Data}}
3{{/* The Team page (team-members.md §2). A plain page under the bar: the
4 sky stays on the door, the team home's header and the front page.
5 Scriptless: every change is a plain form POST, each toggle a
6 <details>. Members see the list and no control at all. */}}
7<header rst-page-header>
8 <div rst-page-header-titles>
9 <h1>Team</h1>
10 <p rst-page-header-sub>{{.Name}}</p>
11 </div>
12 {{- if .CanAdd}}
13 <a rst-btn="primary" href="#add">Add person</a>
14 {{- end}}
15</header>
16{{if .Error}}<p role="alert" rst-callout rst-tone="negative"><span rst-callout-body>{{.Error}}</span></p>{{end}}
17<div rst-list home-team-members aria-label="People on this team">
18{{- range .Members}}
19<div rst-row>
20 <span rst-row-main><b><bdi>{{.Label}}</bdi></b>{{if .You}} <span rst-badge>You</span>{{end}}
21 <small rst-row-sub>{{.Role}}{{with .Added}} · added {{.}}{{end}}</small></span>
22 {{- if $.Data.Owner}}
23 <div home-team-actions>
24 {{- if .Owner}}{{if not .Sole}}
25 <form method="post" action="/team/role"><input type="hidden" name="team" value="{{$.Data.SQID}}"><input type="hidden" name="person" value="{{.Ref}}"><input type="hidden" name="role" value="member"><button type="submit" rst-btn="ghost sm">Make member</button></form>
26 {{- end}}{{else}}
27 <form method="post" action="/team/role"><input type="hidden" name="team" value="{{$.Data.SQID}}"><input type="hidden" name="person" value="{{.Ref}}"><input type="hidden" name="role" value="owner"><button type="submit" rst-btn="ghost sm">Make owner</button></form>
28 {{- end}}
29 <details home-team-more>
30 <summary rst-btn="ghost sm">Name</summary>
31 <form method="post" action="/team/name" rst-form>
32 <input type="hidden" name="team" value="{{$.Data.SQID}}"><input type="hidden" name="person" value="{{.Ref}}">
33 <div rst-field>
34 <label rst-field-label for="name-{{.Ref}}">Name</label>
35 <input id="name-{{.Ref}}" name="name" value="{{.Name}}" maxlength="64" autocomplete="off" rst-input aria-describedby="name-help-{{.Ref}}">
36 <p id="name-help-{{.Ref}}" rst-field-help>Everyone on this team sees this name. It can’t contain @. Leave it empty to show the role instead.</p>
37 </div>
38 <div rst-form-foot><button type="submit" rst-btn="primary sm">Save name</button></div>
39 </form>
40 </details>
41 {{- if not .Sole}}
42 <details home-team-more>
43 <summary rst-btn="ghost sm">Remove</summary>
44 <form method="post" action="/team/remove" rst-form>
45 <input type="hidden" name="team" value="{{$.Data.SQID}}"><input type="hidden" name="person" value="{{.Ref}}">
46 {{- if $.Data.Seeded}}
47 <p>They lose this team in every app within a minute, except Equipo and Base, which keep their own list of people. Remove them there too.</p>
48 {{- else}}
49 <p>They lose this team in every app within a minute.</p>
50 {{- end}}
51 <div rst-form-foot><button type="submit" rst-btn="danger sm">Remove from team</button></div>
52 </form>
53 </details>
54 {{- end}}
55 </div>
56 {{- end}}
57</div>
58{{- end}}
59</div>
60{{if .Seeded}}<p home-dashboard-note>Changes reach every app in this team within a minute, except Equipo and Base: change who is on those in Equipo and Base themselves.</p>
61{{else}}<p home-dashboard-note>Changes reach every app in this team within a minute.</p>
62{{end}}
63{{if .Owner}}{{if .CanAdd}}
64<section id="add" home-team-add aria-labelledby="add-heading">
65<h2 id="add-heading">Add someone</h2>
66<form method="post" action="/team/add" rst-form>
67 <input type="hidden" name="team" value="{{.SQID}}">
68 <fieldset rst-field>
69 <legend rst-field-label>Role</legend>
70 <label><input type="radio" name="role" value="member"{{if ne .AddRole "owner"}} checked{{end}}> Member</label>
71 <label><input type="radio" name="role" value="owner"{{if eq .AddRole "owner"}} checked{{end}}> Owner: can change who is on this team</label>
72 </fieldset>
73 <div rst-field>
74 <label rst-field-label for="add-name">Name (optional)</label>
75 <input id="add-name" name="name" value="{{.AddName}}" maxlength="64" autocomplete="off" rst-input aria-describedby="add-name-help"{{if .FieldError}} aria-invalid="true"{{end}}>
76 <p id="add-name-help" rst-field-help>Everyone on this team sees this name. It can’t contain @.</p>
77 </div>
78 <p>Next you enter their email address on id.oficina.works, where Oficina keeps sign-in. Oficina doesn’t email them: let them know, and they sign in at oficina.works.</p>
79 <div rst-form-foot><button type="submit" rst-btn="primary">Continue</button></div>
80</form>
81</section>
82{{end}}{{else}}
83<p>Only owners can change who is on this team.</p>
84{{end}}
85<p home-dashboard-note>Paul Campbell runs this Oficina and can see everything this team keeps in it.</p>
86{{end}}{{end}}
87