summaryrefslogtreecommitdiffstats
path: root/templates/repo/actions/list.tmpl
blob: 263530f9a79135ae26f98e3535d548fa8d105bc7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
{{template "base/head" .}}
<div class="page-content repository actions">
	{{template "repo/header" .}}
	<div class="ui container">
		{{template "base/alert" .}}

		{{if .HasWorkflowsOrRuns}}
		<div class="ui stackable grid">
			<div class="four wide column">
				<div class="ui fluid vertical menu">
					<a class="item{{if not $.CurWorkflow}} active{{end}}" href="?actor={{$.CurActor}}&status={{$.CurStatus}}">{{ctx.Locale.Tr "actions.runs.all_workflows"}}</a>
					{{range .workflows}}
						<a class="item{{if eq .Entry.Name $.CurWorkflow}} active{{end}}" href="?workflow={{.Entry.Name}}&actor={{$.CurActor}}&status={{$.CurStatus}}">{{.Entry.Name}}
							{{if .ErrMsg}}
								<span data-tooltip-content="{{.ErrMsg}}">
									{{svg "octicon-alert" 16 "text red"}}
								</span>
							{{end}}

							{{if $.ActionsConfig.IsWorkflowDisabled .Entry.Name}}
								<div class="ui red label">{{ctx.Locale.Tr "disabled"}}</div>
							{{end}}
						</a>
					{{end}}
				</div>
			</div>
			<div class="twelve wide column content">
				<div class="ui secondary filter menu tw-justify-end tw-flex tw-items-center">
					<!-- Actor -->
					<div class="ui{{if not .Actors}} disabled{{end}} dropdown jump item">
						<span class="text">{{ctx.Locale.Tr "actions.runs.actor"}}</span>
						{{svg "octicon-triangle-down" 14 "dropdown icon"}}
						<div class="menu">
							<div class="ui icon search input">
								<i class="icon">{{svg "octicon-search"}}</i>
								<input type="text" placeholder="{{ctx.Locale.Tr "actions.runs.actor"}}">
							</div>
							<a class="item{{if not $.CurActor}} active{{end}}" href="?workflow={{$.CurWorkflow}}&status={{$.CurStatus}}&actor=0">
								{{ctx.Locale.Tr "actions.runs.actors_no_select"}}
							</a>
							{{range .Actors}}
								<a class="item{{if eq .ID $.CurActor}} active{{end}}" href="?workflow={{$.CurWorkflow}}&actor={{.ID}}&status={{$.CurStatus}}">
									{{ctx.AvatarUtils.Avatar . 20}} {{.GetDisplayName}}
								</a>
							{{end}}
						</div>
					</div>
					<!-- Status -->
					<div class="ui dropdown jump item">
						<span class="text">{{ctx.Locale.Tr "actions.runs.status"}}</span>
						{{svg "octicon-triangle-down" 14 "dropdown icon"}}
						<div class="menu">
							<div class="ui icon search input">
								<i class="icon">{{svg "octicon-search"}}</i>
								<input type="text" placeholder="{{ctx.Locale.Tr "actions.runs.status"}}">
							</div>
							<a class="item{{if not $.CurStatus}} active{{end}}" href="?workflow={{$.CurWorkflow}}&actor={{$.CurActor}}&status=0">
								{{ctx.Locale.Tr "actions.runs.status_no_select"}}
							</a>
							{{range .StatusInfoList}}
								<a class="item{{if eq .Status $.CurStatus}} active{{end}}" href="?workflow={{$.CurWorkflow}}&actor={{$.CurActor}}&status={{.Status}}">
									{{.DisplayedStatus}}
								</a>
							{{end}}
						</div>
					</div>

					{{if .AllowDisableOrEnableWorkflow}}
						<button class="ui jump dropdown btn interact-bg tw-p-2">
							{{svg "octicon-kebab-horizontal"}}
							<div class="menu">
								<a class="item link-action" data-url="{{$.Link}}/{{if .CurWorkflowDisabled}}enable{{else}}disable{{end}}?workflow={{$.CurWorkflow}}&actor={{.CurActor}}&status={{$.CurStatus}}">
									{{if .CurWorkflowDisabled}}{{ctx.Locale.Tr "actions.workflow.enable"}}{{else}}{{ctx.Locale.Tr "actions.workflow.disable"}}{{end}}
								</a>
							</div>
						</button>
					{{end}}
				</div>

				{{if $.CurWorkflowDispatch}}
					{{template "repo/actions/dispatch" .}}
				{{end}}

				{{template "repo/actions/runs_list" .}}
			</div>
		</div>
		{{else}}
			{{template "repo/actions/no_workflows" .}}
		{{end}}
	</div>
</div>
{{template "base/footer" .}}