From 33b03e851f1a99f8d7fb682fec4bcba4f20ff6a8 Mon Sep 17 00:00:00 2001 From: silverwind Date: Tue, 9 Aug 2022 12:32:41 +0200 Subject: [PATCH] Restore history button and hide add button when unable to add (#20718) Fix two regressions from #20602: - Restore the 'History' button that was previously unable to render because it's show condition was never hit - Hide the 'Add File' button when there would be no items in the dropdown. Co-authored-by: wxiaoguang --- templates/repo/home.tmpl | 56 +++++++++++++++++++++------------------- 1 file changed, 29 insertions(+), 27 deletions(-) diff --git a/templates/repo/home.tmpl b/templates/repo/home.tmpl index 1ff2ec5bc5..d7ce2240a0 100644 --- a/templates/repo/home.tmpl +++ b/templates/repo/home.tmpl @@ -73,34 +73,31 @@ {{end}} {{svg "octicon-file-moved" 15}} - + + {{svg "octicon-triangle-down" 14 "dropdown icon"}} + + {{end}} {{else}} {{EllipsisString .Repository.Name 30}}{{range $i, $v := .TreeNames}}/{{if eq $i $l}}{{EllipsisString $v 30}}{{else}}{{ $p := index $.Paths $i}}{{EllipsisString $v 30}}{{end}}{{end}} {{end}} @@ -133,6 +130,11 @@ {{end}} {{end}} + {{if and (ne $n 0) (not .IsViewFile) (not .IsBlame) }} + + {{svg "octicon-history" 16 "mr-3"}}{{.locale.Tr "repo.file_history"}} + + {{end}} {{if .IsViewFile}}