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)