From a04eeb2a548d4fd2b63873fc2acff49c52e19723 Mon Sep 17 00:00:00 2001 From: yp05327 <576951401@qq.com> Date: Sun, 12 Mar 2023 22:36:47 +0900 Subject: [PATCH] Show edit/close/delete button on organization wide repositories (#23388) A part of https://github.com/go-gitea/gitea/pull/22865 --- routers/web/repo/projects.go | 2 +- templates/projects/list.tmpl | 6 +++--- templates/projects/view.tmpl | 4 ++-- templates/repo/projects/list.tmpl | 12 ++++++------ 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/routers/web/repo/projects.go b/routers/web/repo/projects.go index 29bd59c7a3..e15f548a38 100644 --- a/routers/web/repo/projects.go +++ b/routers/web/repo/projects.go @@ -113,7 +113,7 @@ func Projects(ctx *context.Context) { pager.AddParam(ctx, "state", "State") ctx.Data["Page"] = pager - ctx.Data["CanWriteProjects"] = true + ctx.Data["CanWriteProjects"] = ctx.Repo.Permission.CanWrite(unit.TypeProjects) ctx.Data["IsShowClosed"] = isShowClosed ctx.Data["IsProjectsPage"] = true ctx.Data["SortType"] = sortType diff --git a/templates/projects/list.tmpl b/templates/projects/list.tmpl index 489189ec45..4a21c0fd28 100644 --- a/templates/projects/list.tmpl +++ b/templates/projects/list.tmpl @@ -51,7 +51,7 @@ {{JsPrettyNumber .NumClosedIssues}} {{$.locale.Tr "repo.issues.closed_title"}} - {{if and (or $.CanWriteIssues $.CanWritePulls) (not $.Repository.IsArchived)}} + {{if and $.CanWriteProjects (not $.Repository.IsArchived)}}
{{svg "octicon-pencil"}} {{$.locale.Tr "repo.issues.label_edit"}} {{if .IsClosed}} @@ -59,7 +59,7 @@ {{else}} {{svg "octicon-skip"}} {{$.locale.Tr "repo.projects.close"}} {{end}} - {{svg "octicon-trash"}} {{$.locale.Tr "repo.issues.label_delete"}} + {{svg "octicon-trash"}} {{$.locale.Tr "repo.issues.label_delete"}}
{{end}} {{if .Description}} @@ -75,7 +75,7 @@ -{{if or .CanWriteIssues .CanWritePulls}} +{{if $.CanWriteProjects}}