internal/web/templates/edit.html

545ba0bcdea3b534903bd78c918c0c025a97eda7
gitbay/internal/web/templates/edit.html

30 lines · 1424 bytes

 1{{define "width"}}wide{{end}}
 2{{define "title"}}edit {{.Path}} · {{.Repo.OwnerName}}/{{.Repo.Name}}{{end}}
 3{{define "content"}}
 4<div class="pagehead">
 5  <h1>Edit <code>{{.Path}}</code> <span class="refchip">{{.Ref}}</span></h1>
 6  <span class="grow"></span>
 7  <a class="button btn" href="/{{.Repo.OwnerName}}/{{.Repo.Name}}/blob/{{.Ref}}/{{.Path}}">Cancel</a>
 8</div>
 9<div class="blobgrid">
10{{template "filenav" .Nav}}
11<div class="blobmain">
12{{if .Error}}<p class="error" role="alert">{{.Error}}</p>{{end}}
13{{if .Blocked}}<p class="empty-note">{{.Blocked}}</p>{{else}}
14<section class="setcard">
15{{if .Creating}}<p class="meta"><code>{{.Path}}</code> does not exist on {{.Ref}}; committing creates it.</p>{{end}}
16{{if .Draft.Is "content"}}{{template "previewblock" .Draft.HTML}}{{end}}
17<form method="post" action="/{{.Repo.OwnerName}}/{{.Repo.Name}}/edit/{{.Ref}}/{{.Path}}" class="editform">
18  <p><textarea name="content" aria-label="File contents" rows="24" spellcheck="false">{{.Content}}</textarea></p>
19  <div class="commitbar">
20    <input name="message" aria-label="Commit message" placeholder="Commit message" value="{{.Draft.Or "content" "message" ""}}">
21    <button type="submit">Commit to {{.Ref}}</button>
22    {{if .Markup}}{{template "previewbtn"}}{{end}}
23  </div>
24  <p class="crumbs">this commit will be unsigned and authored as {{.Viewer}} · ⌘↵ to commit</p>
25</form>
26</section>
27{{end}}
28</div>
29</div>
30{{end}}