internal/web/templates/issue.html

9b6ae6d86683b8e4918ba15c08b318a25eea1709
gitbay/internal/web/templates/issue.html history · blame · raw

34 lines · 2341 bytes

 1{{define "title"}}#{{.Issue.Number}} · {{.Repo.OwnerName}}/{{.Repo.Name}}{{end}}
 2{{define "content"}}
 3{{template "repoheader" .}}
 4<h2 class="issuetitle">{{.Issue.Title}} <span class="issuenumber">#{{.Issue.Number}}</span></h2>
 5<p class="issuemeta"><span class="chip {{if eq .Issue.State "open"}}chip-open{{else}}chip-done{{end}}">{{.Issue.State}}</span>
 6<a href="/{{.Issue.Author}}">{{.Issue.Author}}</a> opened this on {{when .Issue.CreatedAt}}
 7{{if .Issue.Labels}} · {{range .Issue.Labels}}<a class="chip label" style="{{index $.LabelColors .}}" href="/{{$.Repo.OwnerName}}/{{$.Repo.Name}}/issues?label={{.}}">{{.}}</a> {{end}}{{end}}
 8{{if .Issue.Assignees}} · assigned to {{range .Issue.Assignees}}{{.}} {{end}}{{end}}
 9{{if .Issue.Milestone}} · milestone <a href="/{{.Repo.OwnerName}}/{{.Repo.Name}}/milestones">{{.Issue.Milestone}}</a>{{end}}</p>
10{{if .CanEdit}}<details class="editbox"><summary>edit</summary>
11<form method="post" action="/{{.Repo.OwnerName}}/{{.Repo.Name}}/issues/{{.Issue.Number}}/edit" class="commentform">
12<p><input type="text" name="title" value="{{.Issue.Title}}" required></p>
13<p><textarea name="body" rows="8">{{.Issue.Body}}</textarea></p>
14<p><input type="text" name="labels" value="{{range $i, $l := .Issue.Labels}}{{if $i}} {{end}}{{$l}}{{end}}" placeholder="labels, space-separated (write access)"></p>
15<p><button type="submit">save</button></p>
16</form></details>{{end}}
17{{if .BodyHTML}}<article class="comment">
18  <header class="commenthead"><strong><a href="/{{.Issue.Author}}">{{.Issue.Author}}</a></strong> <span class="when">{{when .Issue.CreatedAt}}</span></header>
19  <div class="rendered">{{.BodyHTML}}</div>
20</article>{{end}}
21{{range .Comments}}
22{{if eq .Kind "system"}}<div class="syscomment">{{.BodyHTML}} <span class="when">{{when .CreatedAt}}</span></div>
23{{else}}<article class="comment">
24  <header class="commenthead"><strong><a href="/{{.Author}}">{{.Author}}</a></strong> <span class="when">{{when .CreatedAt}}</span></header>
25  <div class="rendered">{{.BodyHTML}}</div>
26</article>{{end}}
27{{end}}
28{{if .Viewer}}
29<form method="post" action="/{{.Repo.OwnerName}}/{{.Repo.Name}}/issues/{{.Issue.Number}}/comment" class="commentform">
30<p><textarea name="body" rows="4" placeholder="comment as {{.Viewer}}"></textarea></p>
31<p><button type="submit">comment</button></p>
32</form>
33{{end}}
34{{end}}