Browse Source

Add merged commit id on pull view when it's merged (#8062)

tags/v1.10.0-rc1
Lunny Xiao 4 years ago
parent
commit
6ed22ffd16
2 changed files with 7 additions and 1 deletions
  1. 1
    0
      options/locale/locale_en-US.ini
  2. 6
    1
      templates/repo/issue/view_content/pull.tmpl

+ 1
- 0
options/locale/locale_en-US.ini View File

@@ -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 <a rel="nofollow" class="ui sha" href="%[1]s"><code>%[2]s</code></a>.
pulls.has_merged = The pull request has been merged.
pulls.title_wip_desc = `<a href="#">Start the title with <strong>%s</strong></a> 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 <strong>%s</strong> prefix from the title when it's ready

+ 6
- 1
templates/repo/issue/view_content/pull.tmpl View File

@@ -49,7 +49,12 @@
<div class="ui {{if not $.LatestCommitStatus}}top attached header{{else}}attached merge-section segment{{end}}">
{{if .Issue.PullRequest.HasMerged}}
<div class="item text purple">
{{$.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}}
</div>
{{if .IsPullBranchDeletable}}
<div class="ui divider"></div>

Loading…
Cancel
Save