aboutsummaryrefslogtreecommitdiffstats
path: root/templates/repo/actions
diff options
context:
space:
mode:
authora1012112796 <1012112796@qq.com>2023-08-14 23:14:30 +0800
committerGitHub <noreply@github.com>2023-08-14 15:14:30 +0000
commit19872063a3c14256a1d89b2a104d63e7538a3a28 (patch)
treedcdfb5ffa923fb0f66d5e0b4b94f890be3e9fdf5 /templates/repo/actions
parent253737eb364192e31c8be1fc9bd9581331ca37a9 (diff)
downloadgitea-19872063a3c14256a1d89b2a104d63e7538a3a28.tar.gz
gitea-19872063a3c14256a1d89b2a104d63e7538a3a28.zip
add disable workflow feature (#26413)
As title, that's simmilar with github. ![image](https://github.com/go-gitea/gitea/assets/25342410/9e8b2444-63e0-4e87-80da-730c1e4d09d6) ![image](https://github.com/go-gitea/gitea/assets/25342410/6c3a3345-3ba7-48c9-9acd-3e621632491b) --------- Signed-off-by: a1012112796 <1012112796@qq.com> Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: Jason Song <i@wolfogre.com>
Diffstat (limited to 'templates/repo/actions')
-rw-r--r--templates/repo/actions/list.tmpl19
1 files changed, 18 insertions, 1 deletions
diff --git a/templates/repo/actions/list.tmpl b/templates/repo/actions/list.tmpl
index e73cf71f6b..9d256820ae 100644
--- a/templates/repo/actions/list.tmpl
+++ b/templates/repo/actions/list.tmpl
@@ -2,6 +2,8 @@
<div class="page-content repository actions">
{{template "repo/header" .}}
<div class="ui container">
+ {{template "base/alert" .}}
+
<div class="ui stackable grid">
<div class="four wide column">
<div class="ui fluid vertical menu">
@@ -13,12 +15,16 @@
{{svg "octicon-alert" 16 "text red"}}
</span>
{{end}}
+
+ {{if $.ActionsConfig.IsWorkflowDisabled .Entry.Name}}
+ <div class="ui red label">{{$.locale.Tr "disabled"}}</div>
+ {{end}}
</a>
{{end}}
</div>
</div>
<div class="twelve wide column content">
- <div class="ui secondary filter stackable menu gt-je">
+ <div class="ui secondary filter menu gt-je gt-df gt-ac">
<!-- Actor -->
<div class="ui{{if not .Actors}} disabled{{end}} dropdown jump item">
<span class="text">{{.locale.Tr "actions.runs.actor"}}</span>
@@ -57,6 +63,17 @@
{{end}}
</div>
</div>
+
+ {{if .AllowDisableOrEnableWorkflow}}
+ <button class="ui jump dropdown btn interact-bg gt-p-3">
+ {{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}}{{.locale.Tr "actions.workflow.enable"}}{{else}}{{.locale.Tr "actions.workflow.disable"}}{{end}}
+ </a>
+ </div>
+ </button>
+ {{end}}
</div>
{{template "repo/actions/runs_list" .}}
</div>