From 28e5e7fcbca9cd2030c156ec45f6f3cf67b3682e Mon Sep 17 00:00:00 2001
From: silverwind <me@silverwind.io>
Date: Thu, 30 Apr 2020 15:49:12 +0200
Subject: [PATCH] Add a 'this' to issue close/reopened messages (#11204)

* add a 'this' to issue close/reopened messages

* add 'this issue/pull request' and create new localization entries

Co-authored-by: Lauris BH <lauris@nix.lv>
---
 options/locale/locale_en-US.ini                 |  6 ++++--
 templates/repo/issue/view_content/comments.tmpl | 12 ++++++++++--
 2 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini
index d85dc39a89..8d188e32e5 100644
--- a/options/locale/locale_en-US.ini
+++ b/options/locale/locale_en-US.ini
@@ -935,8 +935,8 @@ issues.close_comment_issue = Comment and Close
 issues.reopen_issue = Reopen
 issues.reopen_comment_issue = Comment and Reopen
 issues.create_comment = Comment
-issues.closed_at = `closed <a id="%[1]s" href="#%[1]s">%[2]s</a>`
-issues.reopened_at = `reopened <a id="%[1]s" href="#%[1]s">%[2]s</a>`
+issues.closed_at = `closed this issue <a id="%[1]s" href="#%[1]s">%[2]s</a>`
+issues.reopened_at = `reopened this issue <a id="%[1]s" href="#%[1]s">%[2]s</a>`
 issues.commit_ref_at = `referenced this issue from a commit <a id="%[1]s" href="#%[1]s">%[2]s</a>`
 issues.ref_issue_from = `<a href="%[3]s">referenced this issue %[4]s</a> <a id="%[1]s" href="#%[1]s">%[2]s</a>`
 issues.ref_pull_from = `<a href="%[3]s">referenced this pull request %[4]s</a> <a id="%[1]s" href="#%[1]s">%[2]s</a>`
@@ -1152,6 +1152,8 @@ pulls.update_branch = Update branch
 pulls.update_branch_success = Branch update was successful
 pulls.update_not_allowed = You are not allowed to update branch
 pulls.outdated_with_base_branch = This branch is out-of-date with the base branch
+pulls.closed_at = `closed this pull request <a id="%[1]s" href="#%[1]s">%[2]s</a>`
+pulls.reopened_at = `reopened this pull request <a id="%[1]s" href="#%[1]s">%[2]s</a>`
 
 milestones.new = New Milestone
 milestones.open_tab = %d Open
diff --git a/templates/repo/issue/view_content/comments.tmpl b/templates/repo/issue/view_content/comments.tmpl
index 0353e10135..a3b4fb81e0 100644
--- a/templates/repo/issue/view_content/comments.tmpl
+++ b/templates/repo/issue/view_content/comments.tmpl
@@ -75,7 +75,11 @@
 			</a>
 			<span class="text grey">
 				<a class="author" href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a>
-				{{$.i18n.Tr "repo.issues.reopened_at" .EventTag $createdStr | Safe}}
+				{{if .Issue.IsPull }}
+					{{$.i18n.Tr "repo.pulls.reopened_at" .EventTag $createdStr | Safe}}
+				{{else}}
+					{{$.i18n.Tr "repo.issues.reopened_at" .EventTag $createdStr | Safe}}
+				{{end}}
 			</span>
 		</div>
 	{{else if eq .Type 2}}
@@ -86,7 +90,11 @@
 			</a>
 			<span class="text grey">
 				<a class="author" href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a>
-				{{$.i18n.Tr "repo.issues.closed_at" .EventTag $createdStr | Safe}}
+				{{if .Issue.IsPull }}
+					{{$.i18n.Tr "repo.pulls.closed_at" .EventTag $createdStr | Safe}}
+				{{else}}
+					{{$.i18n.Tr "repo.issues.closed_at" .EventTag $createdStr | Safe}}
+				{{end}}
 			</span>
 		</div>
 	{{else if eq .Type 28}}