From 3d5e590d71d2a44c32d7edea128997d2bd491f81 Mon Sep 17 00:00:00 2001 From: chenyifan01 Date: Thu, 12 May 2022 17:34:15 +0800 Subject: [PATCH] #1773 update --- routers/repo/view.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/routers/repo/view.go b/routers/repo/view.go index b28e21aa1..6880d5261 100755 --- a/routers/repo/view.go +++ b/routers/repo/view.go @@ -608,6 +608,11 @@ func getContributorInfo(contributorInfos []*ContributorInfo, email string) *Cont // Home render repository home page func Home(ctx *context.Context) { + if ctx.Repo.CanEnableEditor() { + ctx.Data["CanEditFile"] = true + } else { + ctx.Data["CanEditFile"] = false + } if len(ctx.Repo.Units) > 0 { //get repo contributors info contributors, err := git.GetContributors(ctx.Repo.Repository.RepoPath(), ctx.Repo.BranchName)