~gitpocket/gitpocket

8
e0cad84176f3a107a44ea141a76ab87d56afcacf
mainfeed-discovery
gitpocket/web/templates/settings.tmpl -rw-r--r--6.5 KiB ViewLogBlameView rawPermalink e0cad84176 feat(pages): publish the pages branch of private repositories 9 hours ago
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
{{define "content"}}
{{$p := .Data.Profile}}
<h3 class="rule">Edit your profile</h3>
<p class="muted small">Disk usage {{size .Data.Used}}{{if .Data.Quota}} of {{size .Data.Quota}}{{end}}.</p>
<form method="post" action="/settings/avatar" enctype="multipart/form-data" class="avatarform" id="avatarform">
<div class="avatarbox"><img class="avatar" src="/~{{.User.Name}}/avatar?v={{$p.Avatar}}" alt=""></div>
<div>
<label>Choose an avatar <input type="file" name="avatar" accept="image/png,image/jpeg,image/gif,image/webp" required></label>
<small>If the image is not square you can pick the crop below. It is resized to 256×256 and stored as PNG.</small>
<div class="cropper" hidden><canvas></canvas><input type="range" min="10" max="100" value="100"><small>Drag to move the square, scroll or slide to resize.</small></div>
<input type="hidden" name="x"><input type="hidden" name="y"><input type="hidden" name="size">
<div class="actions left"><button class="btn">Upload avatar ▸</button>{{if $p.Avatar}}<button class="btn danger" formaction="/settings/avatar/delete" formnovalidate>Remove</button>{{end}}</div>
</div>
</form>
<script src="/static/crop.js?v={{$.Version}}" defer></script>
<h3 class="rule">Email</h3>
<form method="post" action="/settings/email" class="stack wide">
<label>Email address{{if .Data.Account.Email}}{{if .Data.Account.Verified}} <span class="muted">(verified)</span>{{else}} <span class="muted">(not verified yet)</span>{{end}}{{end}} <input name="email" type="email" value="{{.Data.Account.Email}}" placeholder="[email protected]"></label>
<small>Used for password resets and notifications about your repositories and pull requests. Never shown publicly.{{if not .Data.Mail}} Mail is not configured on this server yet, so verification cannot be sent.{{end}}</small>
{{if .Data.Sent}}<p class="notice">Verification mail sent, open the link in it to confirm.</p>{{end}}
<div class="actions left"><button class="btn primary">{{if .Data.Account.Verified}}Change email ▸{{else}}Save and send verification ▸{{end}}</button></div>
</form>
<form method="post" action="/settings/notify" class="stack wide">
<label class="check"><input type="checkbox" name="notify"{{if .Data.Account.Notify}} checked{{end}}> Email me about pull requests, reviews and issues on my repositories</label>
<div class="actions left"><button class="btn">Save ▸</button></div>
</form>
<h3 class="rule" id="username">Username</h3>
<form method="post" action="/settings/username" class="stack wide">
<div class="pair">
<label>New username <input name="name" value="{{.User.Name}}" required maxlength="39" pattern="[a-z0-9._\-]+" autocapitalize="none" spellcheck="false"></label>
<label>Current password <input name="password" type="password" required autocomplete="current-password"></label>
</div>
<small>Links to ~{{.User.Name}} and its repositories, including clone URLs, keep redirecting to the new name until someone else registers ~{{.User.Name}}. Update your git remotes when you can.</small>
<div class="actions left"><button class="btn">Change username ▸</button></div>
</form>
<h3 class="rule">Profile</h3>
<form method="post" action="/settings/profile" class="stack wide">
<div class="pair">
<label>Name <input name="display" value="{{$p.Display}}" maxlength="100" placeholder="Shown on your profile"></label>
</div>
<div class="pair">
<label>Location <input name="location" value="{{$p.Location}}" maxlength="100"></label>
<label>Workplace <input name="workplace" value="{{$p.Workplace}}" maxlength="100"></label>
</div>
<fieldset class="links"><legend>URLs</legend>{{range $i, $l := $p.LinkSlots}}<input name="website" value="{{$l}}" maxlength="200" placeholder="https://" aria-label="Link">{{end}}</fieldset>
<label>Bio <textarea name="bio" rows="6" maxlength="4000" placeholder="Markdown supported, paste or drop images to attach them" data-md>{{$p.Bio}}</textarea></label>
<div class="actions"><button class="btn primary">Save changes ▸</button></div>
</form>
<h3 class="rule" id="pages">Pages</h3>
{{with .Data.Domain}}{{$d := .}}
<p class="muted small">A repository called <code>pages</code> is published as your site, from its <code>pages</code> branch when it has one. A private repository publishes only its <code>pages</code> branch, so that branch is public while the rest stays private.{{with .Subdomain}} It lives at <a href="https://{{.}}/">{{.}}</a>.{{end}}{{if not .Enabled}} Sites go live once an account is a day old and while an admin has not turned them off.{{end}}</p>
{{with .Domain}}
<p>Custom domain <code>{{.Name}}</code> {{if .Verified}}<span class="muted">(verified, serving your site)</span>{{else}}<span class="muted">(waiting for DNS)</span>{{end}}</p>
{{if not .Verified}}<table class="keys">
<tr><td><code>TXT</code></td><td><code>{{.Record}}</code></td><td><code>{{.Token}}</code></td></tr>
{{if $d.Subdomain}}<tr><td><code>CNAME</code></td><td><code>{{.Name}}</code></td><td><code>{{$d.Subdomain}}</code> <span class="muted small">for a subdomain</span></td></tr>{{end}}
{{$name := .Name}}{{range $d.Addresses}}<tr><td><code>{{index . 0}}</code></td><td><code>{{$name}}</code></td><td><code>{{index . 1}}</code></td></tr>{{end}}
</table>
<p class="muted small">Add the TXT record, then point the domain at this server with either the CNAME or the address records, unproxied. HTTPS is issued automatically a few minutes after verification.</p>{{end}}
<form method="post" action="/settings/pages" class="inline">{{if not .Verified}}<button class="btn primary" name="action" value="verify">Verify ▸</button>{{end}}<button class="btn danger" name="action" value="remove">Remove domain</button></form>
{{else}}
<form method="post" action="/settings/pages" class="stack wide">
<input type="hidden" name="action" value="claim">
<label>Custom domain <input name="domain" placeholder="blog.example.org" autocapitalize="none" spellcheck="false"></label>
<div class="actions left"><button class="btn">Use this domain ▸</button></div>
</form>
{{end}}{{end}}
<h3 class="rule" id="blocked">Blocked accounts</h3>
<p class="muted small">Blocked accounts cannot open issues or pull requests, comment, star or fork your repositories, or follow you.</p>
{{if .Data.Blocked}}<table class="keys">{{range .Data.Blocked}}<tr><td><a href="/~{{.Name}}">~{{.Name}}</a></td><td><form method="post" action="/block" class="inline"><input type="hidden" name="name" value="{{.Name}}"><input type="hidden" name="back" value="settings"><button class="btn small" name="action" value="unblock">Unblock</button></form></td></tr>{{end}}</table>{{else}}<p class="muted">Nobody.</p>{{end}}
{{end}}