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    <p>
22      by <strong>{{.Author}}</strong> on
23      <time datetime="{{.CreatedAt | rfc3339}}">{{.CreatedAt | formatDate}}</time>
24      • Last activity:
25      <time datetime="{{.LastActivity | rfc3339}}">{{.LastActivity | formatDate}}</time>
26      {{if gt .CommentCount 0}}
27      • {{.CommentCount}} comment{{if ne .CommentCount 1}}s{{end}}
28      {{end}}
29    </p>
30  </article>
31  {{end}}
32
33  {{if or .HasPrevPage .HasNextPage}}
34  <nav aria-label="Pagination">
35    <p>Page {{.Page}} of {{.TotalPages}}</p>
36    <ul>
37      {{if .HasPrevPage}}
38      <li>
39        <a href="/{{.Repo.Name}}/bugs?status={{.Status}}&page={{dec .Page}}" rel="prev"
40          >Previous page</a
41        >
42      </li>
43      {{end}}
44      {{if .HasNextPage}}
45      <li>
46        <a href="/{{.Repo.Name}}/bugs?status={{.Status}}&page={{inc .Page}}" rel="next"
47          >Next page</a
48        >
49      </li>
50      {{end}}
51    </ul>
52  </nav>
53  {{end}}
54  {{else}}
55  {{if eq .Status "all"}}
56  <p>git-bug is initialised, but this repo has no bugs.</p>
57  {{else if eq .Status "open"}}
58  <p>No open bugs.</p>
59  {{else if eq .Status "closed"}}
60  <p>No closed bugs.</p>
61  {{end}}
62  {{end}}
63</section>
64{{end}}