From fb3ac3ce6402a15b0047652870d6d638e10efd1d 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 967b81c608516..521256584a9c7 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 489189ec45a1c..4a21c0fd28ce2 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)}}