aboutsummaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorPunit Inani <80308335+puni9869@users.noreply.github.com>2023-03-21 03:24:23 +0530
committerGitHub <noreply@github.com>2023-03-20 17:54:23 -0400
commita8c30a45fa49a3a551b1dca882960008c254bb3d (patch)
tree792d61da2590e2267cb7c8f896d671179069011d /templates
parent8f3aaef3747e8c656cfe2562996dc1806b4d8a0f (diff)
downloadgitea-a8c30a45fa49a3a551b1dca882960008c254bb3d.tar.gz
gitea-a8c30a45fa49a3a551b1dca882960008c254bb3d.zip
`Publish Review` buttons should indicate why they are disabled (#23598)
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 <img width="841" alt="image" src="https://user-images.githubusercontent.com/80308335/226445845-b5f6f6c9-f0dc-4934-a282-3b8be06417a8.png">
Diffstat (limited to 'templates')
-rw-r--r--templates/repo/diff/new_review.tmpl17
1 files changed, 15 insertions, 2 deletions
diff --git a/templates/repo/diff/new_review.tmpl b/templates/repo/diff/new_review.tmpl
index af970a67b6..b4254bc397 100644
--- a/templates/repo/diff/new_review.tmpl
+++ b/templates/repo/diff/new_review.tmpl
@@ -22,9 +22,22 @@
</div>
{{end}}
<div class="ui divider"></div>
- <button type="submit" name="type" value="approve" {{if and $.IsSigned ($.Issue.IsPoster $.SignedUser.ID)}} disabled {{end}} class="ui submit green tiny button btn-submit">{{$.locale.Tr "repo.diff.review.approve"}}</button>
+ {{$showSelfTooltip := (and $.IsSigned ($.Issue.IsPoster $.SignedUser.ID))}}
+ {{if $showSelfTooltip}}
+ <span class="gt-dib tooltip" data-content="{{$.locale.Tr "repo.diff.review.self_approve"}}">
+ <button type="submit" name="type" value="approve" disabled class="ui submit green tiny button btn-submit">{{$.locale.Tr "repo.diff.review.approve"}}</button>
+ </span>
+ {{else}}
+ <button type="submit" name="type" value="approve" class="ui submit green tiny button btn-submit">{{$.locale.Tr "repo.diff.review.approve"}}</button>
+ {{end}}
<button type="submit" name="type" value="comment" class="ui submit tiny basic button btn-submit">{{$.locale.Tr "repo.diff.review.comment"}}</button>
- <button type="submit" name="type" value="reject" {{if and $.IsSigned ($.Issue.IsPoster $.SignedUser.ID)}} disabled {{end}} class="ui submit red tiny button btn-submit">{{$.locale.Tr "repo.diff.review.reject"}}</button>
+ {{if $showSelfTooltip}}
+ <span class="gt-dib tooltip" data-content="{{$.locale.Tr "repo.diff.review.self_reject"}}">
+ <button type="submit" name="type" value="reject" disabled class="ui submit red tiny button btn-submit">{{$.locale.Tr "repo.diff.review.reject"}}</button>
+ </span>
+ {{else}}
+ <button type="submit" name="type" value="reject" class="ui submit red tiny button btn-submit">{{$.locale.Tr "repo.diff.review.reject"}}</button>
+ {{end}}
</form>
</div>
</div>