aboutsummaryrefslogtreecommitdiffstats
path: root/templates/repo/home.tmpl
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2021-03-16 01:36:34 +0000
committerGitHub <noreply@github.com>2021-03-16 02:36:34 +0100
commitbf53cf0e0432e5248e393c9157594ebca73fae12 (patch)
tree38bc56f421e5e890d38bc3698fda09f0609be77b /templates/repo/home.tmpl
parentf4629fc472338e935b77f32b8d9dc5793937203a (diff)
downloadgitea-bf53cf0e0432e5248e393c9157594ebca73fae12.tar.gz
gitea-bf53cf0e0432e5248e393c9157594ebca73fae12.zip
Ensure that new pull request button works on forked forks owned by owner of the root (#14932)
Prevent 404 on new pull request button on forked fork owned by the owner of the root repository. Also ensure that the names make sense. Signed-off-by: Andrew Thornton <art27@cantab.net>
Diffstat (limited to 'templates/repo/home.tmpl')
-rw-r--r--templates/repo/home.tmpl2
1 files changed, 1 insertions, 1 deletions
diff --git a/templates/repo/home.tmpl b/templates/repo/home.tmpl
index 4d8d289211..b77f28f920 100644
--- a/templates/repo/home.tmpl
+++ b/templates/repo/home.tmpl
@@ -64,7 +64,7 @@
{{if eq $n 0}}
{{if and .CanCompareOrPull .IsViewBranch (not .Repository.IsArchived)}}
<div class="fitted item mx-0">
- <a href="{{.BaseRepo.Link}}/compare/{{.BaseRepo.DefaultBranch | EscapePound}}...{{if ne .Repository.Owner.Name .BaseRepo.Owner.Name}}{{.Repository.Owner.Name}}:{{end}}{{.BranchName | EscapePound}}">
+ <a href="{{.BaseRepo.Link}}/compare/{{.BaseRepo.DefaultBranch | EscapePound}}...{{if ne .Repository.Owner.Name .BaseRepo.Owner.Name}}{{.Repository.Owner.Name}}{{if .BaseRepo.IsFork}}/{{.Repository.Name}}{{end}}:{{end}}{{.BranchName | EscapePound}}">
<button id="new-pull-request" class="ui compact basic button">{{if .PullRequestCtx.Allowed}}{{.i18n.Tr "repo.pulls.compare_changes"}}{{else}}{{.i18n.Tr "action.compare_branch"}}{{end}}</button>
</a>
</div>