gitea/templates/repo/actions/runs_list.tmpl
Giteabot daaf0ad473
cleanup locale function usage (#27227) (#27240)
Backport #27227 by @denyskon

Throughout the Gitea codebase, you can meet some weird constructions to
make `locale.Tr` work in subtemplates.
Since we now have `ctx.Locale.Tr` which solves that problem, clean up
various templates which pass `locale` through `dict` or use some weird
constructions like `$.root.locale`

Going on, it would be great to replace every case of `$.locale.Tr` and
`.locale.Tr` with `ctx.Locale.Tr`, but that needs to be done with
patience.

Co-authored-by: Denys Konovalov <kontakt@denyskon.de>
2023-09-25 00:21:38 +00:00

44 lines
1.6 KiB
Handlebars

<div class="flex-list">
{{if eq (len .Runs) 0}}
<div class="empty center">
{{svg "octicon-no-entry" 48}}
<h2>{{if $.IsFiltered}}{{.locale.Tr "actions.runs.no_results"}}{{else}}{{.locale.Tr "actions.runs.no_runs"}}{{end}}</h2>
</div>
{{end}}
{{range .Runs}}
<div class="flex-item gt-ac">
<div class="flex-item-leading">
{{template "repo/actions/status" (dict "status" .Status.String)}}
</div>
<div class="flex-item-main">
<a class="flex-item-title" title="{{.Title}}" href="{{if .Link}}{{.Link}}{{else}}{{$.Link}}/{{.Index}}{{end}}">
{{- .Title -}}
</a>
<div class="flex-item-body">
<b>{{if not $.CurWorkflow}}{{.WorkflowID}} {{end}}#{{.Index}}</b>:
{{- if .ScheduleID -}}
{{$.locale.Tr "actions.runs.scheduled"}}
{{- else -}}
{{$.locale.Tr "actions.runs.commit"}}
<a href="{{$.RepoLink}}/commit/{{.CommitSHA}}">{{ShortSha .CommitSHA}}</a>
{{$.locale.Tr "actions.runs.pushed_by"}}
<a href="{{.TriggerUser.HomeLink}}">{{.TriggerUser.GetDisplayName}}</a>
{{- end -}}
</div>
</div>
<div class="flex-item-trailing">
{{if .RefLink}}
<a class="ui label gt-px-2 gt-mx-0" href="{{.RefLink}}">{{.PrettyRef}}</a>
{{else}}
<span class="ui label gt-px-2 gt-mx-0">{{.PrettyRef}}</span>
{{end}}
</div>
<div class="run-list-item-right">
<div class="run-list-meta">{{svg "octicon-calendar" 16}}{{TimeSinceUnix .Updated $.locale}}</div>
<div class="run-list-meta">{{svg "octicon-stopwatch" 16}}{{.Duration}}</div>
</div>
</div>
{{end}}
</div>
{{template "base/paginate" .}}