diff options
author | hiifong <i@hiif.ong> | 2023-06-18 17:21:50 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-18 09:21:50 +0000 |
commit | 57120d99699315d69c0a487cd88625a97bfe6323 (patch) | |
tree | 9028ecb5e0e59f56cec610d27d7a061c40e34b4d /templates | |
parent | f47744c3f11953a48a30b40930887764041552a4 (diff) | |
download | gitea-57120d99699315d69c0a487cd88625a97bfe6323.tar.gz gitea-57120d99699315d69c0a487cd88625a97bfe6323.zip |
When viewing a file, hide the add button (#25320)
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)
Diffstat (limited to 'templates')
-rw-r--r-- | templates/repo/home.tmpl | 2 |
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"}} |