diff options
Diffstat (limited to 'templates/repo')
-rw-r--r-- | templates/repo/actions/list.tmpl | 27 | ||||
-rw-r--r-- | templates/repo/actions/openclose.tmpl | 10 | ||||
-rw-r--r-- | templates/repo/actions/runs_list.tmpl | 25 | ||||
-rw-r--r-- | templates/repo/actions/status.tmpl | 12 | ||||
-rw-r--r-- | templates/repo/actions/view.tmpl | 8 | ||||
-rw-r--r-- | templates/repo/header.tmpl | 9 | ||||
-rw-r--r-- | templates/repo/settings/navbar.tmpl | 5 | ||||
-rw-r--r-- | templates/repo/settings/options.tmpl | 15 | ||||
-rw-r--r-- | templates/repo/settings/runner_edit.tmpl | 9 | ||||
-rw-r--r-- | templates/repo/settings/runners.tmpl | 9 |
10 files changed, 129 insertions, 0 deletions
diff --git a/templates/repo/actions/list.tmpl b/templates/repo/actions/list.tmpl new file mode 100644 index 0000000000..c5abff5251 --- /dev/null +++ b/templates/repo/actions/list.tmpl @@ -0,0 +1,27 @@ +{{template "base/head" .}} +<div class="page-content repository"> + {{template "repo/header" .}} + + <div class="ui container"> + <div class="ui grid"> + <div class="four wide column"> + <div class="ui fluid vertical menu"> + <a class="item{{if not $.CurWorkflow}} active{{end}}" href="{{$.Link}}">{{.locale.Tr "actions.runs.all_workflows"}}</a> + <div class="divider"></div> + {{range .workflows}} + <a class="item{{if eq .Name $.CurWorkflow}} active{{end}}" href="{{$.Link}}?workflow={{.Name}}">{{.Name}}</a> + {{end}} + </div> + </div> + <div class="twelve wide column content"> + <div id="issue-filters" class="ui stackable grid"> + <div class="six wide column"> + {{template "repo/actions/openclose" .}} + </div> + </div> + {{template "repo/actions/runs_list" .}} + </div> + </div> + </div> +</div> +{{template "base/footer" .}} diff --git a/templates/repo/actions/openclose.tmpl b/templates/repo/actions/openclose.tmpl new file mode 100644 index 0000000000..4190ddf75d --- /dev/null +++ b/templates/repo/actions/openclose.tmpl @@ -0,0 +1,10 @@ +<div class="ui compact tiny menu"> + <a class="{{if not .IsShowClosed}}active {{end}}item" href="{{$.Link}}?workflow={{.CurWorkflow}}&state=open"> + {{svg "octicon-issue-opened" 16 "mr-3"}} + {{.locale.Tr "actions.runs.open_tab" $.NumOpenActionRuns}} + </a> + <a class="{{if .IsShowClosed}}active {{end}}item" href="{{$.Link}}?workflow={{.CurWorkflow}}&state=closed"> + {{svg "octicon-issue-closed" 16 "mr-3"}} + {{.locale.Tr "actions.runs.closed_tab" $.NumClosedActionRuns}} + </a> +</div> diff --git a/templates/repo/actions/runs_list.tmpl b/templates/repo/actions/runs_list.tmpl new file mode 100644 index 0000000000..2e2e037de0 --- /dev/null +++ b/templates/repo/actions/runs_list.tmpl @@ -0,0 +1,25 @@ +<div class="issue list"> + {{range .Runs}} + <li class="item df py-3"> + <div class="issue-item-left df"> + {{template "repo/actions/status" .Status}} + </div> + <div class="issue-item-main f1 fc df"> + <div class="issue-item-top-row"> + <a class="index ml-0 mr-2" href="{{if .HTMLURL}}{{.HTMLURL}}{{else}}{{$.Link}}/{{.Index}}{{end}}"> + {{.Title}} <span class="ui label">{{RefShortName .Ref}}</span> + </a> + </div> + <div class="desc issue-item-bottom-row df ac fw my-1"> + <b>{{if not $.CurWorkflow}}{{.WorkflowID}} {{end}}#{{.Index}}</b>: {{$.locale.Tr "actions.runs.commit"}} + <a href="{{$.RepoLink}}/commit/{{.CommitSHA}}">{{ShortSha .CommitSHA}}</a> {{$.locale.Tr "actions.runs.pushed_by"}} {{.TriggerUser.GetDisplayName | Escape}} + </div> + </div> + <div class="issue-item-right"> + <div>{{TimeSinceUnix .Updated $.locale}}</div> + <div>{{.Duration}}</div> + </div> + </li> + {{end}} +</div> +{{template "base/paginate" .}} diff --git a/templates/repo/actions/status.tmpl b/templates/repo/actions/status.tmpl new file mode 100644 index 0000000000..fd8a683bda --- /dev/null +++ b/templates/repo/actions/status.tmpl @@ -0,0 +1,12 @@ +{{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> +{{end}} diff --git a/templates/repo/actions/view.tmpl b/templates/repo/actions/view.tmpl new file mode 100644 index 0000000000..0c04671153 --- /dev/null +++ b/templates/repo/actions/view.tmpl @@ -0,0 +1,8 @@ +{{template "base/head" .}} + +<div class="page-content repository"> + {{template "repo/header" .}} + <div id="repo-action-view" data-run-index="{{.RunIndex}}" data-job-index="{{.JobIndex}}" data-actions-url="{{.ActionsURL}}"></div> +</div> + +{{template "base/footer" .}} diff --git a/templates/repo/header.tmpl b/templates/repo/header.tmpl index 4da91e424d..29ae8d2840 100644 --- a/templates/repo/header.tmpl +++ b/templates/repo/header.tmpl @@ -183,6 +183,15 @@ </a> {{end}} + {{if and .EnableActions (not .UnitActionsGlobalDisabled) (.Permission.CanRead $.UnitTypeActions)}} + <a class="{{if .PageIsActions}}active {{end}}item" href="{{.RepoLink}}/actions"> + {{svg "octicon-play"}} {{.locale.Tr "actions.actions"}} + {{if .Repository.NumOpenActionRuns}} + <span class="ui primary small label">{{CountFmt .Repository.NumOpenActionRuns}}</span> + {{end}} + </a> + {{end}} + {{if .Permission.CanRead $.UnitTypePackages}} <a href="{{.RepoLink}}/packages" class="{{if .IsPackagesPage}}active {{end}}item"> {{svg "octicon-package"}} {{.locale.Tr "packages.title"}} diff --git a/templates/repo/settings/navbar.tmpl b/templates/repo/settings/navbar.tmpl index 236a82f348..2119f6b5a4 100644 --- a/templates/repo/settings/navbar.tmpl +++ b/templates/repo/settings/navbar.tmpl @@ -32,5 +32,10 @@ {{.locale.Tr "repo.settings.lfs"}} </a> {{end}} + {{if and .EnableActions (not .UnitActionsGlobalDisabled) (.Permission.CanRead $.UnitTypeActions)}} + <a class="{{if .PageIsSettingsRunners}}active {{end}}item" href="{{.RepoLink}}/settings/runners"> + {{.locale.Tr "actions.runners"}} + </a> + {{end}} </div> </div> diff --git a/templates/repo/settings/options.tmpl b/templates/repo/settings/options.tmpl index e1f53072b8..5b7b9ec5f8 100644 --- a/templates/repo/settings/options.tmpl +++ b/templates/repo/settings/options.tmpl @@ -433,6 +433,21 @@ </div> </div> + {{if .EnableActions}} + {{$isActionsEnabled := .Repository.UnitEnabled $.Context $.UnitTypeActions}} + <div class="inline field"> + <label>{{.locale.Tr "actions.actions"}}</label> + {{if .UnitTypeActions.UnitGlobalDisabled}} + <div class="ui checkbox tooltip disabled" data-content="{{.locale.Tr "repo.unit_disabled"}}"> + {{else}} + <div class="ui checkbox"> + {{end}} + <input class="enable-system" name="enable_actions" type="checkbox" {{if $isActionsEnabled}}checked{{end}}> + <label>{{.locale.Tr "repo.settings.actions_desc"}}</label> + </div> + </div> + {{end}} + {{if not .IsMirror}} <div class="ui divider"></div> {{$pullRequestEnabled := .Repository.UnitEnabled $.Context $.UnitTypePullRequests}} diff --git a/templates/repo/settings/runner_edit.tmpl b/templates/repo/settings/runner_edit.tmpl new file mode 100644 index 0000000000..10d410f096 --- /dev/null +++ b/templates/repo/settings/runner_edit.tmpl @@ -0,0 +1,9 @@ +{{template "base/head" .}} +<div class="page-content repository settings runners"> + {{template "repo/header" .}} + {{template "repo/settings/navbar" .}} + <div class="ui container"> + {{template "shared/actions/runner_edit" .}} + </div> +</div> +{{template "base/footer" .}} diff --git a/templates/repo/settings/runners.tmpl b/templates/repo/settings/runners.tmpl new file mode 100644 index 0000000000..d3a0b64fc5 --- /dev/null +++ b/templates/repo/settings/runners.tmpl @@ -0,0 +1,9 @@ +{{template "base/head" .}} +<div class="page-content repository settings runners"> + {{template "repo/header" .}} + {{template "repo/settings/navbar" .}} + <div class="ui container"> + {{template "shared/actions/runner_list" .}} + </div> +</div> +{{template "base/footer" .}} |