From a6a9389c702abcb003cbd4a304ec3650345fc14f Mon Sep 17 00:00:00 2001 From: hiifong <i@hiif.ong> Date: Fri, 7 Jul 2023 21:36:14 +0800 Subject: [PATCH] Hide `add file` button for pull mirrors (#25748) I think hiding the add file button for mirror repositories that can keep the ui clean. Before:  After:  --- 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 8589574a53..01ea5d9122 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) (not .IsViewFile)}} + {{if and .CanWriteCode .IsViewBranch (not .Repository.IsMirror) (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"}}