<div class="flex-divided-list items-with-main 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="item tw-items-center">
			<div class="item-leading">
				<span data-tooltip-content="{{ctx.Locale.Tr (printf "actions.status.%s" $run.Status.String)}}">
					{{template "repo/icons/action_status" (dict "Status" $run.Status.String "IconVariant" "circle-fill")}}
				</span>
			</div>
			<div class="item-main">
				<div class="item-title">
					{{$title := or $run.Title (ctx.Locale.Tr "actions.runs.empty_commit_message")}}
					{{ctx.RenderUtils.RenderCommitMessageLinkSubject $title $run.Link $.Repository}}
				</div>
				<div class="item-body">
					{{$workflowName := index $.WorkflowNames $run.WorkflowID}}
					<span><b>{{if not $.CurWorkflow}}{{if $workflowName}}{{$workflowName}}{{else}}{{$run.WorkflowID}}{{end}} {{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="run-list-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" .}}
