HTML · 5381 bytes Raw Blame History
1 {{ define "page" -}}
2 <section class="shithub-repo-new">
3 <header class="shithub-repo-new-head">
4 <h1>Create a new repository</h1>
5 <p>Repositories contain a project's files and version history.</p>
6 <p class="shithub-repo-new-required">Required fields are marked with an asterisk (*).</p>
7 </header>
8
9 {{ with .Error }}<p class="shithub-flash shithub-flash-error" role="alert">{{ . }}</p>{{ end }}
10
11 <form method="POST" action="/new" novalidate class="shithub-repo-new-form">
12 <input type="hidden" name="csrf_token" value="{{ .CSRFToken }}">
13
14 <div class="shithub-repo-new-step">
15 <div class="shithub-repo-new-step-marker" aria-hidden="true">1</div>
16 <section class="shithub-repo-new-step-body" aria-labelledby="repo-new-general">
17 <h2 id="repo-new-general">General</h2>
18 <div class="shithub-repo-new-owner-row">
19 <label class="shithub-repo-new-owner">
20 <span>Owner <em>*</em></span>
21 <select name="owner" required>
22 {{ range .Owners }}
23 <option value="{{ .Token }}"{{ if eq .Token $.Form.Owner }} selected{{ end }}>{{ .Display }}</option>
24 {{ end }}
25 </select>
26 </label>
27 <span class="shithub-repo-new-sep">/</span>
28 <label class="shithub-repo-new-name">
29 <span>Repository name <em>*</em></span>
30 <input type="text" name="name" required maxlength="100" autocomplete="off"
31 spellcheck="false" pattern="^[a-z0-9](?:[a-z0-9._-]{0,98}[a-z0-9_])?$"
32 value="{{ .Form.Name }}">
33 </label>
34 </div>
35 <p class="shithub-repo-new-hint">Great repository names are short and memorable. How about <strong>effective-enigma</strong>?</p>
36 <label class="shithub-repo-new-description">
37 <span>Description</span>
38 <input type="text" name="description" maxlength="350" value="{{ .Form.Description }}">
39 <small>{{ len .Form.Description }} / 350 characters</small>
40 </label>
41 </section>
42 </div>
43
44 <div class="shithub-repo-new-step">
45 <div class="shithub-repo-new-step-marker" aria-hidden="true">2</div>
46 <section class="shithub-repo-new-step-body" aria-labelledby="repo-new-config">
47 <h2 id="repo-new-config">Configuration</h2>
48 <div class="shithub-repo-new-config">
49 <label class="shithub-repo-new-config-row">
50 <span>
51 <strong>Choose visibility <em>*</em></strong>
52 <small>Choose who can see and commit to this repository</small>
53 </span>
54 <select name="visibility" required>
55 <option value="public"{{ if eq .Form.Visibility "public" }} selected{{ end }}>Public</option>
56 <option value="private"{{ if eq .Form.Visibility "private" }} selected{{ end }}>Private</option>
57 </select>
58 </label>
59 <div class="shithub-repo-new-config-row" aria-disabled="true">
60 <span>
61 <strong>Start with a template</strong>
62 <small>Templates pre-configure your repository with files.</small>
63 </span>
64 <button type="button" class="shithub-button shithub-button-small" disabled>No template</button>
65 </div>
66 <label class="shithub-repo-new-config-row">
67 <span>
68 <strong>Add README</strong>
69 <small>READMEs can be used as longer descriptions.</small>
70 </span>
71 <span class="shithub-repo-new-toggle">
72 <span>Off</span>
73 <input type="checkbox" name="init_readme" value="on"{{ if .Form.InitReadme }} checked{{ end }} aria-label="Add README">
74 </span>
75 </label>
76 <label class="shithub-repo-new-config-row">
77 <span>
78 <strong>Add .gitignore</strong>
79 <small>.gitignore tells git which files not to track.</small>
80 </span>
81 <select name="gitignore">
82 <option value="">No .gitignore</option>
83 {{ $picked := .Form.Gitignore }}
84 {{ range .Gitignores }}
85 <option value="{{ . }}"{{ if eq . $picked }} selected{{ end }}>{{ . }}</option>
86 {{ end }}
87 </select>
88 </label>
89 <label class="shithub-repo-new-config-row">
90 <span>
91 <strong>Add license</strong>
92 <small>Licenses explain how others can use your code.</small>
93 </span>
94 <select name="license">
95 <option value="">No license</option>
96 {{ $picked := .Form.License }}
97 {{ range .Licenses }}
98 <option value="{{ . }}"{{ if eq . $picked }} selected{{ end }}>{{ . }}</option>
99 {{ end }}
100 </select>
101 </label>
102 <label class="shithub-repo-new-config-row">
103 <span>
104 <strong>Import from source remote</strong>
105 <small>Fetch an existing public Git repository after creation.</small>
106 </span>
107 <input type="url" name="source_remote_url" placeholder="https://github.com/OWNER/REPO.git" value="{{ .Form.SourceRemote }}">
108 </label>
109 </div>
110 </section>
111 </div>
112
113 <button type="submit" class="shithub-button shithub-button-primary">Create repository</button>
114 </form>
115 </section>
116 {{- end }}