2
0

fix: sync audit.tmpl with server template functions

- Use DateUtils.FullTime instead of DateTime
- Use ctx.AvatarUtils.Avatar instead of avatar
- Use base/paginate template for pagination

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-18 17:34:46 -05:00
parent 9cfa9ebc82
commit ece0b1329d

View File

@@ -22,7 +22,7 @@
<tbody>
{{range .AuditEntries}}
<tr{{if not .Success}} class="negative"{{end}}>
<td>{{DateTime "full" .Timestamp}}</td>
<td>{{DateUtils.FullTime .Timestamp}}</td>
<td>
{{if eq .Action "read"}}
<span class="ui blue label">{{svg "octicon-eye" 12}} {{ctx.Locale.Tr "vault.action_read"}}</span>
@@ -51,7 +51,7 @@
</td>
<td>
{{if .UserName}}
{{avatar $.Context .User 20}}
{{ctx.AvatarUtils.Avatar .User 20}}
<a href="{{AppSubUrl}}/{{.UserName}}">{{.UserName}}</a>
{{else if .TokenID}}
{{svg "octicon-key-asterisk" 16}} {{ctx.Locale.Tr "vault.token_access"}}
@@ -72,25 +72,7 @@
</tbody>
</table>
{{if gt .TotalPages 1}}
<div class="center">
<div class="ui pagination menu">
{{if gt .Page 1}}
<a class="item" href="{{.RepoLink}}/vault/audit?page={{subtract .Page 1}}">
{{svg "octicon-chevron-left" 16}}
</a>
{{end}}
{{range .Pages}}
<a class="{{if eq . $.Page}}active {{end}}item" href="{{$.RepoLink}}/vault/audit?page={{.}}">{{.}}</a>
{{end}}
{{if lt .Page .TotalPages}}
<a class="item" href="{{.RepoLink}}/vault/audit?page={{add .Page 1}}">
{{svg "octicon-chevron-right" 16}}
</a>
{{end}}
</div>
</div>
{{end}}
{{template "base/paginate" .}}
{{else}}
<div class="ui placeholder segment">
<div class="ui icon header">