internal/web/templates/account.html

a32f7f2001c1c0bf38ba8c3360e6bc7ca3982fee
gitbay/internal/web/templates/account.html history · blame · raw

149 lines · 8749 bytes

  1{{define "width"}}bounded{{end}}
  2{{define "title"}}account settings{{end}}
  3{{define "content"}}
  4<h1>Account settings</h1>
  5{{if .Notice}}<p class="error" role="alert">{{.Notice}}</p>{{end}}
  6{{if .Message}}<p class="notice" role="status">{{.Message}}</p>{{end}}
  7
  8<h2>Profile</h2>
  9<p class="meta">Shown on your profile page, <a href="/{{.Viewer}}">/{{.Viewer}}</a>.</p>
 10{{if .Draft.Is "about"}}{{template "previewblock" .Draft.HTML}}{{end}}
 11<form method="post" action="/settings" class="setform stack">
 12  <input type="hidden" name="field" value="profile">
 13  <label for="p-description">Description</label>
 14  <input type="text" id="p-description" name="description" value="{{.Draft.Or "about" "description" .Profile.Description}}" placeholder="one line, shown in listings">
 15  <label for="p-website">Website</label>
 16  <input type="text" id="p-website" name="website" value="{{.Draft.Or "about" "website" .Profile.Website}}" placeholder="https://example.org">
 17  <label for="p-links">Links</label>
 18  <textarea id="p-links" name="links" rows="3" placeholder="one per line: label|https://... or a bare https://... (at most 5)">{{.Draft.Or "about" "links" .LinksText}}</textarea>
 19  <label for="p-about">About</label>
 20  <textarea id="p-about" name="about" rows="8" placeholder="longer, shown below your repositories">{{.Draft.Or "about" "about" .Profile.About}}</textarea>
 21  {{template "formatpicker" (.Draft.Or "about" "format" .Profile.AboutFormat)}}
 22  <span class="btngroup"><button type="submit" class="btn">Save profile</button>{{template "previewbtn"}}</span>
 23</form>
 24
 25<h2>SSH keys</h2>
 26<p class="meta">Your keys are your identity here. A <code>full</code> key can run
 27commands and push; a <code>git</code> key can only move git data, which is what
 28a CI checkout wants.</p>
 29{{if .Keys}}<div class="tablewrap"><table class="keys">
 30<tr class="cols"><th scope="col">label</th><th scope="col">fingerprint</th><th scope="col">type</th><th scope="col">scope</th><th scope="col"></th></tr>
 31{{range .Keys}}<tr>
 32  <td>{{.Label}}</td>
 33  <td class="mono">{{.Fingerprint}}</td>
 34  <td>{{.Algo}}</td>
 35  <td>{{.Scope}}</td>
 36  <td class="act"><form method="post" action="/settings"><input type="hidden" name="field" value="key-remove"><input type="hidden" name="fingerprint" value="{{.Fingerprint}}">{{template "confirmfield" .Confirm}} <button type="submit" class="danger">Remove</button></form></td>
 37</tr>
 38{{end}}</table></div>
 39{{else}}<p class="none">No SSH keys — which cannot be right, since you signed in.</p>{{end}}
 40<details class="editbox">
 41  <summary>Add an SSH key</summary>
 42  <form method="post" action="/settings" class="setform stack">
 43    <input type="hidden" name="field" value="key-add">
 44    <label for="key">Public key</label>
 45    <textarea id="key" name="key" rows="3" required placeholder="ssh-ed25519 AAAA... you@machine"></textarea>
 46    <label for="key-label">Label</label>
 47    <input id="key-label" name="label" maxlength="64" placeholder="defaults to the key's comment">
 48    <label for="scope">Scope</label>
 49    <select id="scope" name="scope">
 50      <option value="full">full — commands and git</option>
 51      <option value="git">git — git transport only</option>
 52    </select>
 53    <button type="submit" class="btn">Add key</button>
 54  </form>
 55</details>
 56
 57<h2>Email addresses</h2>
 58<p class="meta">A verified address is what ties your signed commits to this
 59account, and where notifications go.</p>
 60{{if .Emails}}<ul class="plain">
 61{{range .Emails}}<li>{{.Address}}
 62  {{if .Primary}}<span class="chip">primary</span>{{end}}
 63  {{if .Verified}}<span class="badge badge-verified">verified{{with .VerifiedBy}} · {{.}}{{end}}</span>
 64  {{else}}<span class="badge badge-unsigned">unverified</span>{{end}}
 65  {{if not .Primary}}{{if .Verified}}<form method="post" action="/settings" class="inline"><input type="hidden" name="field" value="email-primary"><input type="hidden" name="address" value="{{.Address}}"><button type="submit" class="linklike">Make primary</button></form>{{end}}
 66  <form method="post" action="/settings" class="inline"><input type="hidden" name="field" value="email-remove"><input type="hidden" name="address" value="{{.Address}}">{{template "confirmfield" .Address}} <button type="submit" class="danger">Remove</button></form>{{end}}</li>
 67{{end}}</ul>{{end}}
 68<details class="editbox">
 69  <summary>Add an address</summary>
 70  <form method="post" action="/settings" class="setform">
 71    <input type="hidden" name="field" value="email-add">
 72    <label for="address">Address</label>
 73    <input type="email" id="address" name="address" required placeholder="you@example.org">
 74    <button type="submit" class="btn">Send code</button>
 75  </form>
 76  <form method="post" action="/settings" class="setform">
 77    <input type="hidden" name="field" value="email-verify">
 78    <label for="code">Verification code</label>
 79    <input type="text" id="code" name="code" required placeholder="from the mail">
 80    <button type="submit" class="btn">Verify</button>
 81  </form>
 82</details>
 83
 84<h2>OpenPGP keys</h2>
 85<p class="meta">Only needed if you sign commits with GPG. SSH signing
 86(<code>gpg.format = ssh</code>) uses the keys above.</p>
 87{{if .PGP}}<div class="tablewrap"><table class="keys">
 88<tr class="cols"><th scope="col">fingerprint</th><th scope="col">identities</th><th scope="col"></th></tr>
 89{{range .PGP}}<tr>
 90  <td class="mono">{{.Fingerprint}}</td>
 91  <td>{{range .UIDs}}{{.}}<br>{{end}}{{if .Revoked}}<span class="badge badge-bad_signature">revoked</span>{{else if .Expired}}<span class="badge badge-signed_key_expired">expired</span>{{end}}</td>
 92  <td class="act"><form method="post" action="/settings"><input type="hidden" name="field" value="pgp-remove"><input type="hidden" name="fingerprint" value="{{.Fingerprint}}">{{template "confirmfield" .Confirm}} <button type="submit" class="danger">Remove</button></form></td>
 93</tr>
 94{{end}}</table></div>
 95{{else}}<p class="none">No OpenPGP keys.</p>{{end}}
 96<details class="editbox">
 97  <summary>Add a PGP key</summary>
 98  <form method="post" action="/settings" class="setform stack">
 99    <input type="hidden" name="field" value="pgp-add">
100    <label for="pgpkey">Armored public key</label>
101    <textarea id="pgpkey" name="key" rows="6" required placeholder="-----BEGIN PGP PUBLIC KEY BLOCK-----"></textarea>
102    <button type="submit" class="btn">Add key</button>
103  </form>
104</details>
105
106<h2>Notifications</h2>
107<form method="post" action="/settings" class="setform">
108  <input type="hidden" name="field" value="notify-mail">
109  <label for="notify-mail">Activity by mail</label>
110  <input type="checkbox" id="notify-mail" name="mail" value="on"{{if .MailOn}} checked{{end}}>
111  <button type="submit" class="btn">Save</button>
112</form>
113<p class="meta">The inbox is filed either way; this is the mail half. Login links are not activity and still arrive.</p>
114<form method="post" action="/settings" class="setform">
115  <input type="hidden" name="field" value="notify-watch">
116  <label for="notify-watch">Watch repositories you can write to</label>
117  <input type="checkbox" id="notify-watch" name="watch" value="on"{{if .WatchOn}} checked{{end}}>
118  <button type="submit" class="btn">Save</button>
119</form>
120<p class="meta">Every issue and merge request on those repositories, as if you had watched each. A watch or mute on a repository still wins.</p>
121
122<h2>Appearance</h2>
123<form method="post" action="/settings" class="setform">
124  <input type="hidden" name="field" value="theme">
125  <label for="theme">Colour scheme</label>
126  <select id="theme" name="theme">
127    <option value="system"{{if eq .ThemeSetting "system"}} selected{{end}}>follow the browser</option>
128    <option value="light"{{if eq .ThemeSetting "light"}} selected{{end}}>light</option>
129    <option value="dark"{{if eq .ThemeSetting "dark"}} selected{{end}}>dark</option>
130  </select>
131  <button type="submit" class="btn">Save</button>
132</form>
133<p class="meta">The same setting as <code>gitbay web theme set</code>. Following the browser takes its light or dark preference.</p>
134
135<h2>Export</h2>
136<p class="meta">Your profile, repositories, issues and merge requests as one
137JSON bundle, the same one <code>gitbay account export</code> writes. Keys are
138never included; a replayed bundle's emails arrive unverified.</p>
139<p><a href="/settings/export">Download bundle</a></p>
140
141<h2>On the command line</h2>
142<p class="meta">No page here yet, and nothing refusing one: a credential is
143easier to pipe than to paste, and a minted token is shown once.</p>
144<pre class="message">gitbay auth token create --name laptop # API tokens
145gitbay web sessions list               # browser sessions
146gitbay admin ...                       # instance administration</pre>
147<p class="meta">All of it works from stock OpenSSH too:
148<code>ssh git@{{.Host}} auth whoami</code>.</p>
149{{end}}