From 7fcf024522e66d71a431fc7fb4c307deaf658a41 Mon Sep 17 00:00:00 2001 From: yp05327 <576951401@qq.com> Date: Thu, 9 Mar 2023 07:29:32 +0000 Subject: [PATCH 1/2] fix missed edit/close/delete button --- routers/web/repo/projects.go | 2 +- templates/projects/list.tmpl | 4 ++-- templates/projects/view.tmpl | 4 ++-- templates/repo/projects/list.tmpl | 12 ++++++------ 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/routers/web/repo/projects.go b/routers/web/repo/projects.go index 967b81c60851..521256584a9c 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 489189ec45a1..4a76c634f677 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}} @@ -75,7 +75,7 @@
-{{if or .CanWriteIssues .CanWritePulls}} +{{if $.CanWriteProjects}}