internal/web/templates/edit.html
32 lines · 1867 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 .RequireMR}}<p class="notice" role="status">Branch <code>{{.Ref}}</code> accepts changes through merge requests only. Committing below creates a new branch and opens a merge request.</p>{{end}}
16{{if .Creating}}<p class="meta"><code>{{.Path}}</code> does not exist on {{.Ref}}; committing creates it.</p>{{end}}
17{{if .Draft.Is "content"}}{{template "previewblock" .Draft.HTML}}{{end}}
18<form method="post" action="/{{.Repo.OwnerName}}/{{.Repo.Name}}/edit/{{.Ref}}/{{.Path}}" class="editform">
19 <p><textarea name="content" aria-label="File contents" rows="24" spellcheck="false">{{.Content}}</textarea></p>
20 <div class="commitbar">
21 <input name="message" aria-label="Commit message" placeholder="Commit message" value="{{.Draft.Or "content" "message" ""}}">
22 <input name="target_branch" class="branch-target-inp" aria-label="Target branch" placeholder="Branch (blank commits to {{.Ref}})" value="{{.ProposeBranch}}"{{if .RequireMR}} required{{end}}>
23 <button type="submit">{{if .RequireMR}}Propose merge request{{else}}Commit changes{{end}}</button>
24 {{if .Markup}}{{template "previewbtn"}}{{end}}
25 </div>
26 <p class="crumbs">this commit will be unsigned and authored as {{.Viewer}} · ⌘↵ to commit</p>
27</form>
28</section>
29{{end}}
30</div>
31</div>
32{{end}}