Skip to content

Commit 32ec254

Browse files
authored
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.
1 parent da461b5 commit 32ec254

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

templates/repo/home.tmpl

+4-4
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,7 @@
6464
<div class="repo-button-row gt-df gt-ac gt-sb gt-fw">
6565
<div class="gt-df gt-ac gt-fw gt-gap-y-3">
6666
{{template "repo/branch_dropdown" dict "root" . "ContainerClasses" "gt-mr-2"}}
67-
{{$n := len .TreeNames}}
68-
{{$l := Eval $n "-" 1}}
69-
<!-- If home page, show new pr. If not, show breadcrumb -->
70-
{{if and (eq $n 0) .CanCompareOrPull .IsViewBranch (not .Repository.IsArchived)}}
67+
{{if and .CanCompareOrPull .IsViewBranch (not .Repository.IsArchived)}}
7168
{{$cmpBranch := ""}}
7269
{{if ne .Repository.ID .BaseRepo.ID}}
7370
{{$cmpBranch = printf "%s/%s:" (.Repository.OwnerName|PathEscape) (.Repository.Name|PathEscape)}}
@@ -79,6 +76,9 @@
7976
{{svg "octicon-git-pull-request"}}
8077
</a>
8178
{{end}}
79+
<!-- Show go to file and breadcrumbs if not on home page -->
80+
{{$n := len .TreeNames}}
81+
{{$l := Eval $n "-" 1}}
8282
{{if eq $n 0}}
8383
<a href="{{.Repository.Link}}/find/{{.BranchNameSubURL}}" class="ui compact basic button">{{.locale.Tr "repo.find_file.go_to_file"}}</a>
8484
{{end}}

0 commit comments

Comments
 (0)