aboutsummaryrefslogtreecommitdiffstats
path: root/templates/repo
diff options
context:
space:
mode:
authorBrecht Van Lommel <brecht@blender.org>2023-05-22 09:57:00 +0200
committerGitHub <noreply@github.com>2023-05-22 07:57:00 +0000
commit32ec2540ccc709bf0ba3fbb5d7e5e557efeed52c (patch)
tree61f28e51865e579ad6b7855b19b11148b6e74c30 /templates/repo
parentda461b5a085c0fbf705df9a751159d13bee7139a (diff)
downloadgitea-32ec2540ccc709bf0ba3fbb5d7e5e557efeed52c.tar.gz
gitea-32ec2540ccc709bf0ba3fbb5d7e5e557efeed52c.zip
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.
Diffstat (limited to 'templates/repo')
-rw-r--r--templates/repo/home.tmpl8
1 files 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 @@
<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">
{{template "repo/branch_dropdown" dict "root" . "ContainerClasses" "gt-mr-2"}}
- {{$n := len .TreeNames}}
- {{$l := Eval $n "-" 1}}
- <!-- If home page, show new pr. If not, show breadcrumb -->
- {{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"}}
</a>
{{end}}
+ <!-- Show go to file and breadcrumbs if not on home page -->
+ {{$n := len .TreeNames}}
+ {{$l := Eval $n "-" 1}}
{{if eq $n 0}}
<a href="{{.Repository.Link}}/find/{{.BranchNameSubURL}}" class="ui compact basic button">{{.locale.Tr "repo.find_file.go_to_file"}}</a>
{{end}}