internal/web/templates/edit.html
16 lines · 1069 bytes
1{{define "width"}}wide{{end}}
2{{define "title"}}edit {{.Path}} · {{.Repo.OwnerName}}/{{.Repo.Name}}{{end}}
3{{define "content"}}
4<h1>edit {{.Repo.OwnerName}}/{{.Repo.Name}} : {{.Path}} @ {{.Ref}}</h1>
5{{if .Error}}<p class="error" role="alert">{{.Error}}</p>{{end}}
6{{if .Blocked}}<p class="empty-note">{{.Blocked}}</p>{{else}}
7{{if .Creating}}<p class="meta"><code>{{.Path}}</code> does not exist on {{.Ref}}; committing creates it.</p>{{end}}
8{{if .Draft.Is "content"}}{{template "previewblock" .Draft.HTML}}{{end}}
9<form method="post" action="/{{.Repo.OwnerName}}/{{.Repo.Name}}/edit/{{.Ref}}/{{.Path}}" class="editform">
10<p><textarea name="content" aria-label="File contents" rows="24" spellcheck="false">{{.Content}}</textarea></p>
11<p><input name="message" aria-label="Commit message" placeholder="commit message" value="{{.Draft.Or "content" "message" ""}}">
12<button type="submit">Commit to {{.Ref}}</button>{{if .Markup}} {{template "previewbtn"}}{{end}}</p>
13<p class="crumbs">this commit will be unsigned and authored as {{.Viewer}}</p>
14</form>
15{{end}}
16{{end}}