From 13ae5cd7136112b65c5b57305f97f8ca596b2ca6 Mon Sep 17 00:00:00 2001 From: yp05327 <576951401@qq.com> Date: Tue, 21 Nov 2023 02:24:30 +0000 Subject: [PATCH 1/3] add --- modules/context/repo.go | 1 + options/locale/locale_en-US.ini | 3 +++ templates/repo/actions/list.tmpl | 4 ++++ templates/repo/actions/no_workflows.tmpl | 8 ++++++++ 4 files changed, 16 insertions(+) create mode 100644 templates/repo/actions/no_workflows.tmpl diff --git a/modules/context/repo.go b/modules/context/repo.go index 41683a693882b..f91dd6aa9a83e 100644 --- a/modules/context/repo.go +++ b/modules/context/repo.go @@ -563,6 +563,7 @@ func RepoAssignment(ctx *Context) context.CancelFunc { ctx.Data["CanWriteCode"] = ctx.Repo.CanWrite(unit_model.TypeCode) ctx.Data["CanWriteIssues"] = ctx.Repo.CanWrite(unit_model.TypeIssues) ctx.Data["CanWritePulls"] = ctx.Repo.CanWrite(unit_model.TypePullRequests) + ctx.Data["CanWriteActions"] = ctx.Repo.CanWrite(unit_model.TypeActions) canSignedUserFork, err := repo_module.CanUserForkRepo(ctx, ctx.Doer, ctx.Repo.Repository) if err != nil { diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index ee5ae7467aa4a..12e96abe6d6bc 100644 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -3529,6 +3529,9 @@ runs.status = Status runs.actors_no_select = All actors runs.status_no_select = All status runs.no_results = No results matched. +runs.no_workflows = There are no workflows yet. +runs.no_workflows.quick_start = Don't know how to start with Gitea Action? See the quick start guide. +runs.no_workflows.documentation = For more information on the Gitea Action, see the documentation. runs.no_runs = The workflow has no runs yet. workflow.disable = Disable Workflow diff --git a/templates/repo/actions/list.tmpl b/templates/repo/actions/list.tmpl index aa6d66fa6860e..ede4c82602da2 100644 --- a/templates/repo/actions/list.tmpl +++ b/templates/repo/actions/list.tmpl @@ -4,6 +4,7 @@
{{ctx.Locale.Tr "actions.runs.no_workflows.quick_start" "https://docs.gitea.com/usage/actions/quickstart/" | Safe}}
+ {{end}} +{{ctx.Locale.Tr "actions.runs.no_workflows.documentation" "https://docs.gitea.com/usage/actions/overview/" | Safe}}
+{{ctx.Locale.Tr "actions.runs.no_workflows.quick_start" "https://docs.gitea.com/usage/actions/quickstart/" | Safe}}
{{end}}{{ctx.Locale.Tr "actions.runs.no_workflows.documentation" "https://docs.gitea.com/usage/actions/overview/" | Safe}}
- \ No newline at end of file + From 7dd6c862b0a79f8ccadc29142a82ce461da77f98 Mon Sep 17 00:00:00 2001 From: yp05327 <576951401@qq.com> Date: Tue, 21 Nov 2023 04:02:36 +0000 Subject: [PATCH 3/3] fix typo --- templates/repo/actions/no_workflows.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/repo/actions/no_workflows.tmpl b/templates/repo/actions/no_workflows.tmpl index 9313190e4f170..af1f28e8cfdb9 100644 --- a/templates/repo/actions/no_workflows.tmpl +++ b/templates/repo/actions/no_workflows.tmpl @@ -1,7 +1,7 @@{{ctx.Locale.Tr "actions.runs.no_workflows.quick_start" "https://docs.gitea.com/usage/actions/quickstart/" | Safe}}
{{end}}{{ctx.Locale.Tr "actions.runs.no_workflows.documentation" "https://docs.gitea.com/usage/actions/overview/" | Safe}}