summaryrefslogtreecommitdiffstats
path: root/templates/repo/home.tmpl
diff options
context:
space:
mode:
authorGiteabot <teabot@gitea.io>2023-06-18 06:24:54 -0400
committerGitHub <noreply@github.com>2023-06-18 10:24:54 +0000
commit4e79c76ed06d1567d4c73bbb6bef1a8eb004cdcc (patch)
treed0c3780832bbbb71d46ae5f0c4e8da2efd131e31 /templates/repo/home.tmpl
parent3bd311c3f40036fac1c194072cea8e85f30e3780 (diff)
downloadgitea-4e79c76ed06d1567d4c73bbb6bef1a8eb004cdcc.tar.gz
gitea-4e79c76ed06d1567d4c73bbb6bef1a8eb004cdcc.zip
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 <i@hiif.ong>
Diffstat (limited to 'templates/repo/home.tmpl')
-rw-r--r--templates/repo/home.tmpl2
1 files changed, 1 insertions, 1 deletions
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 @@
<a href="{{.Repository.Link}}/find/{{.BranchNameSubURL}}" class="ui compact basic button">{{.locale.Tr "repo.find_file.go_to_file"}}</a>
{{end}}
- {{if and .CanWriteCode .IsViewBranch (not .Repository.IsArchived)}}
+ {{if and .CanWriteCode .IsViewBranch (not .Repository.IsArchived) (not .IsViewFile)}}
<button class="ui dropdown basic compact jump button gt-mr-2"{{if not .Repository.CanEnableEditor}} disabled{{end}}>
{{.locale.Tr "repo.editor.add_file"}}
{{svg "octicon-triangle-down" 14 "dropdown icon"}}