From a8c30a45fa49a3a551b1dca882960008c254bb3d Mon Sep 17 00:00:00 2001
From: Punit Inani <80308335+puni9869@users.noreply.github.com>
Date: Tue, 21 Mar 2023 03:24:23 +0530
Subject: [PATCH] `Publish Review` buttons should indicate why they are
disabled (#23598)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Adding tooltip on "Approve" and "Review Changes" buttons. is try to do
by them self on their PR.
Resolves https://github.com/go-gitea/gitea/issues/23547
`Approve` tootip text :- "Pull request authors can’t approve their own
pull request"
`Request Changes` tooltip text:- "Pull request authors can’t request
changes on their own pull request"
Before
https://user-images.githubusercontent.com/115237/225984020-306c048f-cb9b-4dee-8929-1c74c331518b.png
After
---
options/locale/locale_en-US.ini | 2 ++
templates/repo/diff/new_review.tmpl | 17 +++++++++++++++--
2 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini
index e519258c6b2..818a6bbef1b 100644
--- a/options/locale/locale_en-US.ini
+++ b/options/locale/locale_en-US.ini
@@ -2265,7 +2265,9 @@ diff.review.header = Submit review
diff.review.placeholder = Review comment
diff.review.comment = Comment
diff.review.approve = Approve
+diff.review.self_reject = Pull request authors can't request changes on their own pull request
diff.review.reject = Request changes
+diff.review.self_approve = Pull request authors can't approve their own pull request
diff.committed_by = committed by
diff.protected = Protected
diff.image.side_by_side = Side by Side
diff --git a/templates/repo/diff/new_review.tmpl b/templates/repo/diff/new_review.tmpl
index af970a67b69..b4254bc3970 100644
--- a/templates/repo/diff/new_review.tmpl
+++ b/templates/repo/diff/new_review.tmpl
@@ -22,9 +22,22 @@
{{end}}