From 41655ee8781cad827e22ff0274c447cf82eda5da Mon Sep 17 00:00:00 2001 From: Giteabot Date: Sun, 12 Mar 2023 10:17:25 -0400 Subject: [PATCH] Show edit/close/delete button on organization wide repositories (#23388) (#23429) Backport #23388 by @yp05327 A part of https://github.com/go-gitea/gitea/pull/22865 Co-authored-by: yp05327 <576951401@qq.com> --- 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 967b81c60..521256584 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 489189ec4..4a21c0fd2 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}}