~gitpocket/gitpocket

8
d2d81efd76ee70d09c0fafa721f6ca10b9618ac0
mainfeed-discovery
gitpocket/web/templates/gistform.tmpl -rw-r--r--1.8 KiB ViewLogBlameView rawPermalink d2d81efd76 fix(gists): lay out the visibility radios like the repository form 6 hours ago
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
{{define "content"}}
{{$d := .Data}}
<h3>{{if $d.Gist}}Edit gist{{else}}New gist{{end}}</h3>
<p class="muted">{{if $d.Gist}}Each save becomes a new revision. Clear a file's contents to remove it.{{else}}A gist is a small git repository of flat files. Empty files are dropped and a file without a name becomes <code>gistfile1.txt</code>.{{end}}</p>
<form method="post" action="{{$d.Action}}" class="stack wide gistform">
{{with $d.Head}}<input type="hidden" name="head" value="{{.}}">{{end}}
<label>Description <input name="description" maxlength="300" placeholder="What is this gist about" value="{{$d.Description}}"></label>
{{range $d.Files}}<div class="gistedit">
<input type="hidden" name="orig" value="{{.Orig}}">
<input name="name" maxlength="100" placeholder="Filename including extension" value="{{.Name}}" aria-label="Filename">
<textarea name="content" rows="14" spellcheck="false" aria-label="Contents">{{.Content}}</textarea>
</div>{{end}}
{{with $d.Keep}}<p class="muted small">Kept unchanged because they are binary or too large to edit here: {{range $i, $e := .}}{{if $i}}, {{end}}<code>{{$e.Name}}</code>{{end}}.</p>{{end}}
<div>
<span class="legend">Visibility</span>
<label class="radio"><input type="radio" name="visibility" value="public"{{if not $d.Secret}} checked{{end}}> Public<small>Listed on your profile and in the gist index</small></label>
<label class="radio"><input type="radio" name="visibility" value="secret"{{if $d.Secret}} checked{{end}}> Secret<small>Unlisted, anyone with the link can read it</small></label>
</div>
<div class="actions"><button class="btn" name="action" value="add" formnovalidate>Add file</button><button class="btn primary" name="action" value="save">{{if $d.Gist}}Save revision{{else}}Create gist{{end}} ▸</button></div>
</form>
{{end}}