~gitpocket/gitpocket

gitpocket/templates/reposettings.html -rw-r--r--5.3 KiB ViewLogBlameView rawPermalink 8482671831 — refactor(profile): pin from a repository settings checkbox and drop the profile list header a minute 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
{{define "content"}}
{{$p := .Data.Page}}
<h3>Repository settings</h3>
<form method="post" action="/{{$p.Repo.Path}}/settings" class="twocol">
<div>
<label>Description <input name="description" value="{{$p.Repo.Description}}" maxlength="200"></label>
<label>Tags <input name="tags" value="{{range $i, $t := $p.Repo.Tags}}{{if $i}}, {{end}}{{$t}}{{end}}" placeholder="Up to three comma-separated topics"></label>
<label class="check"><input type="checkbox" name="pinned"{{if .Data.Pinned}} checked{{end}}> Pin to profile</label>
<div class="actions"><button class="btn primary">Save ▸</button></div>
</div>
<div>
<span class="legend">Visibility</span>
<label class="radio"><input type="radio" name="visibility" value="public"{{if not (or $p.Repo.Private $p.Repo.Unlisted)}} checked{{end}}> Public<small>Shown on your profile and listed in the public index</small></label>
<label class="radio"><input type="radio" name="visibility" value="unlisted"{{if $p.Repo.Unlisted}} checked{{end}}> Unlisted<small>Visible to anyone who knows the URL, but not shown on your profile</small></label>
<label class="radio"><input type="radio" name="visibility" value="private"{{if $p.Repo.Private}} checked{{end}}> Private<small>Only visible to you</small></label>
</div>
</form>
<h3>Rename</h3>
<form method="post" action="/{{$p.Repo.Path}}/rename" class="stack">
<label>New name <input name="name" value="{{$p.Repo.Name}}" required pattern="[a-z0-9][a-z0-9_.-]{0,38}"></label>
<small>Old URLs stop working, forks and pull requests follow the repository.</small>
<div class="actions left"><button class="btn primary">Rename ▸</button></div>
</form>
<h3>Transfer</h3>
<form method="post" action="/{{$p.Repo.Path}}/transfer" class="stack">
<label>New owner <input name="owner" placeholder="~someone" required></label>
<label>Type <code>{{$p.Repo.Name}}</code> to confirm <input name="confirm" required></label>
<div class="actions left"><button class="btn danger">Transfer repository ▸</button></div>
</form>
<h3>Archive</h3>
<p>{{if $p.Repo.Archived}}This repository is archived, nobody can push, open pull requests or comment.{{else}}Archiving makes the repository read only. Nobody can push, open pull requests or comment until it is unarchived.{{end}}</p>
<form method="post" action="/{{$p.Repo.Path}}/archive"><button class="btn">{{if $p.Repo.Archived}}Unarchive ▸{{else}}Archive ▸{{end}}</button></form>
<h3 id="labels">Labels</h3>
{{if .Data.Labels}}<table class="keys">{{range .Data.Labels}}<tr><td><span class="label" style="background:{{.Colour}}">{{.Name}}</span></td><td><code>{{.Colour}}</code></td><td><form method="post" action="/{{$p.Repo.Path}}/labels"><input type="hidden" name="remove" value="{{.ID}}"><button class="btn danger">Remove</button></form></td></tr>{{end}}</table>{{end}}
<form method="post" action="/{{$p.Repo.Path}}/labels" class="stack">
<div class="pair"><label>Name <input name="name" required maxlength="40" placeholder="bug"></label><label>Colour <input name="colour" type="color" value="#0640e0"></label></div>
<div class="actions left"><button class="btn primary">Add label ▸</button></div>
</form>
<h3 id="protection">Branch protection</h3>
<p>A protected branch cannot be deleted or force pushed. Optionally require all changes to arrive through pull requests, and a number of approving reviews before one can be merged.</p>
{{if .Data.Protections}}<table class="keys">{{range .Data.Protections}}<tr><td><code>{{.Branch}}</code></td><td class="muted">{{if .RequirePR}}pull requests only{{else}}direct pushes allowed{{end}}{{if .Approvals}}, {{.Approvals}} approvals{{end}}</td><td><form method="post" action="/{{$p.Repo.Path}}/protection"><input type="hidden" name="remove" value="{{.Branch}}"><button class="btn danger">Remove</button></form></td></tr>{{end}}</table>{{end}}
<form method="post" action="/{{$p.Repo.Path}}/protection" class="stack">
<div class="pair"><label>Branch <input name="branch" required placeholder="main"></label><label>Approvals required <input name="approvals" type="number" min="0" max="10" value="0"></label></div>
<label class="check"><input type="checkbox" name="require_pr"> Only accept changes through pull requests</label>
<div class="actions left"><button class="btn primary">Protect ▸</button></div>
</form>
<h3>Collaborators</h3>
<p>Collaborators can push, read the repository if it is private, and merge pull requests. Only you can change settings or delete it.</p>
{{if .Data.Collaborators}}<table class="keys">{{range .Data.Collaborators}}<tr><td><a href="/~{{.Name}}">~{{.Name}}</a></td><td><form method="post" action="/{{$p.Repo.Path}}/collaborators"><input type="hidden" name="remove" value="{{.ID}}"><button class="btn danger">Remove</button></form></td></tr>{{end}}</table>{{end}}
<form method="post" action="/{{$p.Repo.Path}}/collaborators" class="stack">
<label>Username <input name="name" placeholder="~someone" required></label>
<div class="actions left"><button class="btn primary">Add collaborator ▸</button></div>
</form>
<h3>Delete repository</h3>
<form method="post" action="/{{$p.Repo.Path}}/delete" class="stack">
<p>This permanently removes the repository and its history from the server.</p>
<label>Type <code>{{$p.Repo.Name}}</code> to confirm <input name="confirm" required></label>
<div class="actions left"><button class="btn danger">Delete repository ▸</button></div>
</form>
{{end}}