Skip to content

Commit

Permalink
Bugfix: honor base path in table_pkgs
Browse files Browse the repository at this point in the history
  • Loading branch information
bsiegert committed Mar 10, 2024
1 parent 85dd6db commit 1a15336
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
7 changes: 4 additions & 3 deletions templates/table_pkgs.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{{range .}}
{{$bp := .BasePath}}
{{range .Rows}}
<tr>
<td>
<a href="/pkg/{{.ResultID}}">{{.Category}}{{.Dir}}</a>
<a href="{{$bp}}pkg/{{.ResultID}}">{{.Category}}{{.Dir}}</a>
</td>
<td>
<a href="/pkg/{{.ResultID}}">{{.PkgName}}</a>
<a href="{{$bp}}pkg/{{.ResultID}}">{{.PkgName}}</a>
</td>
{{if eq .BuildStatus 0}}
<td class="success text-success">ok</td>
Expand Down
8 changes: 7 additions & 1 deletion templates/templates.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,13 @@ func TableBuilds(w io.Writer, b *ddao.Build) {
}

func TablePkgs[T any](w io.Writer, rows []T) {
t.ExecuteTemplate(w, "table_pkgs.html", rows)
s := struct {
Rows []T
bp
}{
Rows: rows,
}
t.ExecuteTemplate(w, "table_pkgs.html", s)
}

func BulkBuildInfo(w io.Writer, b *bulk.Build) {
Expand Down

0 comments on commit 1a15336

Please sign in to comment.