From 32ec2540ccc709bf0ba3fbb5d7e5e557efeed52c Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Mon, 22 May 2023 09:57:00 +0200 Subject: [PATCH] Show new pull request button also on subdirectories and files (#24842) Instead of only on the repository home page. Saves a click and makes this functionality a bit easier to find when editing files in a subdirectory. --- templates/repo/home.tmpl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/templates/repo/home.tmpl b/templates/repo/home.tmpl index 7c084b0686..56962aa3a5 100644 --- a/templates/repo/home.tmpl +++ b/templates/repo/home.tmpl @@ -64,10 +64,7 @@
{{template "repo/branch_dropdown" dict "root" . "ContainerClasses" "gt-mr-2"}} - {{$n := len .TreeNames}} - {{$l := Eval $n "-" 1}} - - {{if and (eq $n 0) .CanCompareOrPull .IsViewBranch (not .Repository.IsArchived)}} + {{if and .CanCompareOrPull .IsViewBranch (not .Repository.IsArchived)}} {{$cmpBranch := ""}} {{if ne .Repository.ID .BaseRepo.ID}} {{$cmpBranch = printf "%s/%s:" (.Repository.OwnerName|PathEscape) (.Repository.Name|PathEscape)}} @@ -79,6 +76,9 @@ {{svg "octicon-git-pull-request"}} {{end}} + + {{$n := len .TreeNames}} + {{$l := Eval $n "-" 1}} {{if eq $n 0}} {{.locale.Tr "repo.find_file.go_to_file"}} {{end}}