Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions templates/repo/actions/runs_list.tmpl
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<div class="issue list">
{{range .Runs}}
<li class="item gt-df gt-py-3 gt-ab">
<div class="issue-item-left gt-df">
{{template "repo/actions/status" .Status}}
<div class="issue-item-left gt-df gt-mr-2">
{{template "repo/actions/status" (dict "status" .Status.String)}}
</div>
<div class="issue-item-main action-item-main gt-f1 gt-fc gt-df gt-mr-3">
<div class="issue-item-top-row">
Expand Down
36 changes: 25 additions & 11 deletions templates/repo/actions/status.tmpl
Original file line number Diff line number Diff line change
@@ -1,12 +1,26 @@
{{if .IsWaiting}}
<i class="commit-status circle icon gray"></i>
{{end}}
{{if .IsRunning}}
<i class="commit-status circle icon yellow"></i>
{{end}}
{{if .IsSuccess}}
<i class="commit-status check icon green"></i>
{{end}}
{{if .IsFailure}}
<i class="commit-status warning icon red"></i>
<!-- 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.
-->
{{- $size := 16 -}}
{{- if .size -}}
{{- $size = .size -}}
{{- end -}}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Surprised that this works. It almost looks like code 😆.


{{- $className := "" -}}
{{- if .className -}}
{{- $className = .className -}}
{{- end -}}

{{if eq .status "success"}}
{{svg "octicon-check-circle-fill" $size (printf "ui text green %s" $className)}}
{{else if eq .status "skipped"}}
{{svg "octicon-skip" $size (printf "ui text grey %s" $className)}}
{{else if eq .status "waiting"}}
{{svg "octicon-clock" $size (printf "ui text yellow %s" $className)}}
{{else if eq .status "blocked"}}
{{svg "octicon-blocked" $size (printf "ui text yellow %s" $className)}}
{{else if eq .status "running"}}
{{svg "octicon-meter" $size (printf "ui text yellow job-status-rotate %s" $className)}}
{{else}}
{{svg "octicon-x-circle-fill" $size (printf "ui text red %s" $className)}}
{{end}}
3 changes: 3 additions & 0 deletions web_src/js/components/ActionRunStatus.vue
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
<!-- This vue should be kept the same as templates/repo/actions/status.tmpl
Please also update the template file above if this vue is modified.
-->
<template>
<SvgIcon name="octicon-check-circle-fill" class="ui text green" :size="size" :class-name="className" v-if="status === 'success'"/>
<SvgIcon name="octicon-skip" class="ui text grey" :size="size" :class-name="className" v-else-if="status === 'skipped'"/>
Expand Down