1{{define "content"}}
2<nav aria-label="breadcrumb">
3 <ul>
4 <li><a href="/{{.Repo.Name}}">{{.Repo.Name}}</a></li>
5 <li><a href="/{{.Repo.Name}}/bugs">Bugs</a></li>
6 <li aria-current="page">{{.ID}}</li>
7 </ul>
8</nav>
9
10<section aria-labelledby="timeline-heading">
11 <h3 id="timeline-heading" class="visually-hidden">Timeline</h3>
12
13 {{range .Timeline}}
14 <article id="{{.ID}}" aria-labelledby="timeline-item-{{.ID}}">
15 {{if eq .Type "create"}}
16 <header>
17 <h4 id="timeline-item-{{.ID}}">{{$.Title}} <span class="badge badge-{{$.Status}}">{{$.Status}}</span></h4>
18 </header>
19 {{if .Message}}
20 {{.Message}}
21 {{else}}
22 <em class="muted">No description provided.</em>
23 {{end}}
24 <footer>
25 <strong>{{.Author}}</strong> opened this bug on
26 <time datetime="{{.Timestamp | rfc3339}}">{{.Timestamp | formatDate}}</time>
27 {{if $.Edited}}<em>(edited)</em>{{end}}
28 </footer>
29
30 {{else if eq .Type "comment"}}
31 {{if .Message}}
32 {{.Message}}
33 {{else}}
34 <em class="muted">No comment provided.</em>
35 {{end}}
36 <footer>
37 <strong>{{.Author}}</strong> commented on
38 <time datetime="{{.Timestamp | rfc3339}}">{{.Timestamp | formatDate}}</time>
39 {{if .Edited}}<em>(edited)</em>{{end}}
40 </footer>
41
42 {{else if eq .Type "title"}}
43 <strong>{{.Author}}</strong> changed the title to <strong>{{.Title}}</strong>.
44 <footer>
45 <time datetime="{{.Timestamp | rfc3339}}">{{.Timestamp | formatDate}}</time>
46 </footer>
47
48 {{else if eq .Type "status"}}
49 <strong>{{.Author}}</strong> {{.Status}} the bug.
50 <footer>
51 <time datetime="{{.Timestamp | rfc3339}}">{{.Timestamp | formatDate}}</time>
52 </footer>
53
54 {{else if eq .Type "labels"}}
55 <strong>{{.Author}}</strong>
56 {{if .AddedLabels}}
57 added label{{if gt (len .AddedLabels) 1}}s{{end}}
58 {{range $i, $label := .AddedLabels}}{{if $i}}, {{end}}<code>{{$label}}</code>{{end}}
59 {{end}}
60 {{if and .AddedLabels .RemovedLabels}}and{{end}}
61 {{if .RemovedLabels}}
62 removed label{{if gt (len .RemovedLabels) 1}}s{{end}}
63 {{range $i, $label := .RemovedLabels}}{{if $i}}, {{end}}<code>{{$label}}</code>{{end}}
64 {{end}}
65 <footer>
66 <time datetime="{{.Timestamp | rfc3339}}">{{.Timestamp | formatDate}}</time>
67 </footer>
68 {{end}}
69 </article>
70 {{end}}
71</section>
72{{end}}