diff options
Diffstat (limited to 'templates/issue.html')
| -rw-r--r-- | templates/issue.html | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/templates/issue.html b/templates/issue.html new file mode 100644 index 0000000..e5135a0 --- /dev/null +++ b/templates/issue.html @@ -0,0 +1,62 @@ +{{define "title"}}{{.Data.Issue.Title}} - {{.Data.Path}} - {{.Site}}{{end}} +{{define "main"}} +{{$issue := .Data.Issue}} +<h2>{{$issue.Title}} <span class="dim">#{{$issue.ID}}</span></h2> +<p> +<span class="state-{{$issue.State}}">{{$issue.State}}</span> +<span class="dim">opened by</span> {{template "who" $issue.Author}} +<span class="dim">on {{$issue.Created.Format "2006-01-02 15:04"}} UTC</span> +{{range $issue.Labels}}<span class="label">{{.}}</span>{{end}} +</p> + +{{if .Data.Triage}} +<div class="bar"> +<form method="post" action="/{{.Data.Path}}/issues/{{$issue.ID}}/state"> +<input type="hidden" name="csrf" value="{{.CSRF}}"> +<button type="submit">{{if eq $issue.State "open"}}close this issue{{else}}reopen this issue{{end}}</button> +</form> +{{with .Data.Labels}} +<form method="post" action="/{{$.Data.Path}}/issues/{{$issue.ID}}/labels"> +<input type="hidden" name="csrf" value="{{$.CSRF}}"> +{{range .}} +<label class="inline" for="label-{{.Name}}"> +<input id="label-{{.Name}}" type="checkbox" name="label" value="{{.Name}}" {{if .On}}checked{{end}}> +{{.Name}} +</label> +{{end}} +<button type="submit">set labels</button> +</form> +{{end}} +</div> +{{end}} + +<div class="comment"> +<div class="byline">{{template "who" $issue.Author}} <span class="dim">opened this</span></div> +<article>{{.Data.Rendered}}</article> +</div> + +{{range .Data.Comments}} +<div class="comment"> +<div class="byline"> +{{template "who" .Comment.Author}} +<span class="dim">commented on {{.Comment.Created.Format "2006-01-02 15:04"}} UTC</span> +</div> +<article>{{.Rendered}}</article> +</div> +{{end}} + +{{if .Data.Can}} +<h3>Comment</h3> +<form method="post" action="/{{.Data.Path}}/issues/{{$issue.ID}}/comment"> +<input type="hidden" name="csrf" value="{{.CSRF}}"> +<p> +<label for="body"> +Markdown: **bold**, `code`, a list, or four spaces for a code block. Raw HTML +is not rendered. +</label> +<textarea id="body" name="body" rows="8" required></textarea> +</p> +<p><button type="submit">Comment</button></p> +</form> +{{end}} +{{end}} |