From 4e79c76ed06d1567d4c73bbb6bef1a8eb004cdcc Mon Sep 17 00:00:00 2001 From: Giteabot Date: Sun, 18 Jun 2023 06:24:54 -0400 Subject: [PATCH] When viewing a file, hide the add button (#25320) (#25339) Backport #25320 by @hiifong Fix #25281 When viewing a file, hide the add button ![image](https://github.com/go-gitea/gitea/assets/89133723/839babaf-6b67-46e1-a103-677306fb8503) ![image](https://github.com/go-gitea/gitea/assets/89133723/32a8aeca-31f4-4ce1-a0fa-7656e16b66d3) Co-authored-by: hiifong --- templates/repo/home.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/repo/home.tmpl b/templates/repo/home.tmpl index a983de5a48..8589574a53 100644 --- a/templates/repo/home.tmpl +++ b/templates/repo/home.tmpl @@ -83,7 +83,7 @@ {{.locale.Tr "repo.find_file.go_to_file"}} {{end}} - {{if and .CanWriteCode .IsViewBranch (not .Repository.IsArchived)}} + {{if and .CanWriteCode .IsViewBranch (not .Repository.IsArchived) (not .IsViewFile)}}