| @@ -2,53 +2,99 @@ |
| 2 | {{define "title"}}new repository · {{.Site}}{{end}} |
2 | {{define "title"}}new repository · {{.Site}}{{end}} |
| 3 | {{define "content"}} |
3 | {{define "content"}} |
| 4 | <h1>New</h1> |
4 | <h1>New</h1> |
| 5 | <h2>Repository</h2> |
| |
| 6 | {{if .Error}}<p class="error" role="alert">{{.Error}}</p>{{end}} |
5 | {{if .Error}}<p class="error" role="alert">{{.Error}}</p>{{end}} |
| 7 | <form method="post" action="/new"> |
| |
| 8 | <p><label>Owner <select name="owner"> |
| |
| 9 | <option value="{{.Viewer}}">{{.Viewer}}</option> |
| |
| 10 | {{range .Orgs}}<option value="{{.}}">{{.}}</option>{{end}} |
| |
| 11 | </select></label> |
| |
| 12 | <label>/ Name <input name="name" required maxlength="63" pattern="[a-z0-9][a-z0-9._\-]{0,62}" aria-describedby="namehint" autocomplete="off" spellcheck="false"></label> |
| |
| 13 | <span class="hint" id="namehint">Lowercase letters, digits, dot, dash and underscore; must start with a letter or digit; up to 63 characters.</span></p> |
| |
| 14 | <fieldset class="segmented"> |
| |
| 15 | <legend>Visibility</legend> |
| |
| 16 | <div class="options"> |
| |
| 17 | <label><input type="radio" name="visibility" value="public" checked><span>Public</span></label> |
| |
| 18 | <label><input type="radio" name="visibility" value="private"><span>Private</span></label> |
| |
| 19 | </div> |
| |
| 20 | </fieldset> |
| |
| 21 | <p><button type="submit">Create repository</button></p> |
| |
| 22 | </form> |
| |
| 23 | |
6 | |
| 24 | <h2 id="import">Import</h2> |
7 | <nav class="tabs newtabs" aria-label="Create" data-panel-tabs="new-panels"> |
| 25 | <p class="meta">Copies a repository from another host, over http or https. A private source needs an access token; it is sent to the remote for this one fetch and not stored.</p> |
8 | <a href="#create" aria-current="page" data-panel="create">Repository</a> |
| 26 | <form method="post" action="/new" autocomplete="off"> |
9 | <a href="#import" data-panel="import">Import</a> |
| 27 | <input type="hidden" name="field" value="import"> |
10 | <a href="#org" data-panel="org">Organization</a> |
| 28 | <p><label>Owner <select name="owner"> |
11 | </nav> |
| 29 | {{$o := index .Submitted "owner"}}<option value="{{.Viewer}}">{{.Viewer}}</option> |
| |
| 30 | {{range .Orgs}}<option value="{{.}}"{{if eq . $o}} selected{{end}}>{{.}}</option>{{end}} |
| |
| 31 | </select></label> |
| |
| 32 | <label>/ Name <input name="name" value="{{index .Submitted "name"}}" required maxlength="63" pattern="[a-z0-9][a-z0-9._\-]{0,62}" autocomplete="off" spellcheck="false"></label></p> |
| |
| 33 | <p><label>From <input type="text" name="from" value="{{index .Submitted "from"}}" required placeholder="https://github.com/owner/repo.git" spellcheck="false" size="48"></label></p> |
| |
| 34 | <p><label>Access token <input type="password" name="token" autocomplete="new-password"></label> <span class="hint">Optional.</span></p> |
| |
| 35 | <fieldset class="segmented"> |
| |
| 36 | <legend>Visibility</legend> |
| |
| 37 | <div class="options"> |
| |
| 38 | <label><input type="radio" name="visibility" value="public"{{if ne (index .Submitted "visibility") "private"}} checked{{end}}><span>Public</span></label> |
| |
| 39 | <label><input type="radio" name="visibility" value="private"{{if eq (index .Submitted "visibility") "private"}} checked{{end}}><span>Private</span></label> |
| |
| 40 | </div> |
| |
| 41 | </fieldset> |
| |
| 42 | <p><button type="submit">Import repository</button></p> |
| |
| 43 | </form> |
| |
| 44 | |
12 | |
| 45 | <h2 id="org">Organization</h2> |
13 | <div id="new-panels"> |
| 46 | <p class="meta">An organization owns repositories, labels and milestones, and |
14 | <section id="create" class="setcard" data-panel-id="create"> |
| 47 | grants access through teams. You are its first admin.</p> |
15 | <h2>Create a repository</h2> |
| 48 | <form method="post" action="/new"> |
16 | <p class="meta">Start a fresh repository under your account or an organization you administer.</p> |
| 49 | <input type="hidden" name="field" value="org-create"> |
17 | <form method="post" action="/new"> |
| 50 | <p><label>Name <input name="name" required maxlength="63" pattern="[a-z0-9][a-z0-9._\-]{0,62}" aria-describedby="orghint" autocomplete="off" spellcheck="false"></label> |
18 | <div class="field"> |
| 51 | <span class="hint" id="orghint">The same rules as a repository name, and it becomes a top-level path.</span></p> |
19 | <div class="ownername"> |
| 52 | <p><button type="submit">Create organization</button></p> |
20 | <div class="ownerpick"> |
| 53 | </form> |
21 | <label for="new-owner">Owner</label> |
| |
22 | <select id="new-owner" name="owner"> |
| |
23 | <option value="{{.Viewer}}">{{.Viewer}}</option> |
| |
24 | {{range .Orgs}}<option value="{{.}}">{{.}}</option>{{end}} |
| |
25 | </select> |
| |
26 | </div> |
| |
27 | <span class="slash" aria-hidden="true">/</span> |
| |
28 | <div class="namepick"> |
| |
29 | <label for="new-name">Repository name</label> |
| |
30 | <input id="new-name" name="name" required maxlength="63" pattern="[a-z0-9][a-z0-9._\-]{0,62}" aria-describedby="namehint" autocomplete="off" spellcheck="false" placeholder="my-project"> |
| |
31 | </div> |
| |
32 | </div> |
| |
33 | <span class="hint" id="namehint">Lowercase letters, digits, dot, dash and underscore; must start with a letter or digit; up to 63 characters.</span> |
| |
34 | </div> |
| |
35 | <fieldset class="segmented"> |
| |
36 | <legend>Visibility</legend> |
| |
37 | <div class="options"> |
| |
38 | <label><input type="radio" name="visibility" value="public" checked><span>Public</span></label> |
| |
39 | <label><input type="radio" name="visibility" value="private"><span>Private</span></label> |
| |
40 | </div> |
| |
41 | </fieldset> |
| |
42 | <p><button type="submit">Create repository</button></p> |
| |
43 | </form> |
| |
44 | </section> |
| |
45 | |
| |
46 | <section id="import" class="setcard" data-panel-id="import"> |
| |
47 | <h2>Import a repository</h2> |
| |
48 | <p class="meta">Copies a repository from another host over HTTP or HTTPS. A private source needs an access token; it is used for this fetch only and never stored.</p> |
| |
49 | <form method="post" action="/new" autocomplete="off"> |
| |
50 | <input type="hidden" name="field" value="import"> |
| |
51 | <div class="field"> |
| |
52 | <label for="imp-from">Source URL</label> |
| |
53 | <input type="text" id="imp-from" name="from" value="{{index .Submitted "from"}}" required placeholder="https://github.com/owner/repo.git" spellcheck="false" data-infer-name="imp-name"> |
| |
54 | </div> |
| |
55 | <div class="field"> |
| |
56 | <div class="ownername"> |
| |
57 | <div class="ownerpick"> |
| |
58 | <label for="imp-owner">Owner</label> |
| |
59 | <select id="imp-owner" name="owner"> |
| |
60 | {{$o := index .Submitted "owner"}}<option value="{{.Viewer}}">{{.Viewer}}</option> |
| |
61 | {{range .Orgs}}<option value="{{.}}"{{if eq . $o}} selected{{end}}>{{.}}</option>{{end}} |
| |
62 | </select> |
| |
63 | </div> |
| |
64 | <span class="slash" aria-hidden="true">/</span> |
| |
65 | <div class="namepick"> |
| |
66 | <label for="imp-name">Repository name</label> |
| |
67 | <input id="imp-name" name="name" value="{{index .Submitted "name"}}" required maxlength="63" pattern="[a-z0-9][a-z0-9._\-]{0,62}" autocomplete="off" spellcheck="false" placeholder="auto-filled from URL"> |
| |
68 | </div> |
| |
69 | </div> |
| |
70 | </div> |
| |
71 | <div class="field"> |
| |
72 | <label for="imp-token">Access token</label> |
| |
73 | <input type="password" id="imp-token" name="token" autocomplete="new-password" placeholder="Optional — only for private sources"> |
| |
74 | </div> |
| |
75 | <fieldset class="segmented"> |
| |
76 | <legend>Visibility</legend> |
| |
77 | <div class="options"> |
| |
78 | <label><input type="radio" name="visibility" value="public"{{if ne (index .Submitted "visibility") "private"}} checked{{end}}><span>Public</span></label> |
| |
79 | <label><input type="radio" name="visibility" value="private"{{if eq (index .Submitted "visibility") "private"}} checked{{end}}><span>Private</span></label> |
| |
80 | </div> |
| |
81 | </fieldset> |
| |
82 | <p><button type="submit">Import repository</button></p> |
| |
83 | </form> |
| |
84 | </section> |
| |
85 | |
| |
86 | <section id="org" class="setcard" data-panel-id="org"> |
| |
87 | <h2>Create an organization</h2> |
| |
88 | <p class="meta">An organization owns repositories, shared labels and milestones, and grants access through teams. You start as its admin.</p> |
| |
89 | <form method="post" action="/new"> |
| |
90 | <input type="hidden" name="field" value="org-create"> |
| |
91 | <div class="field"> |
| |
92 | <label for="org-name">Organization name</label> |
| |
93 | <input id="org-name" name="name" required maxlength="63" pattern="[a-z0-9][a-z0-9._\-]{0,62}" aria-describedby="orghint" autocomplete="off" spellcheck="false" placeholder="acme-labs"> |
| |
94 | <span class="hint" id="orghint">Same naming rules as a repository; becomes a top-level path.</span> |
| |
95 | </div> |
| |
96 | <p><button type="submit">Create organization</button></p> |
| |
97 | </form> |
| |
98 | </section> |
| |
99 | </div> |
| 54 | {{end}} |
100 | {{end}} |