mirror of
https://github.com/go-gitea/gitea.git
synced 2024-12-21 13:42:36 +08:00
daaf0ad473
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>
30 lines
1.2 KiB
Handlebars
30 lines
1.2 KiB
Handlebars
<!-- This template should be kept the same as web_src/js/components/ActionRunStatus.vue
|
|
Please also update the vue file above if this template is modified.
|
|
action status accepted: success, skipped, waiting, blocked, running, failure, cancelled, unknown
|
|
-->
|
|
{{- $size := 16 -}}
|
|
{{- if .size -}}
|
|
{{- $size = .size -}}
|
|
{{- end -}}
|
|
|
|
{{- $className := "" -}}
|
|
{{- if .className -}}
|
|
{{- $className = .className -}}
|
|
{{- end -}}
|
|
|
|
<span class="gt-df gt-ac" data-tooltip-content="{{ctx.Locale.Tr (printf "actions.status.%s" .status)}}">
|
|
{{if eq .status "success"}}
|
|
{{svg "octicon-check-circle-fill" $size (printf "text green %s" $className)}}
|
|
{{else if eq .status "skipped"}}
|
|
{{svg "octicon-skip" $size (printf "text grey %s" $className)}}
|
|
{{else if eq .status "waiting"}}
|
|
{{svg "octicon-clock" $size (printf "text yellow %s" $className)}}
|
|
{{else if eq .status "blocked"}}
|
|
{{svg "octicon-blocked" $size (printf "text yellow %s" $className)}}
|
|
{{else if eq .status "running"}}
|
|
{{svg "octicon-meter" $size (printf "text yellow job-status-rotate %s" $className)}}
|
|
{{else if or (eq .status "failure") or (eq .status "cancelled") or (eq .status "unknown")}}
|
|
{{svg "octicon-x-circle-fill" $size (printf "text red %s" $className)}}
|
|
{{end}}
|
|
</span>
|