From 6cee57eb14ad8aa226b7c5698e8940ac942c3b3b Mon Sep 17 00:00:00 2001 From: puni9869 Date: Tue, 21 Mar 2023 00:56:09 +0530 Subject: [PATCH 1/4] Adding tooltip on "Approve" and "Review Changes" buttons when authors is try to do by them self on their PR. --- options/locale/locale_en-US.ini | 2 ++ templates/repo/diff/new_review.tmpl | 16 ++++++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index e519258c6b28..a5b35df24ec1 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 af970a67b692..1fafb8e6aa3d 100644 --- a/templates/repo/diff/new_review.tmpl +++ b/templates/repo/diff/new_review.tmpl @@ -22,9 +22,21 @@ {{end}}
- + {{if and $.IsSigned ($.Issue.IsPoster $.SignedUser.ID)}} + + + + {{else}} + + {{end}} - + {{if and $.IsSigned ($.Issue.IsPoster $.SignedUser.ID)}} + + + + {{else}} + + {{end}} From 1c41c7cc1b53c69d1ec68f0112b5a839b634c232 Mon Sep 17 00:00:00 2001 From: puni9869 Date: Tue, 21 Mar 2023 01:04:43 +0530 Subject: [PATCH 2/4] Fixing author check in disable and style --- templates/repo/diff/new_review.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/repo/diff/new_review.tmpl b/templates/repo/diff/new_review.tmpl index 1fafb8e6aa3d..d221df1ca8da 100644 --- a/templates/repo/diff/new_review.tmpl +++ b/templates/repo/diff/new_review.tmpl @@ -27,7 +27,7 @@ {{else}} - + {{end}} {{if and $.IsSigned ($.Issue.IsPoster $.SignedUser.ID)}} From 969a1c3b58b4da57c717a86758152cc9588525bc Mon Sep 17 00:00:00 2001 From: puni9869 Date: Tue, 21 Mar 2023 01:42:17 +0530 Subject: [PATCH 3/4] Review fixes for span translations. --- options/locale/locale_en-US.ini | 4 ++-- templates/repo/diff/new_review.tmpl | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index a5b35df24ec1..818a6bbef1b2 100644 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -2265,9 +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.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.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 d221df1ca8da..5c784c7ba6f1 100644 --- a/templates/repo/diff/new_review.tmpl +++ b/templates/repo/diff/new_review.tmpl @@ -22,7 +22,8 @@ {{end}}
- {{if and $.IsSigned ($.Issue.IsPoster $.SignedUser.ID)}} + {{$showSelfTooltip := (and $.IsSigned ($.Issue.IsPoster $.SignedUser.ID))}} + {{if $showSelfTooltip}} @@ -30,8 +31,8 @@ {{end}} - {{if and $.IsSigned ($.Issue.IsPoster $.SignedUser.ID)}} - + {{if $showSelfTooltip}} + {{else}} From fbb3df31261efd6da190590f26a4657b12ecae9f Mon Sep 17 00:00:00 2001 From: puni9869 Date: Tue, 21 Mar 2023 02:24:01 +0530 Subject: [PATCH 4/4] Fixing the tooltip position:: css fix --- templates/repo/diff/new_review.tmpl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/repo/diff/new_review.tmpl b/templates/repo/diff/new_review.tmpl index 5c784c7ba6f1..b4254bc39702 100644 --- a/templates/repo/diff/new_review.tmpl +++ b/templates/repo/diff/new_review.tmpl @@ -24,7 +24,7 @@
{{$showSelfTooltip := (and $.IsSigned ($.Issue.IsPoster $.SignedUser.ID))}} {{if $showSelfTooltip}} - + {{else}} @@ -32,7 +32,7 @@ {{end}} {{if $showSelfTooltip}} - + {{else}}