internal/web/templates/mr.html

075af6c002f84e2edcbd793668a23239fbe18636
gitbay/internal/web/templates/mr.html history · blame · raw

34 lines · 2496 bytes

 1{{define "title"}}!{{.MR.Number}} · {{.Repo.OwnerName}}/{{.Repo.Name}}{{end}}
 2{{define "content"}}
 3{{template "repoheader" .}}
 4<h2 class="issuetitle">{{.MR.Title}} <span class="issuenumber">!{{.MR.Number}}</span></h2>
 5<p class="issuemeta"><span class="chip chip-{{.MR.State}}">{{.MR.State}}</span>
 6{{.MR.Author}} wants to merge {{if .MR.SourcePath}}{{.MR.SourcePath}}:{{end}}{{.MR.SourceRef}} into {{.MR.TargetRef}}
 7 at <code>{{short .MR.HeadSHA}}</code></p>
 8{{if .BodyHTML}}<article class="comment">
 9  <header class="commenthead"><strong>{{.MR.Author}}</strong></header>
10  <div class="rendered">{{.BodyHTML}}</div>
11</article>{{end}}
12{{if .Checks}}<div class="checks">
13<p>checks: <span class="badge check-{{.Combined}}">{{.Combined}}</span>
14{{range .Checks}} · {{if .TargetURL}}<a href="{{.TargetURL}}" rel="nofollow">{{.Context}}</a>{{else}}{{.Context}}{{end}} <span class="check-{{.State}}">{{.State}}</span>{{end}}</p>
15</div>{{end}}
16{{range .Reviews}}<p class="review">review: <strong>{{.Reviewer}}</strong> — {{.Verdict}}{{if .Stale}} <span class="chip chip-stale">stale</span>{{end}}</p>{{end}}
17{{range .Comments}}
18<article class="comment">
19  <header class="commenthead"><strong>{{.Author}}</strong> <span class="when">{{when .CreatedAt}}</span></header>
20  <div class="rendered">{{.BodyHTML}}</div>
21</article>
22{{end}}
23{{if .Viewer}}
24<form method="post" action="/{{.Repo.OwnerName}}/{{.Repo.Name}}/mrs/{{.MR.Number}}/comment" class="commentform">
25<p><textarea name="body" rows="4" placeholder="comment as {{.Viewer}}"></textarea></p>
26<p><button type="submit">comment</button></p>
27</form>
28{{end}}
29<h3>diff</h3>
30<pre class="diff">{{range .DiffLines}}<span class="{{.Class}}">{{.Text}}</span>
31{{range .Threads}}</pre><div class="thread{{if .Resolved}} resolved{{end}}">{{if .Resolved}}<p class="threadstate">resolved by {{.Resolved}}</p>{{end}}{{range .Comments}}<p class="commenthead"><strong>{{.Author}}</strong> <span class="when">{{when .CreatedAt}}</span></p><div class="rendered">{{.BodyHTML}}</div>{{end}}</div><pre class="diff">{{end}}{{end}}</pre>
32{{if .DetachedThreads}}<h3>threads on earlier revisions</h3>
33{{range .DetachedThreads}}<div class="thread stale"><p class="threadstate">{{if .Stale}}stale{{end}}{{if .Resolved}}{{if .Stale}} · {{end}}resolved by {{.Resolved}}{{end}}</p>{{range .Comments}}<p class="commenthead"><strong>{{.Author}}</strong> <span class="when">{{when .CreatedAt}}</span></p><div class="rendered">{{.BodyHTML}}</div>{{end}}</div>{{end}}{{end}}
34{{end}}