mirror of
https://github.com/go-gitea/gitea.git
synced 2024-11-16 02:18:22 -07:00
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.
This commit is contained in:
parent
da461b5a08
commit
32ec2540cc
@ -64,10 +64,7 @@
|
|||||||
<div class="repo-button-row gt-df gt-ac gt-sb gt-fw">
|
<div class="repo-button-row gt-df gt-ac gt-sb gt-fw">
|
||||||
<div class="gt-df gt-ac gt-fw gt-gap-y-3">
|
<div class="gt-df gt-ac gt-fw gt-gap-y-3">
|
||||||
{{template "repo/branch_dropdown" dict "root" . "ContainerClasses" "gt-mr-2"}}
|
{{template "repo/branch_dropdown" dict "root" . "ContainerClasses" "gt-mr-2"}}
|
||||||
{{$n := len .TreeNames}}
|
{{if and .CanCompareOrPull .IsViewBranch (not .Repository.IsArchived)}}
|
||||||
{{$l := Eval $n "-" 1}}
|
|
||||||
<!-- If home page, show new pr. If not, show breadcrumb -->
|
|
||||||
{{if and (eq $n 0) .CanCompareOrPull .IsViewBranch (not .Repository.IsArchived)}}
|
|
||||||
{{$cmpBranch := ""}}
|
{{$cmpBranch := ""}}
|
||||||
{{if ne .Repository.ID .BaseRepo.ID}}
|
{{if ne .Repository.ID .BaseRepo.ID}}
|
||||||
{{$cmpBranch = printf "%s/%s:" (.Repository.OwnerName|PathEscape) (.Repository.Name|PathEscape)}}
|
{{$cmpBranch = printf "%s/%s:" (.Repository.OwnerName|PathEscape) (.Repository.Name|PathEscape)}}
|
||||||
@ -79,6 +76,9 @@
|
|||||||
{{svg "octicon-git-pull-request"}}
|
{{svg "octicon-git-pull-request"}}
|
||||||
</a>
|
</a>
|
||||||
{{end}}
|
{{end}}
|
||||||
|
<!-- Show go to file and breadcrumbs if not on home page -->
|
||||||
|
{{$n := len .TreeNames}}
|
||||||
|
{{$l := Eval $n "-" 1}}
|
||||||
{{if eq $n 0}}
|
{{if eq $n 0}}
|
||||||
<a href="{{.Repository.Link}}/find/{{.BranchNameSubURL}}" class="ui compact basic button">{{.locale.Tr "repo.find_file.go_to_file"}}</a>
|
<a href="{{.Repository.Link}}/find/{{.BranchNameSubURL}}" class="ui compact basic button">{{.locale.Tr "repo.find_file.go_to_file"}}</a>
|
||||||
{{end}}
|
{{end}}
|
||||||
|
Loading…
Reference in New Issue
Block a user