From 6ed22ffd16b80348d52daa0e1915608d307bfe87 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Tue, 3 Sep 2019 14:29:36 +0800 Subject: [PATCH] Add merged commit id on pull view when it's merged (#8062) --- options/locale/locale_en-US.ini | 1 + templates/repo/issue/view_content/pull.tmpl | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index 4d2031c5de..b76d82ca86 100644 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -971,6 +971,7 @@ pulls.tab_files = Files Changed pulls.reopen_to_merge = Please reopen this pull request to perform a merge. pulls.cant_reopen_deleted_branch = This pull request cannot be reopened because the branch was deleted. pulls.merged = Merged +pulls.merged_as = The pull request has been merged as %[2]s. pulls.has_merged = The pull request has been merged. pulls.title_wip_desc = `Start the title with %s to prevent the pull request from being merged accidentally.` pulls.cannot_merge_work_in_progress = This pull request is marked as a work in progress. Remove the %s prefix from the title when it's ready diff --git a/templates/repo/issue/view_content/pull.tmpl b/templates/repo/issue/view_content/pull.tmpl index 7bb3c91275..f0e39d5e37 100644 --- a/templates/repo/issue/view_content/pull.tmpl +++ b/templates/repo/issue/view_content/pull.tmpl @@ -49,7 +49,12 @@
{{if .Issue.PullRequest.HasMerged}}
- {{$.i18n.Tr "repo.pulls.has_merged"}} + {{if .Issue.PullRequest.MergedCommitID}} + {{$link := printf "%s/commit/%s" $.Repository.HTMLURL .Issue.PullRequest.MergedCommitID}} + {{$.i18n.Tr "repo.pulls.merged_as" $link (ShortSha .Issue.PullRequest.MergedCommitID) | Safe}} + {{else}} + {{$.i18n.Tr "repo.pulls.has_merged"}} + {{end}}
{{if .IsPullBranchDeletable}}