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>
This commit is contained in:
Giteabot 2023-06-18 06:24:54 -04:00 committed by GitHub
parent 3bd311c3f4
commit 4e79c76ed0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -83,7 +83,7 @@
<a href="{{.Repository.Link}}/find/{{.BranchNameSubURL}}" class="ui compact basic button">{{.locale.Tr "repo.find_file.go_to_file"}}</a> <a href="{{.Repository.Link}}/find/{{.BranchNameSubURL}}" class="ui compact basic button">{{.locale.Tr "repo.find_file.go_to_file"}}</a>
{{end}} {{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}}> <button class="ui dropdown basic compact jump button gt-mr-2"{{if not .Repository.CanEnableEditor}} disabled{{end}}>
{{.locale.Tr "repo.editor.add_file"}} {{.locale.Tr "repo.editor.add_file"}}
{{svg "octicon-triangle-down" 14 "dropdown icon"}} {{svg "octicon-triangle-down" 14 "dropdown icon"}}