From 51a7c3d06f9a02e85fae2f99547497a6860a52e2 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Sat, 1 Feb 2020 15:48:20 +0800 Subject: [PATCH 1/2] Fix branch page pull request title and link error --- templates/repo/branch/list.tmpl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/templates/repo/branch/list.tmpl b/templates/repo/branch/list.tmpl index 073516f25fe6e..d2523672d03f2 100644 --- a/templates/repo/branch/list.tmpl +++ b/templates/repo/branch/list.tmpl @@ -91,13 +91,13 @@ {{end}} {{else}} - #{{.LatestPullRequest.Issue.Index}} + {{if not .LatestPullRequest.IsSameRepo}}{{.LatestPullRequest.BaseRepo.FullName}}{{end}}#{{.LatestPullRequest.Issue.Index}} {{if .LatestPullRequest.HasMerged}} - {{$.i18n.Tr "repo.pulls.merged"}} + {{$.i18n.Tr "repo.pulls.merged"}} {{else if .LatestPullRequest.Issue.IsClosed}} - {{$.i18n.Tr "repo.issues.closed_title"}} + {{$.i18n.Tr "repo.issues.closed_title"}} {{else}} - {{$.i18n.Tr "repo.issues.open_title"}} + {{$.i18n.Tr "repo.issues.open_title"}} {{end}} {{end}} From da09245cca85603f9ee435a95e72a9f4b465e94c Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Sat, 1 Feb 2020 21:24:54 +0800 Subject: [PATCH 2/2] Fix ui --- routers/repo/branch.go | 2 +- templates/repo/branch/list.tmpl | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/routers/repo/branch.go b/routers/repo/branch.go index 88bbe2be56989..ea4f68948d10b 100644 --- a/routers/repo/branch.go +++ b/routers/repo/branch.go @@ -239,6 +239,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] @@ -261,7 +262,6 @@ func loadBranches(ctx *context.Context) []*Branch { mergeMovedOn = true } } - } isIncluded := divergence.Ahead == 0 && ctx.Repo.Repository.DefaultBranch != branchName diff --git a/templates/repo/branch/list.tmpl b/templates/repo/branch/list.tmpl index d2523672d03f2..a24360795eb54 100644 --- a/templates/repo/branch/list.tmpl +++ b/templates/repo/branch/list.tmpl @@ -73,7 +73,7 @@ {{end}} - + {{if not .LatestPullRequest}} {{if .IsIncluded}} @@ -93,11 +93,11 @@ {{else}} {{if not .LatestPullRequest.IsSameRepo}}{{.LatestPullRequest.BaseRepo.FullName}}{{end}}#{{.LatestPullRequest.Issue.Index}} {{if .LatestPullRequest.HasMerged}} - {{$.i18n.Tr "repo.pulls.merged"}} + {{$.i18n.Tr "repo.pulls.merged"}} {{else if .LatestPullRequest.Issue.IsClosed}} - {{$.i18n.Tr "repo.issues.closed_title"}} + {{$.i18n.Tr "repo.issues.closed_title"}} {{else}} - {{$.i18n.Tr "repo.issues.open_title"}} + {{$.i18n.Tr "repo.issues.open_title"}} {{end}} {{end}}