<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">
				<a class="flex-item-title" title="{{$run.Title}}" href="{{$run.Link}}">
					{{or $run.Title (ctx.Locale.Tr "actions.runs.empty_commit_message")}}
				</a>
				<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 -}}
				</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.PrettyRef}}">{{$run.PrettyRef}}</span>
				{{else}}
					<a class="ui label run-list-ref gt-ellipsis" href="{{$run.RefLink}}" data-tooltip-content="{{$run.PrettyRef}}">{{$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" .}}
