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=open"{{if eq .Status "open"}} aria-current="page"{{end}}>Open</a></li>
 8      <li><a href="/{{.Repo.Name}}/bugs?status=closed"{{if eq .Status "closed"}} aria-current="page"{{end}}>Closed</a></li>
 9      <li><a href="/{{.Repo.Name}}/bugs?status=all"{{if eq .Status "all"}} aria-current="page"{{end}}>All</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      {{if eq $.Status "all"}}
18      {{if eq .Status "open"}}
19      <svg class="bug-status-icon bug-status-icon-open" aria-label="Open bug" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="none" stroke-width="2">
20        <circle cx="8" cy="8" r="6" />
21      </svg>
22      {{else if eq .Status "closed"}}
23      <svg class="bug-status-icon bug-status-icon-closed" aria-label="Closed bug" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="none" stroke-width="2">
24        <circle cx="8" cy="8" r="6" />
25        <path d="M5 8 l2 2 l4 -4" stroke-linecap="round" stroke-linejoin="round" />
26      </svg>
27      {{end}}
28      {{end}}
29      <code><a href="/{{$.Repo.Name}}/bug/{{.FullID}}">{{.ID}}</a></code>
30      {{.Title}}
31    </h3>
32    <footer>
33      by <strong>{{.Author}}</strong> on
34      <time datetime="{{.CreatedAt | rfc3339}}">{{.CreatedAt | formatDate}}</time>
35      {{if gt .CommentCount 0}}
36      • {{.CommentCount}} Comments
37      {{end}}
38      {{if .HasActivity}}
39      • Last activity:
40      <time datetime="{{.LastActivity | rfc3339}}">{{.LastActivity | formatDate}}</time>
41      {{end}}
42    </footer>
43  </article>
44  {{end}}
45
46  {{if or .HasPrevPage .HasNextPage}}
47  <nav aria-label="Pagination">
48    <p>Page {{.Page}} of {{.TotalPages}}</p>
49    <ul>
50      {{if .HasPrevPage}}
51      <li>
52        <a href="/{{.Repo.Name}}/bugs?status={{.Status}}&page={{dec .Page}}" rel="prev"
53          >Previous page</a
54        >
55      </li>
56      {{end}}
57      {{if .HasNextPage}}
58      <li>
59        <a href="/{{.Repo.Name}}/bugs?status={{.Status}}&page={{inc .Page}}" rel="next"
60          >Next page</a
61        >
62      </li>
63      {{end}}
64    </ul>
65  </nav>
66  {{end}}
67  {{else}}
68  {{if eq .Status "all"}}
69  <p>git-bug is initialised, but this repo has no bugs.</p>
70  {{else if eq .Status "open"}}
71  <p>No open bugs.</p>
72  {{else if eq .Status "closed"}}
73  <p>No closed bugs.</p>
74  {{end}}
75  {{end}}
76</section>
77{{end}}