bugs.html

 1{{define "content"}}
 2<section aria-labelledby="bugs-heading">
 3  <h2 id="bugs-heading">Bugs</h2>
 4
 5  <nav aria-label="Bug status filter">
 6    <ul>
 7      <li><a href="/{{.Repo.Name}}/bugs?status=all"{{if eq .Status "all"}} aria-current="page"{{end}}>All</a></li>
 8      <li><a href="/{{.Repo.Name}}/bugs?status=open"{{if eq .Status "open"}} aria-current="page"{{end}}>Open</a></li>
 9      <li><a href="/{{.Repo.Name}}/bugs?status=closed"{{if eq .Status "closed"}} aria-current="page"{{end}}>Closed</a></li>
10    </ul>
11  </nav>
12
13  {{if .Bugs}}
14  {{range .Bugs}}
15  <article aria-labelledby="bug-{{.ID}}">
16    <h3 id="bug-{{.ID}}">
17      <code><a href="/{{$.Repo.Name}}/bug/{{.FullID}}">{{.ID}}</a></code>
18      {{.Title}}
19      <span class="badge badge-{{.Status}}">{{.Status}}</span>
20    </h3>
21    <footer>
22      by <strong>{{.Author}}</strong> on
23      <time datetime="{{.CreatedAt | rfc3339}}">{{.CreatedAt | formatDate}}</time>
24      {{if gt .CommentCount 0}}
25      • {{.CommentCount}} Comments
26      {{end}}
27      {{if .HasActivity}}
28      • Last activity:
29      <time datetime="{{.LastActivity | rfc3339}}">{{.LastActivity | formatDate}}</time>
30      {{end}}
31    </footer>
32  </article>
33  {{end}}
34
35  {{if or .HasPrevPage .HasNextPage}}
36  <nav aria-label="Pagination">
37    <p>Page {{.Page}} of {{.TotalPages}}</p>
38    <ul>
39      {{if .HasPrevPage}}
40      <li>
41        <a href="/{{.Repo.Name}}/bugs?status={{.Status}}&page={{dec .Page}}" rel="prev"
42          >Previous page</a
43        >
44      </li>
45      {{end}}
46      {{if .HasNextPage}}
47      <li>
48        <a href="/{{.Repo.Name}}/bugs?status={{.Status}}&page={{inc .Page}}" rel="next"
49          >Next page</a
50        >
51      </li>
52      {{end}}
53    </ul>
54  </nav>
55  {{end}}
56  {{else}}
57  {{if eq .Status "all"}}
58  <p>git-bug is initialised, but this repo has no bugs.</p>
59  {{else if eq .Status "open"}}
60  <p>No open bugs.</p>
61  {{else if eq .Status "closed"}}
62  <p>No closed bugs.</p>
63  {{end}}
64  {{end}}
65</section>
66{{end}}