<div class="flex-list run-list">
	{{if not .Runs}}
	<div class="empty-placeholder">
		{{svg "octicon-no-entry" 48}}
		<h2>{{if $.IsFiltered}}{{ctx.Locale.Tr "actions.runs.no_results"}}{{else}}{{ctx.Locale.Tr "actions.runs.no_runs"}}{{end}}</h2>
	</div>
	{{end}}
	{{range $run := .Runs}}
		<div class="flex-item tw-items-center">
			<div class="flex-item-leading">
				{{template "repo/actions/status" (dict "status" $run.Status.String)}}
			</div>
			<div class="flex-item-main">
				<span class="flex-item-title" title="{{$run.Title}}">
					{{if $run.Title}}
						{{ctx.RenderUtils.RenderCommitMessageLinkSubject $run.Title $run.Link $.Repository}}
					{{else}}
						<a href="{{$run.Link}}">{{ctx.Locale.Tr "actions.runs.empty_commit_message"}}</a>
					{{end}}
				</span>
				<div class="flex-item-body">
					<span><b>{{if not $.CurWorkflow}}{{$run.WorkflowID}} {{end}}#{{$run.Index}}</b>:</span>

					{{- if $run.ScheduleID -}}
						{{ctx.Locale.Tr "actions.runs.scheduled"}}
					{{- else -}}
						{{ctx.Locale.Tr "actions.runs.commit"}}
						<a href="{{$.RepoLink}}/commit/{{$run.CommitSHA}}">{{ShortSha $run.CommitSHA}}</a>
						{{ctx.Locale.Tr "actions.runs.pushed_by"}}
						<a href="{{$run.TriggerUser.HomeLink}}">{{$run.TriggerUser.GetDisplayName}}</a>
					{{- end -}}

					{{$errMsg := index $.RunErrors $run.ID}}
					{{if $errMsg}}
						<span class="flex-text-inline" data-tooltip-content="{{$errMsg}}">
							{{svg "octicon-alert" 16 "tw-text-red"}}
						</span>
					{{end}}
				</div>
			</div>
			<div class="flex-item-trailing">
				{{if $run.IsRefDeleted}}
					<span class="ui label run-list-ref gt-ellipsis tw-line-through" data-tooltip-content="{{$run.RefTooltip}}">{{$run.PrettyRef}}</span>
				{{else}}
					<a class="ui label run-list-ref gt-ellipsis" href="{{$run.RefLink}}" data-tooltip-content="{{$run.RefTooltip}}">{{$run.PrettyRef}}</a>
				{{end}}
				<div class="run-list-item-right">
					<div class="run-list-meta">{{svg "octicon-calendar" 16}}{{DateUtils.TimeSince $run.Updated}}</div>
					<div class="run-list-meta">{{svg "octicon-stopwatch" 16}}{{$run.Duration}}</div>
				</div>
				<div class="ui dropdown jump tw-p-2">
					{{svg "octicon-kebab-horizontal"}}
					<div class="menu flex-items-menu">
						<a class="item" href="{{$run.Link}}/workflow">{{svg "octicon-play"}}{{ctx.Locale.Tr "actions.runs.view_workflow_file"}}</a>
						{{if and $.CanWriteRepoUnitActions (not $run.Status.IsDone)}}
							<a class="item link-action" data-url="{{$run.Link}}/cancel">
								{{svg "octicon-x"}}{{ctx.Locale.Tr "actions.runs.cancel"}}
							</a>
						{{end}}
						{{if and $.CanWriteRepoUnitActions $run.Status.IsDone}}
							<a class="item link-action"
								data-url="{{$run.Link}}/delete"
								data-modal-confirm="{{ctx.Locale.Tr "actions.runs.delete.description"}}"
							>
								{{svg "octicon-trash"}}{{ctx.Locale.Tr "actions.runs.delete"}}
							</a>
						{{end}}
					</div>
				</div>
			</div>
		</div>
	{{end}}
</div>
{{template "base/paginate" .}}
