diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2020-02-02 01:37:52 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-01 17:37:52 +0000 |
commit | 22dec1cea6ad9a0a22b62de6bbc097cf3f2e1711 (patch) | |
tree | 2406ae0dc2d1b6eebc0ee775b2d9835152e155f9 | |
parent | 0c5e2e2e4cf1b1d28f697f92787a199fb6179e32 (diff) | |
download | gitea-22dec1cea6ad9a0a22b62de6bbc097cf3f2e1711.tar.gz gitea-22dec1cea6ad9a0a22b62de6bbc097cf3f2e1711.zip |
Fix branch page pull request title and link error (#10092) (#10098)
* Fix branch page pull request title and link error (#10092)
* Fix tmpl
-rw-r--r-- | routers/repo/branch.go | 2 | ||||
-rw-r--r-- | templates/repo/branch/list.tmpl | 10 |
2 files changed, 6 insertions, 6 deletions
diff --git a/routers/repo/branch.go b/routers/repo/branch.go index f57e76d494..93eb384810 100644 --- a/routers/repo/branch.go +++ b/routers/repo/branch.go @@ -221,6 +221,7 @@ func loadBranches(ctx *context.Context) []*Branch { } else { repoIDToRepo[pr.BaseRepoID] = pr.BaseRepo } + pr.Issue.Repo = pr.BaseRepo if pr.HasMerged { baseGitRepo, ok := repoIDToGitRepo[pr.BaseRepoID] @@ -243,7 +244,6 @@ func loadBranches(ctx *context.Context) []*Branch { mergeMovedOn = true } } - } branches[i] = &Branch{ diff --git a/templates/repo/branch/list.tmpl b/templates/repo/branch/list.tmpl index 7707b3cf1d..a110d1ec66 100644 --- a/templates/repo/branch/list.tmpl +++ b/templates/repo/branch/list.tmpl @@ -73,7 +73,7 @@ </div> {{end}} </td> - <td class="two wide right aligned"> + <td class="three wide right aligned"> {{if not .LatestPullRequest}} {{if and (not .IsDeleted) $.AllowsPulls (gt .CommitsAhead 0)}} <a href="{{$.RepoLink}}/compare/{{$.DefaultBranch | EscapePound}}...{{if ne $.Repository.Owner.Name $.Owner.Name}}{{$.Owner.Name}}:{{end}}{{.Name | EscapePound}}"> @@ -87,13 +87,13 @@ </a> {{end}} {{else}} - <a href="{{$.RepoLink}}/pulls/{{.LatestPullRequest.Issue.Index}}">#{{.LatestPullRequest.Issue.Index}}</a> + <a href="{{.LatestPullRequest.Issue.HTMLURL}}">{{if ne .LatestPullRequest.BaseRepoID .LatestPullRequest.HeadRepoID}}{{.LatestPullRequest.BaseRepo.FullName}}{{end}}#{{.LatestPullRequest.Issue.Index}}</a> {{if .LatestPullRequest.HasMerged}} - <a href="{{$.RepoLink}}/pulls/{{.LatestPullRequest.Issue.Index}}" class="ui purple small label"><i class="octicon octicon-git-pull-request"></i> {{$.i18n.Tr "repo.pulls.merged"}}</a> + <a href="{{.LatestPullRequest.Issue.HTMLURL}}" class="ui purple mini label"><i class="octicon octicon-git-pull-request"></i> {{$.i18n.Tr "repo.pulls.merged"}}</a> {{else if .LatestPullRequest.Issue.IsClosed}} - <a href="{{$.RepoLink}}/pulls/{{.LatestPullRequest.Issue.Index}}" class="ui red small label"><i class="octicon octicon-issue-closed"></i> {{$.i18n.Tr "repo.issues.closed_title"}}</a> + <a href="{{.LatestPullRequest.Issue.HTMLURL}}" class="ui red mini label"><i class="octicon octicon-issue-closed"></i> {{$.i18n.Tr "repo.issues.closed_title"}}</a> {{else}} - <a href="{{$.RepoLink}}/pulls/{{.LatestPullRequest.Issue.Index}}" class="ui green small label"><i class="octicon octicon-issue-opened"></i> {{$.i18n.Tr "repo.issues.open_title"}}</a> + <a href="{{.LatestPullRequest.Issue.HTMLURL}}" class="ui green mini label"><i class="octicon octicon-issue-opened"></i> {{$.i18n.Tr "repo.issues.open_title"}}</a> {{end}} {{end}} </td> |